Supertypes are not always available. Only check the current class for decorator

This commit is contained in:
Laplie Anderson 2019-10-17 13:42:38 -04:00
parent 6e0af7cdeb
commit 8971040a45
1 changed files with 2 additions and 3 deletions

View File

@ -1,9 +1,8 @@
package datadog.trace.agent.tooling;
import static datadog.trace.agent.tooling.ClassLoaderMatcher.skipClassLoader;
import static net.bytebuddy.matcher.ElementMatchers.annotationType;
import static net.bytebuddy.matcher.ElementMatchers.any;
import static net.bytebuddy.matcher.ElementMatchers.hasAnnotation;
import static net.bytebuddy.matcher.ElementMatchers.isAnnotatedWith;
import static net.bytebuddy.matcher.ElementMatchers.nameContains;
import static net.bytebuddy.matcher.ElementMatchers.nameMatches;
import static net.bytebuddy.matcher.ElementMatchers.nameStartsWith;
@ -132,7 +131,7 @@ public class AgentInstaller {
.or(nameContains("javassist"))
.or(nameContains(".asm."))
.or(nameMatches("com\\.mchange\\.v2\\.c3p0\\..*Proxy"))
.or(hasAnnotation(annotationType(named("javax.decorator.Decorator"))))
.or(isAnnotatedWith(named("javax.decorator.Decorator")))
.or(matchesConfiguredExcludes());
for (final AgentBuilder.Listener listener : listeners) {