Skip to content

Commit

Permalink
Prepare for getParentTreeCursor() to possibly return a JavaDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
sambsnyd committed Aug 29, 2023
1 parent 74a1e3b commit 5189369
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.*;
Expand Down Expand Up @@ -155,7 +156,7 @@ private static Optional<JavaType.Method> getType(MethodCall expression) {
}

private static Optional<MethodCall> nearestMethodCall(Cursor cursor) {
J closestJ = cursor.getParentTreeCursor().getValue();
Tree closestJ = cursor.getParentTreeCursor().getValue();
if (closestJ instanceof MethodCall) {
return Optional.of((MethodCall) closestJ);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 5189369

Please sign in to comment.