# HG changeset patch # User vromero # Date 1521315508 14400 # Sat Mar 17 15:38:28 2018 -0400 # Node ID 7b43e9d62087e7c8de527c768e77b19be893f0f5 # Parent 29ab09bb6230a2a4488fb8861ce4f550bdc91eb4 [mq]: considering.constants.patch diff -r 29ab09bb6230 -r 7b43e9d62087 src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TreeDiffer.java --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TreeDiffer.java Sat Mar 17 15:16:26 2018 -0400 +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TreeDiffer.java Sat Mar 17 15:38:28 2018 -0400 @@ -114,6 +114,12 @@ } tree = TreeInfo.skipParens(tree); parameter = TreeInfo.skipParens(parameter); + if (tree.type != null && + tree.type.constValue() != null && + parameter.type != null && + parameter.type.constValue() != null) { + return Objects.equals(tree.type.constValue(), parameter.type.constValue()); + } if (tree.getTag() != parameter.getTag()) { return false; } diff -r 29ab09bb6230 -r 7b43e9d62087 src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TreeHasher.java --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TreeHasher.java Sat Mar 17 15:16:26 2018 -0400 +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TreeHasher.java Sat Mar 17 15:38:28 2018 -0400 @@ -49,7 +49,12 @@ return; } tree = TreeInfo.skipParens(tree); - result = 31 * result + tree.getTag().hashCode(); - tree.accept(this); + if (tree.type != null && tree.type.constValue() != null) { + Object value = tree.type.constValue(); + result = 31 * result + value.hashCode(); + } else { + result = 31 * result + tree.getTag().hashCode(); + tree.accept(this); + } } }