-
Notifications
You must be signed in to change notification settings - Fork 456
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b3d23a6
commit 25fba6b
Showing
3 changed files
with
119 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
rewrite/src/main/java/dev/morphia/rewrite/recipes/PipelineVisitor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package dev.morphia.rewrite.recipes; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
import org.openrewrite.ExecutionContext; | ||
import org.openrewrite.java.JavaIsoVisitor; | ||
import org.openrewrite.java.tree.Expression; | ||
import org.openrewrite.java.tree.J.MethodInvocation; | ||
|
||
class PipelineVisitor extends JavaIsoVisitor<ExecutionContext> { | ||
|
||
@Override | ||
public MethodInvocation visitMethodInvocation(MethodInvocation methodInvocation, @NotNull ExecutionContext context) { | ||
if (PipelineRewrite.pipeline.matches(methodInvocation)) { | ||
Expression select = methodInvocation.getSelect(); | ||
System.out.println("\n\nselect = " + select); | ||
System.out.println("select.getSideEffects() = " + select.getSideEffects()); | ||
if (select instanceof MethodInvocation invocation) { | ||
System.out.println("invocation.getArguments() = " + invocation.getArguments()); | ||
} else { | ||
System.out.println("select.getType() = " + select.getType()); | ||
} | ||
return super.visitMethodInvocation(methodInvocation, context); | ||
} | ||
return super.visitMethodInvocation(methodInvocation, context); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters