Skip to content

Commit 7fc061c

Browse files
committed
[#noissue] Polishing UrlTraceSampler
1 parent 18602c8 commit 7fc061c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

profiler/src/main/java/com/navercorp/pinpoint/profiler/sampler/UrlTraceSampler.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import java.util.Objects;
2929

3030
public class UrlTraceSampler implements TraceSampler {
31-
private final List<UrlPathMatcher> urlPathMatcherList;
31+
private final UrlPathMatcher[] urlPathMatcherList;
3232
private final TraceSampler defaultTraceSampler;
3333

3434
public UrlTraceSampler(Map<String, TraceSampler> urlMap, TraceSampler defaultTraceSampler) {
@@ -44,7 +44,7 @@ public UrlTraceSampler(Map<String, TraceSampler> urlMap, TraceSampler defaultTra
4444
}
4545
list.add(new UrlPathMatcher(urlPath, traceSampler));
4646
}
47-
this.urlPathMatcherList = list;
47+
this.urlPathMatcherList = list.toArray(new UrlPathMatcher[0]);
4848
}
4949

5050
@Override
@@ -84,9 +84,9 @@ TraceSampler getSampler(String urlPath) {
8484
return this.defaultTraceSampler;
8585
}
8686

87-
private class UrlPathMatcher implements PathMatcher {
88-
private PathMatcher pathMatcher;
89-
private TraceSampler traceSampler;
87+
private static class UrlPathMatcher implements PathMatcher {
88+
private final PathMatcher pathMatcher;
89+
private final TraceSampler traceSampler;
9090

9191
public UrlPathMatcher(String urlPath, TraceSampler traceSampler) {
9292
if (AntPathMatcher.isAntStylePattern(urlPath)) {

0 commit comments

Comments
 (0)