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)) {