On 18/07/2014 18:16, Chris Hegarty wrote:
This is a small code review request for an issue I encountered when trying to 
compare the result of the output of a docs build from two JDK repos. I’ll file 
a bug on it soon.

The issue is that the 'Annotation Type Hierarchy' & 'Enum Hierarchy’ sections 
of ‘Use' and ‘Tree’ view for a package are not always in the same order ( the issue 
may appear in other views too, but these are the only ones I observed). The 
implementation uses a List, whose elements may be added in a different order, 
depending on encounter order. These elements should be ordered, as others are. It 
just appears to be an oversight in the original implementation.

diff --git 
a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassTree.java 
b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassTree.java
--- 
a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassTree.java
+++ 
b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassTree.java
@@ -155,12 +155,21 @@
          }
Collections.sort(baseinterfaces);
+        Collections.sort(baseAnnotationTypes);
+        Collections.sort(baseEnums);
          for (List<ClassDoc> docs : subinterfaces.values()) {
              Collections.sort(docs);
          }
          for (List<ClassDoc> docs : subclasses.values()) {
              Collections.sort(docs);
          }
+        for (List<ClassDoc> docs : subAnnotationTypes.values()) {
+            Collections.sort(docs);
+        }
+        for (List<ClassDoc> docs : subEnums.values()) {
+            Collections.sort(docs);
+        }
+
      }
This looks okay to me but probably best to get a Reviewer that is working in this area, Kumar?

-Alan.

Reply via email to