Small optimization (#4293)

This commit is contained in:
Trask Stalnaker 2021-10-04 21:45:10 -07:00 committed by GitHub
parent 7448ebf306
commit 0994c07bcf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -6,15 +6,11 @@
package io.opentelemetry.javaagent.tooling.ignore;
import io.opentelemetry.javaagent.instrumentation.api.util.Trie;
import java.util.regex.Pattern;
import net.bytebuddy.description.type.TypeDescription;
import net.bytebuddy.matcher.ElementMatcher;
public class IgnoredTypesMatcher extends ElementMatcher.Junction.AbstractBase<TypeDescription> {
private static final Pattern COM_MCHANGE_PROXY =
Pattern.compile("com\\.mchange\\.v2\\.c3p0\\..*Proxy");
private final Trie<IgnoreAllow> ignoredTypes;
public IgnoredTypesMatcher(Trie<IgnoreAllow> ignoredTypes) {
@ -53,6 +49,10 @@ public class IgnoredTypesMatcher extends ElementMatcher.Junction.AbstractBase<Ty
return true;
}
return COM_MCHANGE_PROXY.matcher(name).matches();
if (name.startsWith("com.mchange.v2.c3p0.") && name.endsWith("Proxy")) {
return true;
}
return false;
}
}