From 07dec1a100285d5d1389668cd96ee7d436ff566f Mon Sep 17 00:00:00 2001 From: emeroad Date: Thu, 19 Jan 2023 13:18:31 +0900 Subject: [PATCH] [#noissue] Polishing UrlTraceSampler --- .../pinpoint/profiler/sampler/UrlTraceSampler.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/profiler/src/main/java/com/navercorp/pinpoint/profiler/sampler/UrlTraceSampler.java b/profiler/src/main/java/com/navercorp/pinpoint/profiler/sampler/UrlTraceSampler.java index 9eab93127acd..2df1989abd87 100644 --- a/profiler/src/main/java/com/navercorp/pinpoint/profiler/sampler/UrlTraceSampler.java +++ b/profiler/src/main/java/com/navercorp/pinpoint/profiler/sampler/UrlTraceSampler.java @@ -28,7 +28,7 @@ import java.util.Objects; public class UrlTraceSampler implements TraceSampler { - private final List urlPathMatcherList; + private final UrlPathMatcher[] urlPathMatcherList; private final TraceSampler defaultTraceSampler; public UrlTraceSampler(Map urlMap, TraceSampler defaultTraceSampler) { @@ -44,7 +44,7 @@ public UrlTraceSampler(Map urlMap, TraceSampler defaultTra } list.add(new UrlPathMatcher(urlPath, traceSampler)); } - this.urlPathMatcherList = list; + this.urlPathMatcherList = list.toArray(new UrlPathMatcher[0]); } @Override @@ -84,9 +84,9 @@ TraceSampler getSampler(String urlPath) { return this.defaultTraceSampler; } - private class UrlPathMatcher implements PathMatcher { - private PathMatcher pathMatcher; - private TraceSampler traceSampler; + private static class UrlPathMatcher implements PathMatcher { + private final PathMatcher pathMatcher; + private final TraceSampler traceSampler; public UrlPathMatcher(String urlPath, TraceSampler traceSampler) { if (AntPathMatcher.isAntStylePattern(urlPath)) {