-
Enhancement
-
Resolution: Fixed
-
P4
-
None
-
b27
-
generic
-
generic
ADDITIONAL SYSTEM INFORMATION :
Java 22 EA
A DESCRIPTION OF THE PROBLEM :
In Java arrays are initialized to a value when created. Depending of the type of the array they are initialized for example to 0, 0.0, 0.0f, false or null.
That means that they don't need to be fill with these value after creating.
In the core library, there are 2 places where they are initialized in a big loop (more than 500 loops):
https://github.com/openjdk/jdk/blob/6871a2ff1207d3ee70973b1c4ee9bd09969c185b/src/java.base/share/classes/java/text/MergeCollation.java#L72
https://github.com/openjdk/jdk/blob/6871a2ff1207d3ee70973b1c4ee9bd09969c185b/src/java.base/share/classes/sun/text/CompactByteArray.java#L85
I think that at both places the array initialization can be removed as it's done in the constructor upon a private field.
FREQUENCY : always
Java 22 EA
A DESCRIPTION OF THE PROBLEM :
In Java arrays are initialized to a value when created. Depending of the type of the array they are initialized for example to 0, 0.0, 0.0f, false or null.
That means that they don't need to be fill with these value after creating.
In the core library, there are 2 places where they are initialized in a big loop (more than 500 loops):
https://github.com/openjdk/jdk/blob/6871a2ff1207d3ee70973b1c4ee9bd09969c185b/src/java.base/share/classes/java/text/MergeCollation.java#L72
https://github.com/openjdk/jdk/blob/6871a2ff1207d3ee70973b1c4ee9bd09969c185b/src/java.base/share/classes/sun/text/CompactByteArray.java#L85
I think that at both places the array initialization can be removed as it's done in the constructor upon a private field.
FREQUENCY : always