Package org.sonar.java.model
Class SyntacticEquivalence
java.lang.Object
org.sonar.java.model.SyntacticEquivalence
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
areEquivalent
(List<? extends Tree> leftList, List<? extends Tree> rightList) static boolean
areEquivalent
(List<? extends Tree> leftList, List<? extends Tree> rightList, BiPredicate<JavaTree, JavaTree> permissiveEquivalence) static boolean
areEquivalent
(Tree leftNode, Tree rightNode) static boolean
areEquivalent
(Tree leftNode, Tree rightNode, BiPredicate<JavaTree, JavaTree> overwriteEquivalence, boolean equivalenceValue) static boolean
areEquivalentIncludingSameVariables
(Tree left, Tree right) Syntactic equivalence with additional semantic equivalence for identifiers.static boolean
areSemanticallyEquivalent
(List<? extends Tree> leftList, List<? extends Tree> rightList) Syntactic equivalence with additional semantic equivalence for methods calls.
-
Method Details
-
areEquivalent
-
areEquivalent
-
areEquivalent
-
areSemanticallyEquivalent
public static boolean areSemanticallyEquivalent(List<? extends Tree> leftList, List<? extends Tree> rightList) Syntactic equivalence with additional semantic equivalence for methods calls. Two methods calls are equivalent only if they have the same signature; if the types of the arguments are the same.- Returns:
- true, if nodes are syntactically and semantically equivalent.
-
areEquivalentIncludingSameVariables
Syntactic equivalence with additional semantic equivalence for identifiers. Two identifiers are equivalent only if they refer to the same known symbol.- Returns:
- true, if nodes are syntactically equivalent and their variables refer to the same symbols.
-
areEquivalent
public static boolean areEquivalent(@Nullable Tree leftNode, @Nullable Tree rightNode, BiPredicate<JavaTree, JavaTree> overwriteEquivalence, boolean equivalenceValue)
-