Skip to content

Commit

Permalink
Include private methods of instrumented type.
Browse files Browse the repository at this point in the history
  • Loading branch information
raphw committed Oct 31, 2020
1 parent c72ca09 commit df43a15
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import net.bytebuddy.implementation.bytecode.member.MethodReturn;
import net.bytebuddy.implementation.bytecode.member.MethodVariableAccess;
import net.bytebuddy.matcher.ElementMatcher;
import net.bytebuddy.matcher.ElementMatchers;
import net.bytebuddy.utility.CompoundList;
import net.bytebuddy.utility.JavaConstant;
import net.bytebuddy.utility.JavaType;
Expand Down Expand Up @@ -806,6 +807,7 @@ protected ForElementMatcher(TypeDescription instrumentedType, ElementMatcher<? s
public MethodDescription resolve(TypeDescription targetType, MethodDescription instrumentedMethod) {
List<MethodDescription> candidates = CompoundList.<MethodDescription>of(
instrumentedType.getSuperClass().getDeclaredMethods().filter(isConstructor().and(matcher)),
instrumentedType.getDeclaredMethods().filter(isMethod().and(not(ElementMatchers.isVirtual()))),
methodGraphCompiler.compile(targetType, instrumentedType).listNodes().asMethodList().filter(matcher));
if (candidates.size() == 1) {
return candidates.get(0);
Expand Down

0 comments on commit df43a15

Please sign in to comment.