Source: openjdk-7
Version: 7u79-2.5.5-1
Severity: wishlist
Tags: patch
Usertags: toolchain randomness

The package-tree.html files generated by the javadoc tool display class
trees for interfaces, classes, annotations and enums. The interfaces and
classes trees are sorted alphabetically, but not the annotation and the
enum trees. This can be seen on the API documentation for the java.lang
package [1].

The actual order used is not deterministic and varies with the build
environment, this prevents several packages from being reproducible (for
example easymock [2] and mockito [3]).

This issue is caused by the buildTree method in the class [4], it
sorts the interfaces and the classes but forgets the other types. I'm
attaching a patch fixing this issue.

Emmanuel Bourg

Description: Sort the enums and the annotations in the package-tree.html files
Author: Emmanuel Bourg <>
Forwarded: no
@@ -163,6 +163,15 @@
         for (Iterator<List<ClassDoc>> it = subclasses.values().iterator(); 
it.hasNext(); ) {
+        Collections.sort(baseEnums);
+        for (Iterator<List<ClassDoc>> it = subEnums.values().iterator(); 
it.hasNext(); ) {
+            Collections.sort(;
+        }
+        Collections.sort(baseAnnotationTypes);
+        for (Iterator<List<ClassDoc>> it = 
subAnnotationTypes.values().iterator(); it.hasNext(); ) {
+            Collections.sort(;
+        }

Reproducible-builds mailing list

Reply via email to