Skip to content

Commit

Permalink
[#noissue] Polishing UrlTraceSampler
Browse files Browse the repository at this point in the history
  • Loading branch information
emeroad committed Jan 19, 2023
1 parent e62784b commit 07dec1a
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import java.util.Objects;

public class UrlTraceSampler implements TraceSampler {
private final List<UrlPathMatcher> urlPathMatcherList;
private final UrlPathMatcher[] urlPathMatcherList;
private final TraceSampler defaultTraceSampler;

public UrlTraceSampler(Map<String, TraceSampler> urlMap, TraceSampler defaultTraceSampler) {
Expand All @@ -44,7 +44,7 @@ public UrlTraceSampler(Map<String, TraceSampler> urlMap, TraceSampler defaultTra
}
list.add(new UrlPathMatcher(urlPath, traceSampler));
}
this.urlPathMatcherList = list;
this.urlPathMatcherList = list.toArray(new UrlPathMatcher[0]);
}

@Override
Expand Down Expand Up @@ -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)) {
Expand Down

0 comments on commit 07dec1a

Please sign in to comment.