changeset 49068:3b5fb5c44ae0 nestmates

javac: write nestmembers in a predictable order using LinkedHashSet Reviewed-by: dholmes
author mcimadamore
date Fri, 16 Mar 2018 00:33:26 -0400
parents ce4f5cece30c
children dbab7c3a6110
files src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassWriter.java
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassWriter.java	Tue Mar 13 21:14:05 2018 -0400
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassWriter.java	Fri Mar 16 00:33:26 2018 -0400
@@ -1102,7 +1102,7 @@
     int writeNestMembersIfNeeded(ClassSymbol csym) {
         ListBuffer<Symbol> nested = new ListBuffer<>();
         listNested(csym, nested);
-        Set<Symbol> nestedUnique = new HashSet<>(nested);
+        Set<Symbol> nestedUnique = new LinkedHashSet<>(nested);
         if (csym.owner.kind == PCK && !nestedUnique.isEmpty()) {
             int alenIdx = writeAttr(names.NestMembers);
             databuf.appendChar(nestedUnique.size());