On Tue, 24 Jan 2023 16:22:43 GMT, Sergey Bylokhov <s...@openjdk.org> wrote:
>> No need to fill elements of array with default values if it was just >> created. Java guarantees that all elements of numeric array have default >> values after allocations - 0. > > src/java.desktop/share/classes/java/awt/image/ComponentColorModel.java line > 521: > >> 519: { >> 520: byte[] bpixel = new byte[numComponents]; >> 521: for (int i = 0; i < numColorComponents; i++) { > > Is it possible that indirectly this code threw the AIOBE for some wrong > "numColorComponents"? I believe it's impossible to get AIOBE here (at least without some reflection tricks). `numColorComponents` and `numComponents` are assigned only in 2 places. And in both places it's guarantee that `numComponents >= numColorComponents`  ------------- PR: https://git.openjdk.org/jdk/pull/12147