diff --git a/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/scaffold/MethodRegistry.java b/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/scaffold/MethodRegistry.java index 137a571121..fd71fd9cc1 100644 --- a/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/scaffold/MethodRegistry.java +++ b/byte-buddy-dep/src/main/java/net/bytebuddy/dynamic/scaffold/MethodRegistry.java @@ -30,6 +30,7 @@ import net.bytebuddy.implementation.attribute.MethodAttributeAppender; import net.bytebuddy.implementation.bytecode.ByteCodeAppender; import net.bytebuddy.matcher.ElementMatcher; +import net.bytebuddy.matcher.ElementMatchers; import net.bytebuddy.matcher.LatentMatcher; import net.bytebuddy.utility.CompoundList; @@ -471,10 +472,9 @@ public MethodRegistry.Prepared prepare(InstrumentedType instrumentedType, } MethodGraph.Linked methodGraph = methodGraphCompiler.compile((TypeDefinition) instrumentedType); // Casting required for Java 6 compiler. - ElementMatcher relevanceMatcher = (ElementMatcher) not(anyOf(implementations.keySet())) + ElementMatcher relevanceMatcher = (ElementMatcher) failSafe(not(anyOf(implementations.keySet())) .and(returns(isVisibleTo(instrumentedType))) - .and(hasParameters(whereNone(hasType(not(isVisibleTo(instrumentedType)))))) - .and(ignoredMethods.resolve(instrumentedType)); + .and(hasParameters(whereNone(hasType(not(isVisibleTo(instrumentedType))))))).and(ignoredMethods.resolve(instrumentedType)); List methods = new ArrayList(); for (MethodGraph.Node node : methodGraph.listNodes()) { MethodDescription methodDescription = node.getRepresentative();