Skip to content

Commit

Permalink
Add fail safe wrapper to registry.
Browse files Browse the repository at this point in the history
  • Loading branch information
raphw committed Mar 14, 2023
1 parent 9609c32 commit c66e308
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -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;

Expand Down Expand Up @@ -471,10 +472,9 @@ public MethodRegistry.Prepared prepare(InstrumentedType instrumentedType,
}
MethodGraph.Linked methodGraph = methodGraphCompiler.compile((TypeDefinition) instrumentedType);
// Casting required for Java 6 compiler.
ElementMatcher<? super MethodDescription> relevanceMatcher = (ElementMatcher<? super MethodDescription>) not(anyOf(implementations.keySet()))
ElementMatcher<? super MethodDescription> relevanceMatcher = (ElementMatcher<? super MethodDescription>) 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<MethodDescription> methods = new ArrayList<MethodDescription>();
for (MethodGraph.Node node : methodGraph.listNodes()) {
MethodDescription methodDescription = node.getRepresentative();
Expand Down

0 comments on commit c66e308

Please sign in to comment.