Package org.openrewrite.java.search
Class SemanticallyEqual
java.lang.Object
org.openrewrite.java.search.SemanticallyEqual
Recursively checks the equality of each element of two ASTs to determine if two trees are semantically equal.
Bug fixes related to semantic equality should be applied to `CombineSemanticallyEqualCatchBlocks$CommentVisitor` too.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanareEqual(org.openrewrite.java.tree.J firstElem, org.openrewrite.java.tree.J secondElem) static booleanareSemanticallyEqual(org.openrewrite.java.tree.J firstElem, org.openrewrite.java.tree.J secondElem) Compares method invocations and new class constructors based on the `JavaType.Method` instead of checking each types of each parameter.
-
Constructor Details
-
SemanticallyEqual
protected SemanticallyEqual()
-
-
Method Details
-
areEqual
public static boolean areEqual(org.openrewrite.java.tree.J firstElem, org.openrewrite.java.tree.J secondElem) -
areSemanticallyEqual
public static boolean areSemanticallyEqual(org.openrewrite.java.tree.J firstElem, org.openrewrite.java.tree.J secondElem) Compares method invocations and new class constructors based on the `JavaType.Method` instead of checking each types of each parameter. I.E. void foo(Object obj) {} invoked with `java.lang.String` or `java.lang.Integer` will return true.
-