diff --git a/src/main/java/org/openrewrite/analysis/controlflow/ControlFlow.java b/src/main/java/org/openrewrite/analysis/controlflow/ControlFlow.java index 14c6818ed..45e3c4e4b 100644 --- a/src/main/java/org/openrewrite/analysis/controlflow/ControlFlow.java +++ b/src/main/java/org/openrewrite/analysis/controlflow/ControlFlow.java @@ -635,9 +635,8 @@ public J.ForLoop.Control visitForControl(J.ForLoop.Control control, P p) { // Point any `continue` nodes to the condition node bodyAnalysis.continueFlow.forEach(continueControlFlowNode -> continueControlFlowNode.addSuccessor(entryBlock[0].getSuccessor())); // Add the 'increment' statement to the basic block as the last element - controlAnalysisSecondBit.current.forEach(controlFlowNode -> { - controlFlowNode.addSuccessor(entryBlock[0].getSuccessor()); - }); + controlAnalysisSecondBit.current.forEach(controlFlowNode -> + controlFlowNode.addSuccessor(entryBlock[0].getSuccessor())); current = Stream.concat(Stream.of(getControlFlowNodeMissingOneSuccessor(allAsConditionNodesMissingTruthFirst(controlAnalysisFirstBit.current))), bodyAnalysis.breakFlow.stream()).collect(Collectors.toSet()); return forLoop; diff --git a/src/main/java/org/openrewrite/analysis/dataflow/global/GlobalDataFlowAccumulator.java b/src/main/java/org/openrewrite/analysis/dataflow/global/GlobalDataFlowAccumulator.java index 2dad391fb..bd1503780 100644 --- a/src/main/java/org/openrewrite/analysis/dataflow/global/GlobalDataFlowAccumulator.java +++ b/src/main/java/org/openrewrite/analysis/dataflow/global/GlobalDataFlowAccumulator.java @@ -81,7 +81,7 @@ public J visitExpression(Expression expression, ExecutionContext e) { public J visitVariable(J.VariableDeclarations.NamedVariable variable, ExecutionContext executionContext) { DataFlowNode .of(getCursor()) - .forEach(n -> n.asParameter().forEach(p -> { + .forEach(n -> n.asParameter().forEach(p -> p.getCallable().getMethodType().forEach(m -> { FlowGraph g = ForwardFlow.findAllFlows(n, globalDataFlowSpec, flowGraphFactory); parameterFlowGraphs.computeIfAbsent(m, __ -> flowGraphList(p.getCallable().getParameters().size())) @@ -96,8 +96,7 @@ public J visitVariable(J.VariableDeclarations.NamedVariable variable, ExecutionC sourceFlowGraphs.add(g); } walkFlowGraphConnecting(g); - }); - })); + }))); return super.visitVariable(variable, executionContext); }