RFR: JDK-8161230 ClassLoader: add resource methods returning java.util.stream.Stream

Patrick Reinhart patrick at reini.net
Thu Sep 8 21:14:20 UTC 2016

I tried to include all the feedback here:



On 08.09.2016 20:09, Paul Sandoz wrote:
>> On 8 Sep 2016, at 08:20, Patrick Reinhart <patrick at reini.net> wrote:
>>> And one more thing. Because we have now only one method to get a
>>> stream I think the constant RESOURCE_CHARACTERISTICS should be defined
>>> inside the #resources()-method. It is not needed to define it as a
>>> static final field.
>> The reason is to have the computation of the characteristics only at compile time not on each method call.
> It’s ok, since the characteristics are constant the java compiler is free to constant fold and compute results and use that instead in the byte code (which is why for independent compilation it is dangerous to change the values of static final fields of certain types, such as stuff that can be represented directly in the constant pool or byte code).
> So there is no need to increase the static size of the ClassLoader class with a new static final field, although it probably makes little difference in this case.
> Paul.

More information about the core-libs-dev mailing list