Menu

#2 Java 8 Compatibility

Unstable_(example)
open
nobody
None
5
2014-03-27
2014-03-27
No

The HashMap seems to maintain insertion order by default in Java 8, whereas you needed to use a LinkedHashMap for this in Java 7 and below. Whereas previous the help message generated by JSAP contained the arguments in a random order, now they are now displayed in the same order given to the library (which is much better).

However, this is breaking one of our automated tests depending on whether the test is run on a Java 7 or a Java 8 machine.

To fix this I changed line 72 of JSAPResult from this:

allExceptions = new java.util.HashMap();

to this:

allExceptions = new java.util.LinkedHashMap();

If a new version containing this fix could be deployed to Maven central that would be great.

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.