Source:
<code>private boolean handleMethodInvocation(Instruction instruction) { boolean isStatic = instruction.opcode == Opcodes.INVOKESTATIC; int arity = isStatic ? instruction.arity() : (instruction.arity() + 1); ProgramState.Pop pop = programState.unstackValue(arity); Preconditions.checkState(pop.values.size() == arity, "Arguments mismatch for INVOKE"); SymbolicValue returnSV = constraintManager.createSymbolicValue(instruction); if (isStatic) { String signature = instruction.fieldOrMethod.completeSignature(); MethodBehavior methodInvokedBehavior = behaviorCache.get(signature); if (methodInvokedBehavior != null && methodInvokedBehavior.isComplete()) { methodInvokedBehavior .happyPathYields() .forEach(yield -> yield.statesAfterInvocation(Lists.reverse(pop.values), Collections.emptyList(), pop.state, () -> returnSV).forEach(ps -> { checkerDispatcher.methodYield = yield; checkerDispatcher.addTransition(ps); checkerDispatcher.methodYield = null; })); methodInvokedBehavior .exceptionalPathYields() .forEach(yield -> { org.sonar.plugins.java.api.semantic.Type exceptionType = yield.exceptionType(); yield.statesAfterInvocation( Lists.reverse(pop.values), Collections.emptyList(), pop.state, () -> constraintManager.createExceptionalSymbolicValue(exceptionType) ).forEach(ps -> { ps.storeExitValue(); <START> programPosition.block.successors().stream() <END> .map(b -> (BytecodeCFGBuilder.Block) b) .filter(b -> b.getExceptionType() != null) .filter(b -> b.getExceptionType().charAt(0) == '!' || exceptionType == null || exceptionType.isSubtypeOf(b.getExceptionType())) .forEach(b -> enqueue(new ProgramPoint(b), ps)); }); }); return true; } } else { } programState = pop.state; if (instruction.hasReturnValue()) { programState = programState.stackValue(returnSV); } return false; }</code><technical_language>I a test this is (should invocation throwing exception is caught )</technical_language>

Target:
private boolean handleMethodInvocation(Instruction instruction) { boolean isStatic = instruction.opcode == Opcodes.INVOKESTATIC; int arity = isStatic ? instruction.arity() : (instruction.arity() + 1); ProgramState.Pop pop = programState.unstackValue(arity); Preconditions.checkState(pop.values.size() == arity, "Arguments mismatch for INVOKE"); SymbolicValue returnSV = constraintManager.createSymbolicValue(instruction); if (isStatic) { String signature = instruction.fieldOrMethod.completeSignature(); MethodBehavior methodInvokedBehavior = behaviorCache.get(signature); if (methodInvokedBehavior != null && methodInvokedBehavior.isComplete()) { methodInvokedBehavior .happyPathYields() .forEach(yield -> yield.statesAfterInvocation(Lists.reverse(pop.values), Collections.emptyList(), pop.state, () -> returnSV).forEach(ps -> { checkerDispatcher.methodYield = yield; checkerDispatcher.addTransition(ps); checkerDispatcher.methodYield = null; })); methodInvokedBehavior .exceptionalPathYields() .forEach(yield -> { org.sonar.plugins.java.api.semantic.Type exceptionType = yield.exceptionType(); yield.statesAfterInvocation( Lists.reverse(pop.values), Collections.emptyList(), pop.state, () -> constraintManager.createExceptionalSymbolicValue(exceptionType) ).forEach(ps -> { ps.storeExitValue(); enqueueExceptionHandlers(exceptionType, ps); }); }); return true; } } else { } programState = pop.state; if (instruction.hasReturnValue()) { programState = programState.stackValue(returnSV); } return false; }