http://gwt-code-reviews.appspot.com/1352805/diff/1/3
File dev/core/src/com/google/gwt/dev/javac/typemodel/Annotations.java
(right):

http://gwt-code-reviews.appspot.com/1352805/diff/1/3#newcode110
dev/core/src/com/google/gwt/dev/javac/typemodel/Annotations.java:110:
Collections.sort(values, ANNOTATION_COMPARATOR);
What's the reason for sorting the returned annotations? As you
mention, no
caller will assume any kind of sorting so it looks just like extra
work?

Without explicitly sorting, the values will come in a random order due
to HashMap and default Object hashCode.  If a caller then naively
iterates over the returned array, producing code, the code being
produced will be non-determinstic.  This leads to 'jitter' in the
compiled output for the same input, which we try very hard to avoid.

http://gwt-code-reviews.appspot.com/1352805/show

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to