RFR: [8u] 8225392: Comparison builds are failing due to cacerts file
Aleksey Shipilev
shade at redhat.com
Thu Feb 13 16:54:12 UTC 2020
On 2/13/20 8:27 AM, Andrew John Hughes wrote:
> Bug: https://bugs.openjdk.java.net/browse/JDK-8225392
> Webrev: https://cr.openjdk.java.net/~andrew/openjdk8/8225392/webrev.01/
>
> This is the follow-up to 8193255 and requires similar changes to
> GenerateCacerts.java in order for it to build during bootstrap with
> OpenJDK 7.
>
> Differences from 11u version:
>
> 1. In GenerateCacerts.java, we again use a loop over the directory
> entries using Files.newDirectoryStream rather than a bunch of lambda
> functions and the Streams API. Instead of creating an unsorted list and
> then sorting it, we just add the entries directly to a TreeSet.
But since String has the natural ordering comparator, why do you need another Comparator, which
calls to String's comparator anyway?
87 SortedSet<String> entries = new TreeSet<String>(new Comparator<String> () {
88 @Override
89 public int compare(String s1, String s2) { return s1.compareTo(s2); }
90 });
Surely you can just do:
Collection<String> entries = new TreeSet<String>();
Otherwise looks good.
--
Thanks,
-Aleksey
More information about the jdk8u-dev
mailing list