Class SyntacticEquivalence


  • public final class SyntacticEquivalence
    extends Object
    • Method Detail

      • areEquivalent

        public static boolean areEquivalent​(@Nullable
                                            Tree leftNode,
                                            @Nullable
                                            Tree rightNode)
        Returns:
        true, if nodes are syntactically equivalent
      • areEquivalent

        public static boolean areEquivalent​(List<? extends Tree> leftList,
                                            List<? extends Tree> rightList)
        Returns:
        true, if nodes are syntactically equivalent
      • areEquivalent

        public static boolean areEquivalent​(List<? extends Tree> leftList,
                                            List<? extends Tree> rightList,
                                            BiPredicate<JavaTree,​JavaTree> permissiveEquivalence)
        Returns:
        true, if nodes are syntactically equivalent Use permissiveEquivalence to force the equivalence of two nodes
      • 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.