private Set<MethodReference> getImplementations(String[] classNames, MethodReference ref) { OptionalPredicate<String> isSuperclass = hierarchy.getSuperclassPredicate(ref.getClassName()); Set<MethodReference> methods = new HashSet<>(); for (String className : classNames) { if (className.startsWith("[")) { className = "java.lang.Object"; } ClassReader cls = hierarchy.getClassSource().get(className); if (cls == null || !isSuperclass.test(cls.getName(), false)) { continue; } MethodDependencyInfo methodDep = dependency.getMethodImplementation(new MethodReference( className, ref.getDescriptor())); if (methodDep != null) { methods.add(methodDep.getReference()); } } return methods; }
InvokeInstruction invoke = (InvokeInstruction) insn; if (invoke.getType() == InvocationType.SPECIAL) { MethodDependencyInfo linkedMethod = dependency.getMethodImplementation(invoke.getMethod()); if (linkedMethod != null) { invoke.setMethod(linkedMethod.getReference());
private Set<MethodReference> getImplementations(String[] classNames, MethodReference ref) { Set<MethodReference> methods = new HashSet<>(); for (String className : classNames) { if (className.startsWith("[")) { className = "java.lang.Object"; } ClassReader cls = classSource.get(className); if (cls == null || !classSource.isSuperType(ref.getClassName(), cls.getName()).orElse(false)) { continue; } MethodDependencyInfo methodDep = dependency.getMethodImplementation(new MethodReference( className, ref.getDescriptor())); if (methodDep != null) { methods.add(methodDep.getReference()); } } return methods; } }
if (insn instanceof InvokeInstruction) { InvokeInstruction invoke = (InvokeInstruction) insn; MethodDependencyInfo linkedMethod = dependency.getMethodImplementation(invoke.getMethod()); if (linkedMethod != null) { invoke.setMethod(linkedMethod.getReference());