Re: RFR [9]: Consistent order of 'Annotation Type Hierarchy' & 'Enum Hierarchy’ sections.

Alan Bateman Alan.Bateman at oracle.com
Mon Jul 21 12:45:25 UTC 2014


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.


More information about the javadoc-dev mailing list