--- old/src/java.desktop/share/classes/java/awt/image/ComponentColorModel.java 2018-10-01 09:59:14.246026000 +0700 +++ new/src/java.desktop/share/classes/java/awt/image/ComponentColorModel.java 2018-10-01 09:59:13.726026000 +0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -802,7 +802,7 @@ // Note: we do no clamping of the pixel data here - we // assume that the data is scaled properly case DataBuffer.TYPE_SHORT: { - short sdata[] = (short[]) inData; + short[] sdata = (short[]) inData; float scalefactor = (float) ((1 << precision) - 1); if (needAlpha) { short s = sdata[numColorComponents]; @@ -817,7 +817,7 @@ } } case DataBuffer.TYPE_FLOAT: { - float fdata[] = (float[]) inData; + float[] fdata = (float[]) inData; float scalefactor = (float) ((1 << precision) - 1); if (needAlpha) { float f = fdata[numColorComponents]; @@ -831,7 +831,7 @@ } } case DataBuffer.TYPE_DOUBLE: { - double ddata[] = (double[]) inData; + double[] ddata = (double[]) inData; double scalefactor = (double) ((1 << precision) - 1); if (needAlpha) { double d = ddata[numColorComponents]; @@ -845,7 +845,7 @@ } } case DataBuffer.TYPE_BYTE: - byte bdata[] = (byte[])inData; + byte[] bdata = (byte[])inData; comp = bdata[idx] & mask; precision = 8; if (needAlpha) { @@ -853,14 +853,14 @@ } break; case DataBuffer.TYPE_USHORT: - short usdata[] = (short[])inData; + short[] usdata = (short[])inData; comp = usdata[idx] & mask; if (needAlpha) { alp = usdata[numColorComponents] & mask; } break; case DataBuffer.TYPE_INT: - int idata[] = (int[])inData; + int[] idata = (int[])inData; comp = idata[idx]; if (needAlpha) { alp = idata[numColorComponents]; @@ -1054,27 +1054,27 @@ switch (transferType) { case DataBuffer.TYPE_SHORT: - short sdata[] = (short[])inData; + short[] sdata = (short[])inData; alpha = (int) ((sdata[aIdx] / 32767.0f) * 255.0f + 0.5f); return alpha; case DataBuffer.TYPE_FLOAT: - float fdata[] = (float[])inData; + float[] fdata = (float[])inData; alpha = (int) (fdata[aIdx] * 255.0f + 0.5f); return alpha; case DataBuffer.TYPE_DOUBLE: - double ddata[] = (double[])inData; + double[] ddata = (double[])inData; alpha = (int) (ddata[aIdx] * 255.0 + 0.5); return alpha; case DataBuffer.TYPE_BYTE: - byte bdata[] = (byte[])inData; + byte[] bdata = (byte[])inData; alpha = bdata[aIdx] & mask; break; case DataBuffer.TYPE_USHORT: - short usdata[] = (short[])inData; + short[] usdata = (short[])inData; alpha = usdata[aIdx] & mask; break; case DataBuffer.TYPE_INT: - int idata[] = (int[])inData; + int[] idata = (int[])inData; alpha = idata[aIdx]; break; default: @@ -1201,7 +1201,7 @@ switch(transferType) { case DataBuffer.TYPE_SHORT: { - short sdata[]; + short[] sdata; if (pixel == null) { sdata = new short[numComponents]; } else { @@ -1264,7 +1264,7 @@ sdata[0] = (short) (gray * factor + 0.5f); } else { factor = 1.0f / 255.0f; - float norm[] = new float[3]; + float[] norm = new float[3]; norm[0] = red * factor; norm[1] = grn * factor; norm[2] = blu * factor; @@ -1300,7 +1300,7 @@ } case DataBuffer.TYPE_FLOAT: { - float fdata[]; + float[] fdata; if (pixel == null) { fdata = new float[numComponents]; } else { @@ -1357,7 +1357,7 @@ } } } else { - float norm[] = new float[3]; + float[] norm = new float[3]; factor = 1.0f / 255.0f; norm[0] = red * factor; norm[1] = grn * factor; @@ -1381,7 +1381,7 @@ } case DataBuffer.TYPE_DOUBLE: { - double ddata[]; + double[] ddata; if (pixel == null) { ddata = new double[numComponents]; } else { @@ -1439,7 +1439,7 @@ } } else { float factor = 1.0f / 255.0f; - float norm[] = new float[3]; + float[] norm = new float[3]; norm[0] = red * factor; norm[1] = grn * factor; norm[2] = blu * factor; @@ -1466,7 +1466,7 @@ // Handle BYTE, USHORT, & INT here //REMIND: maybe more efficient not to use int array for //DataBuffer.TYPE_USHORT and DataBuffer.TYPE_INT - int intpixel[]; + int[] intpixel; if (transferType == DataBuffer.TYPE_INT && pixel != null) { intpixel = (int[])pixel; @@ -1615,7 +1615,7 @@ switch (transferType) { case DataBuffer.TYPE_BYTE: { - byte bdata[]; + byte[] bdata; if (pixel == null) { bdata = new byte[numComponents]; } else { @@ -1627,7 +1627,7 @@ return bdata; } case DataBuffer.TYPE_USHORT:{ - short sdata[]; + short[] sdata; if (pixel == null) { sdata = new short[numComponents]; } else { @@ -1741,7 +1741,7 @@ * enough to hold a pixel value for this ColorModel. */ public int[] getComponents(Object pixel, int[] components, int offset) { - int intpixel[]; + int[] intpixel; if (needScaleInit) { initScale(); } @@ -2057,7 +2057,7 @@ switch (transferType) { case DataBuffer.TYPE_BYTE: { - byte bpixel[] = (byte[]) pixel; + byte[] bpixel = (byte[]) pixel; return bpixel[0] & 0xff; } case DataBuffer.TYPE_USHORT: @@ -2468,8 +2468,8 @@ if (isAlphaPremultiplied) { switch (transferType) { case DataBuffer.TYPE_BYTE: { - byte pixel[] = null; - byte zpixel[] = null; + byte[] pixel = null; + byte[] zpixel = null; float alphaScale = 1.0f / ((float) ((1<