RFR: 8297750: Unnecessary Vector usage in IIORegistry
Andrey Turbanov
aturbanov at openjdk.org
Tue Nov 29 07:39:18 UTC 2022
On Mon, 28 Nov 2022 20:01:31 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:
>> src/java.desktop/share/classes/javax/imageio/spi/IIORegistry.java line 89:
>>
>>> 87: * categories (superinterfaces) to be used in the constructor.
>>> 88: */
>>> 89: private static final ArrayList<Class<?>> initialCategories = new ArrayList<>(5);
>>
>> Should this be an immutable list and remove the static block?
>>
>> Suggestion:
>>
>> private static final List<Class<?>> initialCategories = List.of(
>> ImageReaderSpi.class,
>> ImageWriterSpi.class,
>> ImageTranscoderSpi.class,
>> ImageInputStreamSpi.class,
>> ImageOutputStreamSpi.class);
>
> I think this one could be a better approach.
Applied
-------------
PR: https://git.openjdk.org/jdk/pull/11379
More information about the client-libs-dev
mailing list