From e889bb11d34afe47207c9ef23db2d0b20e9ba083 Mon Sep 17 00:00:00 2001 From: Pranav Sharma Date: Fri, 16 Jun 2023 17:52:14 -0400 Subject: [PATCH] Make private static fields final (#256) * Update to static final fields Also fixes a typo * Change logger name to fully qualified name --- .../propagators/XCloudTraceContextPropagator.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/propagators/gcp/src/main/java/com/google/cloud/opentelemetry/propagators/XCloudTraceContextPropagator.java b/propagators/gcp/src/main/java/com/google/cloud/opentelemetry/propagators/XCloudTraceContextPropagator.java index d41f097d..c4882619 100644 --- a/propagators/gcp/src/main/java/com/google/cloud/opentelemetry/propagators/XCloudTraceContextPropagator.java +++ b/propagators/gcp/src/main/java/com/google/cloud/opentelemetry/propagators/XCloudTraceContextPropagator.java @@ -39,11 +39,12 @@ */ public final class XCloudTraceContextPropagator implements TextMapPropagator { - private static String FIELD = "x-cloud-trace-context"; - private static Collection FIELDS = Collections.singletonList(FIELD); - private static Pattern VALUE_PATTERN = + private static final String FIELD = "x-cloud-trace-context"; + private static final Collection FIELDS = Collections.singletonList(FIELD); + private static final Pattern VALUE_PATTERN = Pattern.compile("(?[0-9a-f]{32})\\/(?[\\d]{1,20});o=(?\\d+)"); - private static Logger LOGGER = Logger.getLogger("XCloudTraceContextPropogator"); + private static final Logger LOGGER = + Logger.getLogger(XCloudTraceContextPropagator.class.getCanonicalName()); private final boolean oneway;