in core/src/main/java/com/spotify/missinglink/ClassLoader.java [226:259]
private static void handleMethodCall(
final Set<CalledMethod> thisCalls,
final int lineNumber,
final MethodInsnNode insn,
final List<TryCatchBlockNode> tryCatchBlocksProtecting) {
boolean isStatic;
switch (insn.getOpcode()) {
case Opcodes.INVOKEVIRTUAL:
case Opcodes.INVOKEINTERFACE:
isStatic = false;
break;
case Opcodes.INVOKESPECIAL:
isStatic = false;
break;
case Opcodes.INVOKESTATIC:
isStatic = true;
break;
default:
throw new RuntimeException("Unexpected method call opcode: " + insn.getOpcode());
}
if (isArray(insn.owner) && !BLACKLIST.contains(insn.owner)) {
thisCalls.add(
new CalledMethodBuilder()
.owner(TypeDescriptors.fromClassName(insn.owner))
.descriptor(MethodDescriptors.fromDesc(insn.desc, insn.name))
.isStatic(isStatic)
.lineNumber(lineNumber)
.caughtExceptions(
tryCatchBlocksProtecting.stream()
.map(node -> TypeDescriptors.fromClassName(node.type))
.collect(Collectors.toList()))
.build());
}
}