|
@@ -24,6 +24,7 @@ import net.bytebuddy.agent.builder.AgentBuilder.Default.Transformation;
|
|
|
import net.bytebuddy.matcher.ElementMatcher;
|
|
|
import net.bytebuddy.matcher.ErasureMatcher;
|
|
|
import net.bytebuddy.matcher.HasSuperClassMatcher;
|
|
|
+import net.bytebuddy.matcher.HasSuperTypeMatcher;
|
|
|
import net.bytebuddy.matcher.NameMatcher;
|
|
|
import net.bytebuddy.matcher.StringMatcher;
|
|
|
import net.bytebuddy.matcher.StringSetMatcher;
|
|
@@ -42,6 +43,8 @@ public class AgentBuilderUtil {
|
|
|
private static final Field nameMatcherField = getField(NameMatcher.class, "matcher");
|
|
|
private static final Field hasSuperClassMatcherField =
|
|
|
getField(HasSuperClassMatcher.class, "matcher");
|
|
|
+ private static final Field hasSuperTypeMatcherField =
|
|
|
+ getField(HasSuperTypeMatcher.class, "matcher");
|
|
|
private static final Field erasureMatcherField = getField(ErasureMatcher.class, "matcher");
|
|
|
private static final Field conjunctionMatchersField =
|
|
|
getField(ElementMatcher.Junction.Conjunction.class, "matchers");
|
|
@@ -160,6 +163,8 @@ public class AgentBuilderUtil {
|
|
|
return result;
|
|
|
} else if (matcher instanceof HasSuperClassMatcher) {
|
|
|
return Result.subtype(inspect(getDelegateMatcher((HasSuperClassMatcher<?>) matcher)));
|
|
|
+ } else if (matcher instanceof HasSuperTypeMatcher) {
|
|
|
+ return Result.subtype(inspect(getDelegateMatcher((HasSuperTypeMatcher<?>) matcher)));
|
|
|
} else if (matcher instanceof ErasureMatcher) {
|
|
|
return inspect(getDelegateMatcher((ErasureMatcher<?>) matcher));
|
|
|
} else if (matcher instanceof NameMatcher) {
|
|
@@ -257,6 +262,11 @@ public class AgentBuilderUtil {
|
|
|
return (ElementMatcher<?>) hasSuperClassMatcherField.get(matcher);
|
|
|
}
|
|
|
|
|
|
+ private static ElementMatcher<?> getDelegateMatcher(HasSuperTypeMatcher<?> matcher)
|
|
|
+ throws Exception {
|
|
|
+ return (ElementMatcher<?>) hasSuperTypeMatcherField.get(matcher);
|
|
|
+ }
|
|
|
+
|
|
|
private static ElementMatcher<?> getDelegateMatcher(ErasureMatcher<?> matcher) throws Exception {
|
|
|
return (ElementMatcher<?>) erasureMatcherField.get(matcher);
|
|
|
}
|