diff --git a/src/main/java/org/openrewrite/analysis/InvocationMatcher.java b/src/main/java/org/openrewrite/analysis/InvocationMatcher.java index 4ac5b62b5..43c096d61 100644 --- a/src/main/java/org/openrewrite/analysis/InvocationMatcher.java +++ b/src/main/java/org/openrewrite/analysis/InvocationMatcher.java @@ -19,6 +19,7 @@ import lombok.AllArgsConstructor; import org.openrewrite.Cursor; import org.openrewrite.Incubating; +import org.openrewrite.Tree; import org.openrewrite.internal.lang.Nullable; import org.openrewrite.java.MethodMatcher; import org.openrewrite.java.tree.*; @@ -155,7 +156,7 @@ private static Optional getType(MethodCall expression) { } private static Optional nearestMethodCall(Cursor cursor) { - J closestJ = cursor.getParentTreeCursor().getValue(); + Tree closestJ = cursor.getParentTreeCursor().getValue(); if (closestJ instanceof MethodCall) { return Optional.of((MethodCall) closestJ); } diff --git a/src/main/java/org/openrewrite/analysis/dataflow/analysis/ForwardFlow.java b/src/main/java/org/openrewrite/analysis/dataflow/analysis/ForwardFlow.java index 7be0c81e7..515a09a5c 100644 --- a/src/main/java/org/openrewrite/analysis/dataflow/analysis/ForwardFlow.java +++ b/src/main/java/org/openrewrite/analysis/dataflow/analysis/ForwardFlow.java @@ -19,6 +19,7 @@ import lombok.AllArgsConstructor; import org.openrewrite.Cursor; import org.openrewrite.Incubating; +import org.openrewrite.Tree; import org.openrewrite.analysis.dataflow.DataFlowNode; import org.openrewrite.analysis.dataflow.DataFlowSpec; import org.openrewrite.analysis.trait.expr.VarAccess; @@ -443,7 +444,7 @@ private static VariableNameToFlowGraph computeVariableAssignment(Cursor startCur ancestorNode )) { nextFlowGraph = nextFlowGraph.addEdge(ancestorNode); - J ancestorParent = ancestorCursor.getParentTreeCursor().getValue(); + Tree ancestorParent = ancestorCursor.getParentTreeCursor().getValue(); if (ancestorParent instanceof J.Block || ancestorParent instanceof J.Case) { // If the ancestor is a block or a case, then we've reached the end of the flow. // We can stop here.