RFR: 8216403: Allocate fewer EnumSets in JavacFileManager#list

Ron Shapiro ronshapiro at google.com
Wed Jan 9 16:57:06 UTC 2019

Should SOURCE_OR_CLASS be static also?

On Wed, Jan 9, 2019 at 11:50 AM Liam Miller-Cushon <cushon at google.com>

> On Wed, Jan 9, 2019 at 1:42 AM Claes Redestad <claes.redestad at oracle.com>
> wrote:
>> not really a langtools reviewer, but I generally avoid using raw
>> static EnumSets due their mutable nature (not saying there's a bug
>> here - just that we should consider all possible futures and treat them
>> kindly).
>> Set.of() / Set.of(FOLLOW_LINKS) is a compact, performant and safer
>> alternative.
> Done, thanks: http://cr.openjdk.java.net/~cushon/8216403/webrev.01/ (I
> also gave 'sourceOrClass' the same treatment.)
> I used EnumSet initially because it usually performs better than
> general-purpose sets, but I suppose it doesn't have much of an advantage
> over Set.of for a one-element set.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20190109/f7c72d38/attachment.html>

More information about the compiler-dev mailing list