(Arrays.asList(skipChunkIds));
- String chunkidstr = ChunkHelper.toString(chunkid);
- boolean critical = ChunkHelper.isCritical(chunkidstr);
+ final String chunkidstr = ChunkHelper.toString(chunkid);
+ final boolean critical = ChunkHelper.isCritical(chunkidstr);
PngChunk pngChunk = null;
boolean skip = skipforced;
if (maxTotalBytesRead > 0 && clen + offset > maxTotalBytesRead)
@@ -379,7 +379,7 @@ public class PngReader {
// clen + 4) for risk of overflow
pngChunk = new PngChunkSkipped(chunkidstr, imgInfo, clen);
} else {
- ChunkRaw chunk = new ChunkRaw(clen, chunkid, true);
+ final ChunkRaw chunk = new ChunkRaw(clen, chunkid, true);
chunk.readChunkData(inputStream, crcEnabled || critical);
pngChunk = PngChunk.factory(chunk, imgInfo);
if (!pngChunk.crit)
@@ -398,7 +398,7 @@ public class PngReader {
*
* This happens rarely - most errors are fatal.
*/
- protected void logWarn(String warn) {
+ protected void logWarn(final String warn) {
System.err.println(warn);
}
@@ -415,7 +415,7 @@ public class PngReader {
* @param chunkLoadBehaviour
* {@link ChunkLoadBehaviour}
*/
- public void setChunkLoadBehaviour(ChunkLoadBehaviour chunkLoadBehaviour) {
+ public void setChunkLoadBehaviour(final ChunkLoadBehaviour chunkLoadBehaviour) {
this.chunkLoadBehaviour = chunkLoadBehaviour;
}
@@ -459,7 +459,7 @@ public class PngReader {
*
* @see #readRowInt(int) {@link #readRowByte(int)}
*/
- public ImageLine readRow(int nrow) {
+ public ImageLine readRow(final int nrow) {
if (imgLine == null)
imgLine = new ImageLine(imgInfo, SampleType.INT, unpackedMode);
return imgLine.sampleType != SampleType.BYTE ? readRowInt(nrow) : readRowByte(nrow);
@@ -476,7 +476,7 @@ public class PngReader {
* @return ImageLine object, also available as field. Data is in
* {@link ImageLine#scanline} (int) field.
*/
- public ImageLine readRowInt(int nrow) {
+ public ImageLine readRowInt(final int nrow) {
if (imgLine == null)
imgLine = new ImageLine(imgInfo, SampleType.INT, unpackedMode);
if (imgLine.getRown() == nrow) // already read
@@ -499,7 +499,7 @@ public class PngReader {
* @return ImageLine object, also available as field. Data is in
* {@link ImageLine#scanlineb} (byte) field.
*/
- public ImageLine readRowByte(int nrow) {
+ public ImageLine readRowByte(final int nrow) {
if (imgLine == null)
imgLine = new ImageLine(imgInfo, SampleType.BYTE, unpackedMode);
if (imgLine.getRown() == nrow) // already read
@@ -513,7 +513,7 @@ public class PngReader {
/**
* @see #readRowInt(int[], int)
*/
- public final int[] readRow(int[] buffer, final int nrow) {
+ public final int[] readRow(final int[] buffer, final int nrow) {
return readRowInt(buffer, nrow);
}
@@ -596,11 +596,11 @@ public class PngReader {
* @deprecated Now {@link #readRow(int)} implements the same funcion. This
* method will be removed in future releases
*/
- public ImageLine getRow(int nrow) {
+ public ImageLine getRow(final int nrow) {
return readRow(nrow);
}
- private void decodeLastReadRowToInt(int[] buffer, int bytesRead) {
+ private void decodeLastReadRowToInt(final int[] buffer, final int bytesRead) {
if (imgInfo.bitDepth <= 8)
for (int i = 0, j = 1; i < bytesRead; i++)
buffer[i] = (rowb[j++] & 0xFF); // http://www.libpng.org/pub/png/spec/1.2/PNG-DataRep.html
@@ -611,7 +611,7 @@ public class PngReader {
ImageLine.unpackInplaceInt(imgInfo, buffer, buffer, false);
}
- private void decodeLastReadRowToByte(byte[] buffer, int bytesRead) {
+ private void decodeLastReadRowToByte(final byte[] buffer, final int bytesRead) {
if (imgInfo.bitDepth <= 8)
System.arraycopy(rowb, 1, buffer, 0, bytesRead);
else
@@ -644,27 +644,27 @@ public class PngReader {
* even/odd lines, etc
* @return Set of lines as a ImageLines, which wraps a matrix
*/
- public ImageLines readRowsInt(int rowOffset, int nRows, int rowStep) {
+ public ImageLines readRowsInt(final int rowOffset, int nRows, final int rowStep) {
if (nRows < 0)
nRows = (imgInfo.rows - rowOffset) / rowStep;
if (rowStep < 1 || rowOffset < 0 || nRows * rowStep + rowOffset > imgInfo.rows)
throw new PngjInputException("bad args");
- ImageLines imlines = new ImageLines(imgInfo, SampleType.INT, unpackedMode, rowOffset, nRows, rowStep);
+ final ImageLines imlines = new ImageLines(imgInfo, SampleType.INT, unpackedMode, rowOffset, nRows, rowStep);
if (!interlaced) {
for (int j = 0; j < imgInfo.rows; j++) {
- int bytesread = readRowRaw(j); // read and perhaps discards
- int mrow = imlines.imageRowToMatrixRowStrict(j);
+ final int bytesread = readRowRaw(j); // read and perhaps discards
+ final int mrow = imlines.imageRowToMatrixRowStrict(j);
if (mrow >= 0)
decodeLastReadRowToInt(imlines.scanlines[mrow], bytesread);
}
} else { // and now, for something completely different (interlaced)
- int[] buf = new int[unpackedMode ? imgInfo.samplesPerRow : imgInfo.samplesPerRowPacked];
+ final int[] buf = new int[unpackedMode ? imgInfo.samplesPerRow : imgInfo.samplesPerRowPacked];
for (int p = 1; p <= 7; p++) {
deinterlacer.setPass(p);
for (int i = 0; i < deinterlacer.getRows(); i++) {
- int bytesread = readRowRaw(i);
- int j = deinterlacer.getCurrRowReal();
- int mrow = imlines.imageRowToMatrixRowStrict(j);
+ final int bytesread = readRowRaw(i);
+ final int j = deinterlacer.getCurrRowReal();
+ final int mrow = imlines.imageRowToMatrixRowStrict(j);
if (mrow >= 0) {
decodeLastReadRowToInt(buf, bytesread);
deinterlacer.deinterlaceInt(buf, imlines.scanlines[mrow], !unpackedMode);
@@ -709,27 +709,27 @@ public class PngReader {
* even/odd lines, etc
* @return Set of lines as a matrix
*/
- public ImageLines readRowsByte(int rowOffset, int nRows, int rowStep) {
+ public ImageLines readRowsByte(final int rowOffset, int nRows, final int rowStep) {
if (nRows < 0)
nRows = (imgInfo.rows - rowOffset) / rowStep;
if (rowStep < 1 || rowOffset < 0 || nRows * rowStep + rowOffset > imgInfo.rows)
throw new PngjInputException("bad args");
- ImageLines imlines = new ImageLines(imgInfo, SampleType.BYTE, unpackedMode, rowOffset, nRows, rowStep);
+ final ImageLines imlines = new ImageLines(imgInfo, SampleType.BYTE, unpackedMode, rowOffset, nRows, rowStep);
if (!interlaced) {
for (int j = 0; j < imgInfo.rows; j++) {
- int bytesread = readRowRaw(j); // read and perhaps discards
- int mrow = imlines.imageRowToMatrixRowStrict(j);
+ final int bytesread = readRowRaw(j); // read and perhaps discards
+ final int mrow = imlines.imageRowToMatrixRowStrict(j);
if (mrow >= 0)
decodeLastReadRowToByte(imlines.scanlinesb[mrow], bytesread);
}
} else { // and now, for something completely different (interlaced)
- byte[] buf = new byte[unpackedMode ? imgInfo.samplesPerRow : imgInfo.samplesPerRowPacked];
+ final byte[] buf = new byte[unpackedMode ? imgInfo.samplesPerRow : imgInfo.samplesPerRowPacked];
for (int p = 1; p <= 7; p++) {
deinterlacer.setPass(p);
for (int i = 0; i < deinterlacer.getRows(); i++) {
- int bytesread = readRowRaw(i);
- int j = deinterlacer.getCurrRowReal();
- int mrow = imlines.imageRowToMatrixRowStrict(j);
+ final int bytesread = readRowRaw(i);
+ final int j = deinterlacer.getCurrRowReal();
+ final int mrow = imlines.imageRowToMatrixRowStrict(j);
if (mrow >= 0) {
decodeLastReadRowToByte(buf, bytesread);
deinterlacer.deinterlaceByte(buf, imlines.scanlinesb[mrow], !unpackedMode);
@@ -784,7 +784,7 @@ public class PngReader {
}
rowNum = nrow;
// swap buffers
- byte[] tmp = rowb;
+ final byte[] tmp = rowb;
rowb = rowbprev;
rowbprev = tmp;
// loads in rowbfilter "raw" bytes, with filter
@@ -821,7 +821,7 @@ public class PngReader {
do {
r = iIdatCstream.read(rowbfilter, 0, buffersLen);
} while (r >= 0);
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new PngjInputException("error in raw read of IDAT", e);
}
offset = iIdatCstream.getOffset();
@@ -838,7 +838,7 @@ public class PngReader {
* These are the bytes read (not loaded) in the input stream. If exceeded,
* an exception will be thrown.
*/
- public void setMaxTotalBytesRead(long maxTotalBytesToRead) {
+ public void setMaxTotalBytesRead(final long maxTotalBytesToRead) {
this.maxTotalBytesRead = maxTotalBytesToRead;
}
@@ -854,7 +854,7 @@ public class PngReader {
* default: 5Mb).
* If exceeded, some chunks will be skipped
*/
- public void setMaxBytesMetadata(int maxBytesChunksToLoad) {
+ public void setMaxBytesMetadata(final int maxBytesChunksToLoad) {
this.maxBytesMetadata = maxBytesChunksToLoad;
}
@@ -872,7 +872,7 @@ public class PngReader {
* checked) and the chunk will be saved as a PngChunkSkipped object. See
* also setSkipChunkIds
*/
- public void setSkipChunkMaxSize(int skipChunksBySize) {
+ public void setSkipChunkMaxSize(final int skipChunksBySize) {
this.skipChunkMaxSize = skipChunksBySize;
}
@@ -888,7 +888,7 @@ public class PngReader {
* These chunks will be skipped (the CRC will not be checked) and the chunk
* will be saved as a PngChunkSkipped object. See also setSkipChunkMaxSize
*/
- public void setSkipChunkIds(String[] skipChunksById) {
+ public void setSkipChunkIds(final String[] skipChunksById) {
this.skipChunkIds = skipChunksById == null ? new String[] {} : skipChunksById;
}
@@ -904,7 +904,7 @@ public class PngReader {
*
* default=true
*/
- public void setShouldCloseStream(boolean shouldCloseStream) {
+ public void setShouldCloseStream(final boolean shouldCloseStream) {
this.shouldCloseStream = shouldCloseStream;
}
@@ -936,7 +936,7 @@ public class PngReader {
*
* @param unPackedMode
*/
- public void setUnpackedMode(boolean unPackedMode) {
+ public void setUnpackedMode(final boolean unPackedMode) {
this.unpackedMode = unPackedMode;
}
@@ -954,7 +954,7 @@ public class PngReader {
*
* @param other A PngReader that has already finished reading pixels. Can be null.
*/
- public void reuseBuffersFrom(PngReader other) {
+ public void reuseBuffersFrom(final PngReader other) {
if(other==null) return;
if (other.currentChunkGroup < ChunksList.CHUNK_GROUP_5_AFTERIDAT)
throw new PngjInputException("PngReader to be reused have not yet ended reading pixels");
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/PngWriter.java b/src/jogl/classes/jogamp/opengl/util/pngj/PngWriter.java
index 2f475aab1..ed5dd7d69 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/PngWriter.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/PngWriter.java
@@ -64,7 +64,7 @@ public class PngWriter {
*/
private int deflaterStrategy = Deflater.FILTERED;
- private int[] histox = new int[256]; // auxiliar buffer, only used by reportResultsForFilter
+ private final int[] histox = new int[256]; // auxiliar buffer, only used by reportResultsForFilter
private int idatMaxSize = 0; // 0=use default (PngIDatChunkOutputStream 32768)
@@ -78,7 +78,7 @@ public class PngWriter {
// this only influences the 1-2-4 bitdepth format - and if we pass a ImageLine to writeRow, this is ignored
private boolean unpackedMode = false;
- public PngWriter(OutputStream outputStream, ImageInfo imgInfo) {
+ public PngWriter(final OutputStream outputStream, final ImageInfo imgInfo) {
this(outputStream, imgInfo, "[NO FILENAME AVAILABLE]");
}
@@ -96,7 +96,7 @@ public class PngWriter {
* @param filenameOrDescription
* Optional, just for error/debug messages
*/
- public PngWriter(OutputStream outputStream, ImageInfo imgInfo, String filenameOrDescription) {
+ public PngWriter(final OutputStream outputStream, final ImageInfo imgInfo, final String filenameOrDescription) {
this.filename = filenameOrDescription == null ? "" : filenameOrDescription;
this.os = outputStream;
this.imgInfo = imgInfo;
@@ -111,29 +111,29 @@ public class PngWriter {
private void init() {
datStream = new PngIDatChunkOutputStream(this.os, idatMaxSize);
- Deflater def = new Deflater(compLevel);
+ final Deflater def = new Deflater(compLevel);
def.setStrategy(deflaterStrategy);
datStreamDeflated = new DeflaterOutputStream(datStream, def);
writeSignatureAndIHDR();
writeFirstChunks();
}
- private void reportResultsForFilter(int rown, FilterType type, boolean tentative) {
+ private void reportResultsForFilter(final int rown, final FilterType type, final boolean tentative) {
Arrays.fill(histox, 0);
int s = 0, v;
for (int i = 1; i <= imgInfo.bytesPerRow; i++) {
v = rowbfilter[i];
if (v < 0)
- s -= (int) v;
+ s -= v;
else
- s += (int) v;
+ s += v;
histox[v & 0xFF]++;
}
filterStrat.fillResultsForFilter(rown, type, s, histox, tentative);
}
private void writeEndChunk() {
- PngChunkIEND c = new PngChunkIEND(imgInfo);
+ final PngChunkIEND c = new PngChunkIEND(imgInfo);
c.createRawChunk().writeChunk(os);
}
@@ -156,7 +156,7 @@ public class PngWriter {
currentChunkGroup = ChunksList.CHUNK_GROUP_5_AFTERIDAT;
chunksList.writeChunks(os, currentChunkGroup);
// should not be unwriten chunks
- List pending = chunksList.getQueuedChunks();
+ final List pending = chunksList.getQueuedChunks();
if (!pending.isEmpty())
throw new PngjOutputException(pending.size() + " chunks were not written! Eg: " + pending.get(0).toString());
currentChunkGroup = ChunksList.CHUNK_GROUP_6_END;
@@ -169,7 +169,7 @@ public class PngWriter {
currentChunkGroup = ChunksList.CHUNK_GROUP_0_IDHR;
PngHelperInternal.writeBytes(os, PngHelperInternal.getPngIdSignature()); // signature
- PngChunkIHDR ihdr = new PngChunkIHDR(imgInfo);
+ final PngChunkIHDR ihdr = new PngChunkIHDR(imgInfo);
// http://www.libpng.org/pub/png/spec/1.2/PNG-Chunks.html
ihdr.setCols(imgInfo.cols);
ihdr.setRows(imgInfo.rows);
@@ -189,16 +189,16 @@ public class PngWriter {
}
- protected void encodeRowFromByte(byte[] row) {
+ protected void encodeRowFromByte(final byte[] row) {
if (row.length == imgInfo.samplesPerRowPacked) {
// some duplication of code - because this case is typical and it works faster this way
int j = 1;
if (imgInfo.bitDepth <= 8) {
- for (byte x : row) { // optimized
+ for (final byte x : row) { // optimized
rowb[j++] = x;
}
} else { // 16 bitspc
- for (byte x : row) { // optimized
+ for (final byte x : row) { // optimized
rowb[j] = x;
j += 2;
}
@@ -221,17 +221,17 @@ public class PngWriter {
}
}
- protected void encodeRowFromInt(int[] row) {
+ protected void encodeRowFromInt(final int[] row) {
// http://www.libpng.org/pub/png/spec/1.2/PNG-DataRep.html
if (row.length == imgInfo.samplesPerRowPacked) {
// some duplication of code - because this case is typical and it works faster this way
int j = 1;
if (imgInfo.bitDepth <= 8) {
- for (int x : row) { // optimized
+ for (final int x : row) { // optimized
rowb[j++] = (byte) x;
}
} else { // 16 bitspc
- for (int x : row) { // optimized
+ for (final int x : row) { // optimized
rowb[j++] = (byte) (x >> 8);
rowb[j++] = (byte) (x);
}
@@ -253,7 +253,7 @@ public class PngWriter {
}
}
- private void filterRow(int rown) {
+ private void filterRow(final int rown) {
// warning: filters operation rely on: "previos row" (rowbprev) is
// initialized to 0 the first time
if (filterStrat.shouldTestAll(rown)) {
@@ -268,7 +268,7 @@ public class PngWriter {
filterRowPaeth();
reportResultsForFilter(rown, FilterType.FILTER_PAETH, true);
}
- FilterType filterType = filterStrat.gimmeFilterType(rown, true);
+ final FilterType filterType = filterStrat.gimmeFilterType(rown, true);
rowbfilter[0] = (byte) filterType.val;
switch (filterType) {
case FILTER_NONE:
@@ -292,23 +292,23 @@ public class PngWriter {
reportResultsForFilter(rown, filterType, false);
}
- private void prepareEncodeRow(int rown) {
+ private void prepareEncodeRow(final int rown) {
if (datStream == null)
init();
rowNum++;
if (rown >= 0 && rowNum != rown)
throw new PngjOutputException("rows must be written in order: expected:" + rowNum + " passed:" + rown);
// swap
- byte[] tmp = rowb;
+ final byte[] tmp = rowb;
rowb = rowbprev;
rowbprev = tmp;
}
- private void filterAndSend(int rown) {
+ private void filterAndSend(final int rown) {
filterRow(rown);
try {
datStreamDeflated.write(rowbfilter, 0, imgInfo.bytesPerRow + 1);
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new PngjOutputException(e);
}
}
@@ -323,7 +323,7 @@ public class PngWriter {
protected void filterRowNone() {
for (int i = 1; i <= imgInfo.bytesPerRow; i++) {
- rowbfilter[i] = (byte) rowb[i];
+ rowbfilter[i] = rowb[i];
}
}
@@ -341,7 +341,7 @@ public class PngWriter {
protected void filterRowSub() {
int i, j;
for (i = 1; i <= imgInfo.bytesPixel; i++)
- rowbfilter[i] = (byte) rowb[i];
+ rowbfilter[i] = rowb[i];
for (j = 1, i = imgInfo.bytesPixel + 1; i <= imgInfo.bytesPerRow; i++, j++) {
// !!! rowbfilter[i] = (byte) (rowb[i] - rowb[j]);
rowbfilter[i] = (byte) PngHelperInternal.filterRowSub(rowb[i], rowb[j]);
@@ -359,9 +359,9 @@ public class PngWriter {
int s = 0;
for (int i = 1; i <= imgInfo.bytesPerRow; i++)
if (rowbfilter[i] < 0)
- s -= (int) rowbfilter[i];
+ s -= rowbfilter[i];
else
- s += (int) rowbfilter[i];
+ s += rowbfilter[i];
return s;
}
@@ -372,12 +372,12 @@ public class PngWriter {
*
* TODO: this should be more customizable
*/
- private void copyChunks(PngReader reader, int copy_mask, boolean onlyAfterIdat) {
- boolean idatDone = currentChunkGroup >= ChunksList.CHUNK_GROUP_4_IDAT;
+ private void copyChunks(final PngReader reader, final int copy_mask, final boolean onlyAfterIdat) {
+ final boolean idatDone = currentChunkGroup >= ChunksList.CHUNK_GROUP_4_IDAT;
if (onlyAfterIdat && reader.getCurrentChunkGroup() < ChunksList.CHUNK_GROUP_6_END)
throw new PngjExceptionInternal("tried to copy last chunks but reader has not ended");
- for (PngChunk chunk : reader.getChunksList().getChunks()) {
- int group = chunk.getChunkGroup();
+ for (final PngChunk chunk : reader.getChunksList().getChunks()) {
+ final int group = chunk.getChunkGroup();
if (group < ChunksList.CHUNK_GROUP_4_IDAT && idatDone)
continue;
boolean copy = false;
@@ -389,8 +389,8 @@ public class PngWriter {
copy = true;
}
} else { // ancillary
- boolean text = (chunk instanceof PngChunkTextVar);
- boolean safe = chunk.safe;
+ final boolean text = (chunk instanceof PngChunkTextVar);
+ final boolean safe = chunk.safe;
// notice that these if are not exclusive
if (ChunkHelper.maskMatch(copy_mask, ChunkCopyBehaviour.COPY_ALL))
copy = true;
@@ -429,7 +429,7 @@ public class PngWriter {
* : Mask bit (OR), see ChunksToWrite.COPY_XXX
* constants
*/
- public void copyChunksFirst(PngReader reader, int copy_mask) {
+ public void copyChunksFirst(final PngReader reader, final int copy_mask) {
copyChunks(reader, copy_mask, false);
}
@@ -446,7 +446,7 @@ public class PngWriter {
* : Mask bit (OR), see ChunksToWrite.COPY_XXX
* constants
*/
- public void copyChunksLast(PngReader reader, int copy_mask) {
+ public void copyChunksLast(final PngReader reader, final int copy_mask) {
copyChunks(reader, copy_mask, true);
}
@@ -461,8 +461,8 @@ public class PngWriter {
public double computeCompressionRatio() {
if (currentChunkGroup < ChunksList.CHUNK_GROUP_6_END)
throw new PngjOutputException("must be called after end()");
- double compressed = (double) datStream.getCountFlushed();
- double raw = (imgInfo.bytesPerRow + 1) * imgInfo.rows;
+ final double compressed = datStream.getCountFlushed();
+ final double raw = (imgInfo.bytesPerRow + 1) * imgInfo.rows;
return compressed / raw;
}
@@ -480,7 +480,7 @@ public class PngWriter {
writeEndChunk();
if (shouldCloseStream)
os.close();
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new PngjOutputException(e);
}
}
@@ -516,7 +516,7 @@ public class PngWriter {
* @param compLevel
* between 0 and 9 (default:6 , recommended: 6 or more)
*/
- public void setCompLevel(int compLevel) {
+ public void setCompLevel(final int compLevel) {
if (compLevel < 0 || compLevel > 9)
throw new PngjOutputException("Compression level invalid (" + compLevel + ") Must be 0..9");
this.compLevel = compLevel;
@@ -534,7 +534,7 @@ public class PngWriter {
* PngFilterType
) Recommended values: DEFAULT
* (default) or AGGRESIVE
*/
- public void setFilterType(FilterType filterType) {
+ public void setFilterType(final FilterType filterType) {
filterStrat = new FilterWriteStrategy(imgInfo, filterType);
}
@@ -546,7 +546,7 @@ public class PngWriter {
* @param idatMaxSize
* default=0 : use defaultSize (32K)
*/
- public void setIdatMaxSize(int idatMaxSize) {
+ public void setIdatMaxSize(final int idatMaxSize) {
this.idatMaxSize = idatMaxSize;
}
@@ -555,7 +555,7 @@ public class PngWriter {
*
* default=true
*/
- public void setShouldCloseStream(boolean shouldCloseStream) {
+ public void setShouldCloseStream(final boolean shouldCloseStream) {
this.shouldCloseStream = shouldCloseStream;
}
@@ -565,7 +565,7 @@ public class PngWriter {
*
* Default: Deflater.FILTERED . This should be changed very rarely.
*/
- public void setDeflaterStrategy(int deflaterStrategy) {
+ public void setDeflaterStrategy(final int deflaterStrategy) {
this.deflaterStrategy = deflaterStrategy;
}
@@ -575,7 +575,7 @@ public class PngWriter {
*
* @deprecated Better use writeRow(ImageLine imgline, int rownumber)
*/
- public void writeRow(ImageLine imgline) {
+ public void writeRow(final ImageLine imgline) {
writeRow(imgline.scanline, imgline.getRown());
}
@@ -586,7 +586,7 @@ public class PngWriter {
*
* @see #writeRowInt(int[], int)
*/
- public void writeRow(ImageLine imgline, int rownumber) {
+ public void writeRow(final ImageLine imgline, final int rownumber) {
unpackedMode = imgline.samplesUnpacked;
if (imgline.sampleType == SampleType.INT)
writeRowInt(imgline.scanline, rownumber);
@@ -599,7 +599,7 @@ public class PngWriter {
*
* @param newrow
*/
- public void writeRow(int[] newrow) {
+ public void writeRow(final int[] newrow) {
writeRow(newrow, -1);
}
@@ -608,7 +608,7 @@ public class PngWriter {
*
* @see #writeRowInt(int[], int)
*/
- public void writeRow(int[] newrow, int rown) {
+ public void writeRow(final int[] newrow, final int rown) {
writeRowInt(newrow, rown);
}
@@ -632,7 +632,7 @@ public class PngWriter {
* Row number, from 0 (top) to rows-1 (bottom). This is just used
* as a check. Pass -1 if you want to autocompute it
*/
- public void writeRowInt(int[] newrow, int rown) {
+ public void writeRowInt(final int[] newrow, final int rown) {
prepareEncodeRow(rown);
encodeRowFromInt(newrow);
filterAndSend(rown);
@@ -645,7 +645,7 @@ public class PngWriter {
*
* @see PngWriter#writeRowInt(int[], int)
*/
- public void writeRowByte(byte[] newrow, int rown) {
+ public void writeRowByte(final byte[] newrow, final int rown) {
prepareEncodeRow(rown);
encodeRowFromByte(newrow);
filterAndSend(rown);
@@ -654,7 +654,7 @@ public class PngWriter {
/**
* Writes all the pixels, calling writeRowInt() for each image row
*/
- public void writeRowsInt(int[][] image) {
+ public void writeRowsInt(final int[][] image) {
for (int i = 0; i < imgInfo.rows; i++)
writeRowInt(image[i], i);
}
@@ -662,7 +662,7 @@ public class PngWriter {
/**
* Writes all the pixels, calling writeRowByte() for each image row
*/
- public void writeRowsByte(byte[][] image) {
+ public void writeRowsByte(final byte[][] image) {
for (int i = 0; i < imgInfo.rows; i++)
writeRowByte(image[i], i);
}
@@ -682,7 +682,7 @@ public class PngWriter {
* packed flag of the ImageLine object overrides (and overwrites!)
* this field.
*/
- public void setUseUnPackedMode(boolean useUnpackedMode) {
+ public void setUseUnPackedMode(final boolean useUnpackedMode) {
this.unpackedMode = useUnpackedMode;
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/PngjBadCrcException.java b/src/jogl/classes/jogamp/opengl/util/pngj/PngjBadCrcException.java
index 3b74f862f..032b2ed3a 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/PngjBadCrcException.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/PngjBadCrcException.java
@@ -6,15 +6,15 @@ package jogamp.opengl.util.pngj;
public class PngjBadCrcException extends PngjInputException {
private static final long serialVersionUID = 1L;
- public PngjBadCrcException(String message, Throwable cause) {
+ public PngjBadCrcException(final String message, final Throwable cause) {
super(message, cause);
}
- public PngjBadCrcException(String message) {
+ public PngjBadCrcException(final String message) {
super(message);
}
- public PngjBadCrcException(Throwable cause) {
+ public PngjBadCrcException(final Throwable cause) {
super(cause);
}
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/PngjException.java b/src/jogl/classes/jogamp/opengl/util/pngj/PngjException.java
index 97e24fc73..3d05589b1 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/PngjException.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/PngjException.java
@@ -9,15 +9,15 @@ package jogamp.opengl.util.pngj;
public class PngjException extends RuntimeException {
private static final long serialVersionUID = 1L;
- public PngjException(String message, Throwable cause) {
+ public PngjException(final String message, final Throwable cause) {
super(message, cause);
}
- public PngjException(String message) {
+ public PngjException(final String message) {
super(message);
}
- public PngjException(Throwable cause) {
+ public PngjException(final Throwable cause) {
super(cause);
}
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/PngjExceptionInternal.java b/src/jogl/classes/jogamp/opengl/util/pngj/PngjExceptionInternal.java
index 5da70de7b..9484abf5e 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/PngjExceptionInternal.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/PngjExceptionInternal.java
@@ -10,15 +10,15 @@ package jogamp.opengl.util.pngj;
public class PngjExceptionInternal extends RuntimeException {
private static final long serialVersionUID = 1L;
- public PngjExceptionInternal(String message, Throwable cause) {
+ public PngjExceptionInternal(final String message, final Throwable cause) {
super(message, cause);
}
- public PngjExceptionInternal(String message) {
+ public PngjExceptionInternal(final String message) {
super(message);
}
- public PngjExceptionInternal(Throwable cause) {
+ public PngjExceptionInternal(final Throwable cause) {
super(cause);
}
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/PngjInputException.java b/src/jogl/classes/jogamp/opengl/util/pngj/PngjInputException.java
index 5cc36b99a..c92d80b2c 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/PngjInputException.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/PngjInputException.java
@@ -6,15 +6,15 @@ package jogamp.opengl.util.pngj;
public class PngjInputException extends PngjException {
private static final long serialVersionUID = 1L;
- public PngjInputException(String message, Throwable cause) {
+ public PngjInputException(final String message, final Throwable cause) {
super(message, cause);
}
- public PngjInputException(String message) {
+ public PngjInputException(final String message) {
super(message);
}
- public PngjInputException(Throwable cause) {
+ public PngjInputException(final Throwable cause) {
super(cause);
}
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/PngjOutputException.java b/src/jogl/classes/jogamp/opengl/util/pngj/PngjOutputException.java
index c8cd36acb..4e9cdc950 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/PngjOutputException.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/PngjOutputException.java
@@ -6,15 +6,15 @@ package jogamp.opengl.util.pngj;
public class PngjOutputException extends PngjException {
private static final long serialVersionUID = 1L;
- public PngjOutputException(String message, Throwable cause) {
+ public PngjOutputException(final String message, final Throwable cause) {
super(message, cause);
}
- public PngjOutputException(String message) {
+ public PngjOutputException(final String message) {
super(message);
}
- public PngjOutputException(Throwable cause) {
+ public PngjOutputException(final Throwable cause) {
super(cause);
}
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/PngjUnsupportedException.java b/src/jogl/classes/jogamp/opengl/util/pngj/PngjUnsupportedException.java
index f68458d19..e68b153ac 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/PngjUnsupportedException.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/PngjUnsupportedException.java
@@ -11,15 +11,15 @@ public class PngjUnsupportedException extends RuntimeException {
super();
}
- public PngjUnsupportedException(String message, Throwable cause) {
+ public PngjUnsupportedException(final String message, final Throwable cause) {
super(message, cause);
}
- public PngjUnsupportedException(String message) {
+ public PngjUnsupportedException(final String message) {
super(message);
}
- public PngjUnsupportedException(Throwable cause) {
+ public PngjUnsupportedException(final Throwable cause) {
super(cause);
}
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/ProgressiveOutputStream.java b/src/jogl/classes/jogamp/opengl/util/pngj/ProgressiveOutputStream.java
index 4516a0886..248472298 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/ProgressiveOutputStream.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/ProgressiveOutputStream.java
@@ -11,7 +11,7 @@ abstract class ProgressiveOutputStream extends ByteArrayOutputStream {
private final int size;
private long countFlushed = 0;
- public ProgressiveOutputStream(int size) {
+ public ProgressiveOutputStream(final int size) {
this.size = size;
}
@@ -28,19 +28,19 @@ abstract class ProgressiveOutputStream extends ByteArrayOutputStream {
}
@Override
- public final void write(byte[] b, int off, int len) {
+ public final void write(final byte[] b, final int off, final int len) {
super.write(b, off, len);
checkFlushBuffer(false);
}
@Override
- public final void write(byte[] b) throws IOException {
+ public final void write(final byte[] b) throws IOException {
super.write(b);
checkFlushBuffer(false);
}
@Override
- public final void write(int arg0) {
+ public final void write(final int arg0) {
super.write(arg0);
checkFlushBuffer(false);
}
@@ -54,7 +54,7 @@ abstract class ProgressiveOutputStream extends ByteArrayOutputStream {
* if it's time to flush data (or if forced==true) calls abstract method
* flushBuffer() and cleans those bytes from own buffer
*/
- private final void checkFlushBuffer(boolean forced) {
+ private final void checkFlushBuffer(final boolean forced) {
while (forced || count >= size) {
int nb = size;
if (nb > count)
@@ -63,7 +63,7 @@ abstract class ProgressiveOutputStream extends ByteArrayOutputStream {
return;
flushBuffer(buf, nb);
countFlushed += nb;
- int bytesleft = count - nb;
+ final int bytesleft = count - nb;
count = bytesleft;
if (bytesleft > 0)
System.arraycopy(buf, nb, buf, 0, bytesleft);
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkHelper.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkHelper.java
index 4e8bf5635..b8cfd8691 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkHelper.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkHelper.java
@@ -68,63 +68,63 @@ public class ChunkHelper {
/**
* Converts to bytes using Latin1 (ISO-8859-1)
*/
- public static byte[] toBytes(String x) {
+ public static byte[] toBytes(final String x) {
return x.getBytes(PngHelperInternal.charsetLatin1);
}
/**
* Converts to String using Latin1 (ISO-8859-1)
*/
- public static String toString(byte[] x) {
+ public static String toString(final byte[] x) {
return new String(x, PngHelperInternal.charsetLatin1);
}
/**
* Converts to String using Latin1 (ISO-8859-1)
*/
- public static String toString(byte[] x, int offset, int len) {
+ public static String toString(final byte[] x, final int offset, final int len) {
return new String(x, offset, len, PngHelperInternal.charsetLatin1);
}
/**
* Converts to bytes using UTF-8
*/
- public static byte[] toBytesUTF8(String x) {
+ public static byte[] toBytesUTF8(final String x) {
return x.getBytes(PngHelperInternal.charsetUTF8);
}
/**
* Converts to string using UTF-8
*/
- public static String toStringUTF8(byte[] x) {
+ public static String toStringUTF8(final byte[] x) {
return new String(x, PngHelperInternal.charsetUTF8);
}
/**
* Converts to string using UTF-8
*/
- public static String toStringUTF8(byte[] x, int offset, int len) {
+ public static String toStringUTF8(final byte[] x, final int offset, final int len) {
return new String(x, offset, len, PngHelperInternal.charsetUTF8);
}
/**
* critical chunk : first letter is uppercase
*/
- public static boolean isCritical(String id) {
+ public static boolean isCritical(final String id) {
return (Character.isUpperCase(id.charAt(0)));
}
/**
* public chunk: second letter is uppercase
*/
- public static boolean isPublic(String id) { //
+ public static boolean isPublic(final String id) { //
return (Character.isUpperCase(id.charAt(1)));
}
/**
* Safe to copy chunk: fourth letter is lower case
*/
- public static boolean isSafeToCopy(String id) {
+ public static boolean isSafeToCopy(final String id) {
return (!Character.isUpperCase(id.charAt(3)));
}
@@ -132,7 +132,7 @@ public class ChunkHelper {
* "Unknown" just means that our chunk factory (even when it has been
* augmented by client code) did not recognize its id
*/
- public static boolean isUnknown(PngChunk c) {
+ public static boolean isUnknown(final PngChunk c) {
return c instanceof PngChunkUNKNOWN;
}
@@ -142,7 +142,7 @@ public class ChunkHelper {
* @param b
* @return -1 if not found
*/
- public static int posNullByte(byte[] b) {
+ public static int posNullByte(final byte[] b) {
for (int i = 0; i < b.length; i++)
if (b[i] == 0)
return i;
@@ -156,10 +156,10 @@ public class ChunkHelper {
* @param behav
* @return true/false
*/
- public static boolean shouldLoad(String id, ChunkLoadBehaviour behav) {
+ public static boolean shouldLoad(final String id, final ChunkLoadBehaviour behav) {
if (isCritical(id))
return true;
- boolean kwown = PngChunk.isKnown(id);
+ final boolean kwown = PngChunk.isKnown(id);
switch (behav) {
case LOAD_CHUNK_ALWAYS:
return true;
@@ -173,21 +173,21 @@ public class ChunkHelper {
return false; // should not reach here
}
- public final static byte[] compressBytes(byte[] ori, boolean compress) {
+ public final static byte[] compressBytes(final byte[] ori, final boolean compress) {
return compressBytes(ori, 0, ori.length, compress);
}
- public static byte[] compressBytes(byte[] ori, int offset, int len, boolean compress) {
+ public static byte[] compressBytes(final byte[] ori, final int offset, final int len, final boolean compress) {
try {
- ByteArrayInputStream inb = new ByteArrayInputStream(ori, offset, len);
- InputStream in = compress ? inb : new InflaterInputStream(inb, getInflater());
- ByteArrayOutputStream outb = new ByteArrayOutputStream();
- OutputStream out = compress ? new DeflaterOutputStream(outb) : outb;
+ final ByteArrayInputStream inb = new ByteArrayInputStream(ori, offset, len);
+ final InputStream in = compress ? inb : new InflaterInputStream(inb, getInflater());
+ final ByteArrayOutputStream outb = new ByteArrayOutputStream();
+ final OutputStream out = compress ? new DeflaterOutputStream(outb) : outb;
shovelInToOut(in, out);
in.close();
out.close();
return outb.toByteArray();
- } catch (Exception e) {
+ } catch (final Exception e) {
throw new PngjException(e);
}
}
@@ -195,7 +195,7 @@ public class ChunkHelper {
/**
* Shovels all data from an input stream to an output stream.
*/
- private static void shovelInToOut(InputStream in, OutputStream out) throws IOException {
+ private static void shovelInToOut(final InputStream in, final OutputStream out) throws IOException {
synchronized (tmpbuffer) {
int len;
while ((len = in.read(tmpbuffer)) > 0) {
@@ -204,7 +204,7 @@ public class ChunkHelper {
}
}
- public static boolean maskMatch(int v, int mask) {
+ public static boolean maskMatch(final int v, final int mask) {
return (v & mask) != 0;
}
@@ -213,9 +213,9 @@ public class ChunkHelper {
*
* See also trimList()
*/
- public static List filterList(List target, ChunkPredicate predicateKeep) {
- List result = new ArrayList();
- for (PngChunk element : target) {
+ public static List filterList(final List target, final ChunkPredicate predicateKeep) {
+ final List result = new ArrayList();
+ for (final PngChunk element : target) {
if (predicateKeep.match(element)) {
result.add(element);
}
@@ -228,11 +228,11 @@ public class ChunkHelper {
*
* See also filterList
*/
- public static int trimList(List target, ChunkPredicate predicateRemove) {
- Iterator it = target.iterator();
+ public static int trimList(final List target, final ChunkPredicate predicateRemove) {
+ final Iterator it = target.iterator();
int cont = 0;
while (it.hasNext()) {
- PngChunk c = it.next();
+ final PngChunk c = it.next();
if (predicateRemove.match(c)) {
it.remove();
cont++;
@@ -252,7 +252,7 @@ public class ChunkHelper {
*
* @return true if "equivalent"
*/
- public static final boolean equivalent(PngChunk c1, PngChunk c2) {
+ public static final boolean equivalent(final PngChunk c1, final PngChunk c2) {
if (c1 == c2)
return true;
if (c1 == null || c2 == null || !c1.id.equals(c2.id))
@@ -272,7 +272,7 @@ public class ChunkHelper {
return false;
}
- public static boolean isText(PngChunk c) {
+ public static boolean isText(final PngChunk c) {
return c instanceof PngChunkTextVar;
}
@@ -281,7 +281,7 @@ public class ChunkHelper {
* individual chunks compression
*/
public static Inflater getInflater() {
- Inflater inflater = inflaterProvider.get();
+ final Inflater inflater = inflaterProvider.get();
inflater.reset();
return inflater;
}
@@ -291,7 +291,7 @@ public class ChunkHelper {
* individual chunks decompression
*/
public static Deflater getDeflater() {
- Deflater deflater = deflaterProvider.get();
+ final Deflater deflater = deflaterProvider.get();
deflater.reset();
return deflater;
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkRaw.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkRaw.java
index dcb1958df..0ac2dc6a0 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkRaw.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkRaw.java
@@ -50,7 +50,7 @@ public class ChunkRaw {
* @param alloc
* : it true, the data array will be allocced
*/
- public ChunkRaw(int len, byte[] idbytes, boolean alloc) {
+ public ChunkRaw(final int len, final byte[] idbytes, final boolean alloc) {
this.len = len;
System.arraycopy(idbytes, 0, this.idbytes, 0, 4);
if (alloc)
@@ -66,7 +66,7 @@ public class ChunkRaw {
* this is called after setting data, before writing to os
*/
private int computeCrc() {
- CRC32 crcengine = PngHelperInternal.getCRC();
+ final CRC32 crcengine = PngHelperInternal.getCRC();
crcengine.reset();
crcengine.update(idbytes, 0, 4);
if (len > 0)
@@ -78,7 +78,7 @@ public class ChunkRaw {
* Computes the CRC and writes to the stream. If error, a
* PngjOutputException is thrown
*/
- public void writeChunk(OutputStream os) {
+ public void writeChunk(final OutputStream os) {
if (idbytes.length != 4)
throw new PngjOutputException("bad chunkid [" + ChunkHelper.toString(idbytes) + "]");
crcval = computeCrc();
@@ -93,11 +93,11 @@ public class ChunkRaw {
* position before: just after chunk id. positon after: after crc Data
* should be already allocated. Checks CRC Return number of byte read.
*/
- public int readChunkData(InputStream is, boolean checkCrc) {
+ public int readChunkData(final InputStream is, final boolean checkCrc) {
PngHelperInternal.readBytes(is, data, 0, len);
crcval = PngHelperInternal.readInt4(is);
if (checkCrc) {
- int crc = computeCrc();
+ final int crc = computeCrc();
if (crc != crcval)
throw new PngjBadCrcException("chunk: " + this + " crc calc=" + crc + " read=" + crcval);
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksList.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksList.java
index 75107d761..f5a920e73 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksList.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksList.java
@@ -31,7 +31,7 @@ public class ChunksList {
final ImageInfo imageInfo; // only required for writing
- public ChunksList(ImageInfo imfinfo) {
+ public ChunksList(final ImageInfo imfinfo) {
this.imageInfo = imfinfo;
}
@@ -41,8 +41,8 @@ public class ChunksList {
* @return key:chunk id, val: number of occurrences
*/
public HashMap getChunksKeys() {
- HashMap ck = new HashMap();
- for (PngChunk c : chunks) {
+ final HashMap ck = new HashMap();
+ for (final PngChunk c : chunks) {
ck.put(c.id, ck.containsKey(c.id) ? ck.get(c.id) + 1 : 1);
}
return ck;
@@ -60,14 +60,14 @@ public class ChunksList {
if (innerid == null)
return ChunkHelper.filterList(list, new ChunkPredicate() {
@Override
- public boolean match(PngChunk c) {
+ public boolean match(final PngChunk c) {
return c.id.equals(id);
}
});
else
return ChunkHelper.filterList(list, new ChunkPredicate() {
@Override
- public boolean match(PngChunk c) {
+ public boolean match(final PngChunk c) {
if (!c.id.equals(id))
return false;
if (c instanceof PngChunkTextVar && !((PngChunkTextVar) c).getKey().equals(innerid))
@@ -82,7 +82,7 @@ public class ChunksList {
/**
* Adds chunk in next position. This is used onyl by the pngReader
*/
- public void appendReadChunk(PngChunk chunk, int chunkGroup) {
+ public void appendReadChunk(final PngChunk chunk, final int chunkGroup) {
chunk.setChunkGroup(chunkGroup);
chunks.add(chunk);
}
@@ -138,7 +138,7 @@ public class ChunksList {
* one is returned (failifMultiple=false)
**/
public PngChunk getById1(final String id, final String innerid, final boolean failIfMultiple) {
- List extends PngChunk> list = getById(id, innerid);
+ final List extends PngChunk> list = getById(id, innerid);
if (list.isEmpty())
return null;
if (list.size() > 1 && (failIfMultiple || !list.get(0).allowsMultiple()))
@@ -155,7 +155,7 @@ public class ChunksList {
public List getEquivalent(final PngChunk c2) {
return ChunkHelper.filterList(chunks, new ChunkPredicate() {
@Override
- public boolean match(PngChunk c) {
+ public boolean match(final PngChunk c) {
return ChunkHelper.equivalent(c, c2);
}
});
@@ -170,9 +170,9 @@ public class ChunksList {
* for debugging
*/
public String toStringFull() {
- StringBuilder sb = new StringBuilder(toString());
+ final StringBuilder sb = new StringBuilder(toString());
sb.append("\n Read:\n");
- for (PngChunk chunk : chunks) {
+ for (final PngChunk chunk : chunks) {
sb.append(chunk).append(" G=" + chunk.getChunkGroup() + "\n");
}
return sb.toString();
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksListForWrite.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksListForWrite.java
index c502e9071..6ad61f8e2 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksListForWrite.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksListForWrite.java
@@ -19,9 +19,9 @@ public class ChunksListForWrite extends ChunksList {
private final List queuedChunks = new ArrayList();
// redundant, just for eficciency
- private HashMap alreadyWrittenKeys = new HashMap();
+ private final HashMap alreadyWrittenKeys = new HashMap();
- public ChunksListForWrite(ImageInfo imfinfo) {
+ public ChunksListForWrite(final ImageInfo imfinfo) {
super(imfinfo);
}
@@ -43,7 +43,7 @@ public class ChunksListForWrite extends ChunksList {
* Same as getById1(), but looking in the queued chunks
**/
public PngChunk getQueuedById1(final String id, final String innerid, final boolean failIfMultiple) {
- List extends PngChunk> list = getQueuedById(id, innerid);
+ final List extends PngChunk> list = getQueuedById(id, innerid);
if (list.isEmpty())
return null;
if (list.size() > 1 && (failIfMultiple || !list.get(0).allowsMultiple()))
@@ -72,7 +72,7 @@ public class ChunksListForWrite extends ChunksList {
* straightforward for SingleChunks. For MultipleChunks, it will normally
* check for reference equality!
*/
- public boolean removeChunk(PngChunk c) {
+ public boolean removeChunk(final PngChunk c) {
return queuedChunks.remove(c);
}
@@ -83,7 +83,7 @@ public class ChunksListForWrite extends ChunksList {
*
* @param c
*/
- public boolean queue(PngChunk c) {
+ public boolean queue(final PngChunk c) {
queuedChunks.add(c);
return true;
}
@@ -92,7 +92,7 @@ public class ChunksListForWrite extends ChunksList {
* this should be called only for ancillary chunks and PLTE (groups 1 - 3 -
* 5)
**/
- private static boolean shouldWrite(PngChunk c, int currentGroup) {
+ private static boolean shouldWrite(final PngChunk c, final int currentGroup) {
if (currentGroup == CHUNK_GROUP_2_PLTE)
return c.id.equals(ChunkHelper.PLTE);
if (currentGroup % 2 == 0)
@@ -121,11 +121,11 @@ public class ChunksListForWrite extends ChunksList {
return false;
}
- public int writeChunks(OutputStream os, int currentGroup) {
+ public int writeChunks(final OutputStream os, final int currentGroup) {
int cont = 0;
- Iterator it = queuedChunks.iterator();
+ final Iterator it = queuedChunks.iterator();
while (it.hasNext()) {
- PngChunk c = it.next();
+ final PngChunk c = it.next();
if (!shouldWrite(c, currentGroup))
continue;
if (ChunkHelper.isCritical(c.id) && !c.id.equals(ChunkHelper.PLTE))
@@ -159,14 +159,14 @@ public class ChunksListForWrite extends ChunksList {
*/
@Override
public String toStringFull() {
- StringBuilder sb = new StringBuilder(toString());
+ final StringBuilder sb = new StringBuilder(toString());
sb.append("\n Written:\n");
- for (PngChunk chunk : chunks) {
+ for (final PngChunk chunk : chunks) {
sb.append(chunk).append(" G=" + chunk.getChunkGroup() + "\n");
}
if (!queuedChunks.isEmpty()) {
sb.append(" Queued:\n");
- for (PngChunk chunk : queuedChunks) {
+ for (final PngChunk chunk : queuedChunks) {
sb.append(chunk).append("\n");
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunk.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunk.java
index 6cd86eb98..eba218fe3 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunk.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunk.java
@@ -122,7 +122,7 @@ public abstract class PngChunk {
* (not implmemented in this library) to the factory, so that the PngReader
* knows about it.
*/
- public static void factoryRegister(String chunkId, Class extends PngChunk> chunkClass) {
+ public static void factoryRegister(final String chunkId, final Class extends PngChunk> chunkClass) {
factoryMap.put(chunkId, chunkClass);
}
@@ -137,11 +137,11 @@ public abstract class PngChunk {
*
* Unknown chunks will be parsed as instances of {@link PngChunkUNKNOWN}
*/
- public static boolean isKnown(String id) {
+ public static boolean isKnown(final String id) {
return factoryMap.containsKey(id);
}
- protected PngChunk(String id, ImageInfo imgInfo) {
+ protected PngChunk(final String id, final ImageInfo imgInfo) {
this.id = id;
this.imgInfo = imgInfo;
this.crit = ChunkHelper.isCritical(id);
@@ -153,8 +153,8 @@ public abstract class PngChunk {
* This factory creates the corresponding chunk and parses the raw chunk.
* This is used when reading.
*/
- public static PngChunk factory(ChunkRaw chunk, ImageInfo info) {
- PngChunk c = factoryFromId(ChunkHelper.toString(chunk.idbytes), info);
+ public static PngChunk factory(final ChunkRaw chunk, final ImageInfo info) {
+ final PngChunk c = factoryFromId(ChunkHelper.toString(chunk.idbytes), info);
c.length = chunk.len;
c.parseFromRaw(chunk);
return c;
@@ -164,15 +164,15 @@ public abstract class PngChunk {
* Creates one new blank chunk of the corresponding type, according to
* factoryMap (PngChunkUNKNOWN if not known)
*/
- public static PngChunk factoryFromId(String cid, ImageInfo info) {
+ public static PngChunk factoryFromId(final String cid, final ImageInfo info) {
PngChunk chunk = null;
try {
- Class extends PngChunk> cla = factoryMap.get(cid);
+ final Class extends PngChunk> cla = factoryMap.get(cid);
if (cla != null) {
- Constructor extends PngChunk> constr = cla.getConstructor(ImageInfo.class);
+ final Constructor extends PngChunk> constr = cla.getConstructor(ImageInfo.class);
chunk = constr.newInstance(info);
}
- } catch (Exception e) {
+ } catch (final Exception e) {
// this can happen for unkown chunks
}
if (chunk == null)
@@ -180,8 +180,8 @@ public abstract class PngChunk {
return chunk;
}
- protected final ChunkRaw createEmptyChunk(int len, boolean alloc) {
- ChunkRaw c = new ChunkRaw(len, ChunkHelper.toBytes(id), alloc);
+ protected final ChunkRaw createEmptyChunk(final int len, final boolean alloc) {
+ final ChunkRaw c = new ChunkRaw(len, ChunkHelper.toBytes(id), alloc);
return c;
}
@@ -189,8 +189,8 @@ public abstract class PngChunk {
* Makes a clone (deep copy) calling {@link #cloneDataFromRead(PngChunk)}
*/
@SuppressWarnings("unchecked")
- public static T cloneChunk(T chunk, ImageInfo info) {
- PngChunk cn = factoryFromId(chunk.id, info);
+ public static T cloneChunk(final T chunk, final ImageInfo info) {
+ final PngChunk cn = factoryFromId(chunk.id, info);
if (cn.getClass() != chunk.getClass())
throw new PngjExceptionInternal("bad class cloning chunk: " + cn.getClass() + " " + chunk.getClass());
cn.cloneDataFromRead(chunk);
@@ -210,7 +210,7 @@ public abstract class PngChunk {
/**
* @see #getChunkGroup()
*/
- final public void setChunkGroup(int chunkGroup) {
+ final public void setChunkGroup(final int chunkGroup) {
this.chunkGroup = chunkGroup;
}
@@ -218,12 +218,12 @@ public abstract class PngChunk {
return priority;
}
- public void setPriority(boolean priority) {
+ public void setPriority(final boolean priority) {
this.priority = priority;
}
- final void write(OutputStream os) {
- ChunkRaw c = createRawChunk();
+ final void write(final OutputStream os) {
+ final ChunkRaw c = createRawChunk();
if (c == null)
throw new PngjExceptionInternal("null chunk ! creation failed for " + this);
c.writeChunk(os);
@@ -241,7 +241,7 @@ public abstract class PngChunk {
return offset;
}
- public void setOffset(long offset) {
+ public void setOffset(final long offset) {
this.offset = offset;
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkBKGD.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkBKGD.java
index ea6235432..191278dbc 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkBKGD.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkBKGD.java
@@ -18,7 +18,7 @@ public class PngChunkBKGD extends PngChunkSingle {
private int red, green, blue;
private int paletteIndex;
- public PngChunkBKGD(ImageInfo info) {
+ public PngChunkBKGD(final ImageInfo info) {
super(ChunkHelper.bKGD, info);
}
@@ -46,11 +46,11 @@ public class PngChunkBKGD extends PngChunkSingle {
}
@Override
- public void parseFromRaw(ChunkRaw c) {
+ public void parseFromRaw(final ChunkRaw c) {
if (imgInfo.greyscale) {
gray = PngHelperInternal.readInt2fromBytes(c.data, 0);
} else if (imgInfo.indexed) {
- paletteIndex = (int) (c.data[0] & 0xff);
+ paletteIndex = c.data[0] & 0xff;
} else {
red = PngHelperInternal.readInt2fromBytes(c.data, 0);
green = PngHelperInternal.readInt2fromBytes(c.data, 2);
@@ -59,8 +59,8 @@ public class PngChunkBKGD extends PngChunkSingle {
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkBKGD otherx = (PngChunkBKGD) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkBKGD otherx = (PngChunkBKGD) other;
gray = otherx.gray;
red = otherx.red;
green = otherx.red;
@@ -73,7 +73,7 @@ public class PngChunkBKGD extends PngChunkSingle {
*
* @param gray
*/
- public void setGray(int gray) {
+ public void setGray(final int gray) {
if (!imgInfo.greyscale)
throw new PngjException("only gray images support this");
this.gray = gray;
@@ -89,7 +89,7 @@ public class PngChunkBKGD extends PngChunkSingle {
* Set pallette index
*
*/
- public void setPaletteIndex(int i) {
+ public void setPaletteIndex(final int i) {
if (!imgInfo.indexed)
throw new PngjException("only indexed (pallete) images support this");
this.paletteIndex = i;
@@ -105,7 +105,7 @@ public class PngChunkBKGD extends PngChunkSingle {
* Set rgb values
*
*/
- public void setRGB(int r, int g, int b) {
+ public void setRGB(final int r, final int g, final int b) {
if (imgInfo.greyscale || imgInfo.indexed)
throw new PngjException("only rgb or rgba images support this");
red = r;
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkCHRM.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkCHRM.java
index 25a4bf2d6..8bdd7b4c0 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkCHRM.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkCHRM.java
@@ -18,7 +18,7 @@ public class PngChunkCHRM extends PngChunkSingle {
private double greenx, greeny;
private double bluex, bluey;
- public PngChunkCHRM(ImageInfo info) {
+ public PngChunkCHRM(final ImageInfo info) {
super(ID, info);
}
@@ -43,7 +43,7 @@ public class PngChunkCHRM extends PngChunkSingle {
}
@Override
- public void parseFromRaw(ChunkRaw c) {
+ public void parseFromRaw(final ChunkRaw c) {
if (c.len != 32)
throw new PngjException("bad chunk " + c);
whitex = PngHelperInternal.intToDouble100000(PngHelperInternal.readInt4fromBytes(c.data, 0));
@@ -57,8 +57,8 @@ public class PngChunkCHRM extends PngChunkSingle {
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkCHRM otherx = (PngChunkCHRM) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkCHRM otherx = (PngChunkCHRM) other;
whitex = otherx.whitex;
whitey = otherx.whitex;
redx = otherx.redx;
@@ -69,8 +69,8 @@ public class PngChunkCHRM extends PngChunkSingle {
bluey = otherx.bluey;
}
- public void setChromaticities(double whitex, double whitey, double redx, double redy, double greenx, double greeny,
- double bluex, double bluey) {
+ public void setChromaticities(final double whitex, final double whitey, final double redx, final double redy, final double greenx, final double greeny,
+ final double bluex, final double bluey) {
this.whitex = whitex;
this.redx = redx;
this.greenx = greenx;
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkGAMA.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkGAMA.java
index 74640746e..6b627326c 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkGAMA.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkGAMA.java
@@ -15,7 +15,7 @@ public class PngChunkGAMA extends PngChunkSingle {
// http://www.w3.org/TR/PNG/#11gAMA
private double gamma;
- public PngChunkGAMA(ImageInfo info) {
+ public PngChunkGAMA(final ImageInfo info) {
super(ID, info);
}
@@ -26,22 +26,22 @@ public class PngChunkGAMA extends PngChunkSingle {
@Override
public ChunkRaw createRawChunk() {
- ChunkRaw c = createEmptyChunk(4, true);
- int g = (int) (gamma * 100000 + 0.5);
+ final ChunkRaw c = createEmptyChunk(4, true);
+ final int g = (int) (gamma * 100000 + 0.5);
PngHelperInternal.writeInt4tobytes(g, c.data, 0);
return c;
}
@Override
- public void parseFromRaw(ChunkRaw chunk) {
+ public void parseFromRaw(final ChunkRaw chunk) {
if (chunk.len != 4)
throw new PngjException("bad chunk " + chunk);
- int g = PngHelperInternal.readInt4fromBytes(chunk.data, 0);
- gamma = ((double) g) / 100000.0;
+ final int g = PngHelperInternal.readInt4fromBytes(chunk.data, 0);
+ gamma = (g) / 100000.0;
}
@Override
- public void cloneDataFromRead(PngChunk other) {
+ public void cloneDataFromRead(final PngChunk other) {
gamma = ((PngChunkGAMA) other).gamma;
}
@@ -49,7 +49,7 @@ public class PngChunkGAMA extends PngChunkSingle {
return gamma;
}
- public void setGamma(double gamma) {
+ public void setGamma(final double gamma) {
this.gamma = gamma;
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkHIST.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkHIST.java
index 6dc3fd9ec..4a4832d3b 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkHIST.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkHIST.java
@@ -15,7 +15,7 @@ public class PngChunkHIST extends PngChunkSingle {
private int[] hist = new int[0]; // should have same lenght as palette
- public PngChunkHIST(ImageInfo info) {
+ public PngChunkHIST(final ImageInfo info) {
super(ID, info);
}
@@ -25,10 +25,10 @@ public class PngChunkHIST extends PngChunkSingle {
}
@Override
- public void parseFromRaw(ChunkRaw c) {
+ public void parseFromRaw(final ChunkRaw c) {
if (!imgInfo.indexed)
throw new PngjException("only indexed images accept a HIST chunk");
- int nentries = c.data.length / 2;
+ final int nentries = c.data.length / 2;
hist = new int[nentries];
for (int i = 0; i < hist.length; i++) {
hist[i] = PngHelperInternal.readInt2fromBytes(c.data, i * 2);
@@ -48,8 +48,8 @@ public class PngChunkHIST extends PngChunkSingle {
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkHIST otherx = (PngChunkHIST) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkHIST otherx = (PngChunkHIST) other;
hist = new int[otherx.hist.length];
System.arraycopy(otherx.hist, 0, hist, 0, otherx.hist.length);
}
@@ -58,7 +58,7 @@ public class PngChunkHIST extends PngChunkSingle {
return hist;
}
- public void setHist(int[] hist) {
+ public void setHist(final int[] hist) {
this.hist = hist;
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkICCP.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkICCP.java
index 399577d72..17f69861c 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkICCP.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkICCP.java
@@ -16,7 +16,7 @@ public class PngChunkICCP extends PngChunkSingle {
private String profileName;
private byte[] compressedProfile; // copmression/decopmresion is done in getter/setter
- public PngChunkICCP(ImageInfo info) {
+ public PngChunkICCP(final ImageInfo info) {
super(ID, info);
}
@@ -27,7 +27,7 @@ public class PngChunkICCP extends PngChunkSingle {
@Override
public ChunkRaw createRawChunk() {
- ChunkRaw c = createEmptyChunk(profileName.length() + compressedProfile.length + 2, true);
+ final ChunkRaw c = createEmptyChunk(profileName.length() + compressedProfile.length + 2, true);
System.arraycopy(ChunkHelper.toBytes(profileName), 0, c.data, 0, profileName.length());
c.data[profileName.length()] = 0;
c.data[profileName.length() + 1] = 0;
@@ -36,20 +36,20 @@ public class PngChunkICCP extends PngChunkSingle {
}
@Override
- public void parseFromRaw(ChunkRaw chunk) {
- int pos0 = ChunkHelper.posNullByte(chunk.data);
+ public void parseFromRaw(final ChunkRaw chunk) {
+ final int pos0 = ChunkHelper.posNullByte(chunk.data);
profileName = new String(chunk.data, 0, pos0, PngHelperInternal.charsetLatin1);
- int comp = (chunk.data[pos0 + 1] & 0xff);
+ final int comp = (chunk.data[pos0 + 1] & 0xff);
if (comp != 0)
throw new PngjException("bad compression for ChunkTypeICCP");
- int compdatasize = chunk.data.length - (pos0 + 2);
+ final int compdatasize = chunk.data.length - (pos0 + 2);
compressedProfile = new byte[compdatasize];
System.arraycopy(chunk.data, pos0 + 2, compressedProfile, 0, compdatasize);
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkICCP otherx = (PngChunkICCP) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkICCP otherx = (PngChunkICCP) other;
profileName = otherx.profileName;
compressedProfile = new byte[otherx.compressedProfile.length];
System.arraycopy(otherx.compressedProfile, 0, compressedProfile, 0, otherx.compressedProfile.length); // deep
@@ -59,12 +59,12 @@ public class PngChunkICCP extends PngChunkSingle {
/**
* The profile should be uncompressed bytes
*/
- public void setProfileNameAndContent(String name, byte[] profile) {
+ public void setProfileNameAndContent(final String name, final byte[] profile) {
profileName = name;
compressedProfile = ChunkHelper.compressBytes(profile, true);
}
- public void setProfileNameAndContent(String name, String profile) {
+ public void setProfileNameAndContent(final String name, final String profile) {
setProfileNameAndContent(name, profile.getBytes(PngHelperInternal.charsetLatin1));
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIDAT.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIDAT.java
index 911513c0d..f7bee4b11 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIDAT.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIDAT.java
@@ -14,7 +14,7 @@ public class PngChunkIDAT extends PngChunkMultiple {
public final static String ID = ChunkHelper.IDAT;
// http://www.w3.org/TR/PNG/#11IDAT
- public PngChunkIDAT(ImageInfo i, int len, long offset) {
+ public PngChunkIDAT(final ImageInfo i, final int len, final long offset) {
super(ID, i);
this.length = len;
this.offset = offset;
@@ -31,10 +31,10 @@ public class PngChunkIDAT extends PngChunkMultiple {
}
@Override
- public void parseFromRaw(ChunkRaw c) { // does nothing
+ public void parseFromRaw(final ChunkRaw c) { // does nothing
}
@Override
- public void cloneDataFromRead(PngChunk other) {
+ public void cloneDataFromRead(final PngChunk other) {
}
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIEND.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIEND.java
index fbec564d8..3f6e47b09 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIEND.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIEND.java
@@ -12,7 +12,7 @@ public class PngChunkIEND extends PngChunkSingle {
// http://www.w3.org/TR/PNG/#11IEND
// this is a dummy placeholder
- public PngChunkIEND(ImageInfo info) {
+ public PngChunkIEND(final ImageInfo info) {
super(ID, info);
}
@@ -23,16 +23,16 @@ public class PngChunkIEND extends PngChunkSingle {
@Override
public ChunkRaw createRawChunk() {
- ChunkRaw c = new ChunkRaw(0, ChunkHelper.b_IEND, false);
+ final ChunkRaw c = new ChunkRaw(0, ChunkHelper.b_IEND, false);
return c;
}
@Override
- public void parseFromRaw(ChunkRaw c) {
+ public void parseFromRaw(final ChunkRaw c) {
// this is not used
}
@Override
- public void cloneDataFromRead(PngChunk other) {
+ public void cloneDataFromRead(final PngChunk other) {
}
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIHDR.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIHDR.java
index 94bfedd38..71e0ec90e 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIHDR.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIHDR.java
@@ -27,7 +27,7 @@ public class PngChunkIHDR extends PngChunkSingle {
// http://www.w3.org/TR/PNG/#11IHDR
//
- public PngChunkIHDR(ImageInfo info) {
+ public PngChunkIHDR(final ImageInfo info) {
super(ID, info);
}
@@ -38,7 +38,7 @@ public class PngChunkIHDR extends PngChunkSingle {
@Override
public ChunkRaw createRawChunk() {
- ChunkRaw c = new ChunkRaw(13, ChunkHelper.b_IHDR, true);
+ final ChunkRaw c = new ChunkRaw(13, ChunkHelper.b_IHDR, true);
int offset = 0;
PngHelperInternal.writeInt4tobytes(cols, c.data, offset);
offset += 4;
@@ -53,10 +53,10 @@ public class PngChunkIHDR extends PngChunkSingle {
}
@Override
- public void parseFromRaw(ChunkRaw c) {
+ public void parseFromRaw(final ChunkRaw c) {
if (c.len != 13)
throw new PngjException("Bad IDHR len " + c.len);
- ByteArrayInputStream st = c.getAsByteStream();
+ final ByteArrayInputStream st = c.getAsByteStream();
cols = PngHelperInternal.readInt4(st);
rows = PngHelperInternal.readInt4(st);
// bit depth: number of bits per channel
@@ -68,8 +68,8 @@ public class PngChunkIHDR extends PngChunkSingle {
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkIHDR otherx = (PngChunkIHDR) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkIHDR otherx = (PngChunkIHDR) other;
cols = otherx.cols;
rows = otherx.rows;
bitspc = otherx.bitspc;
@@ -83,7 +83,7 @@ public class PngChunkIHDR extends PngChunkSingle {
return cols;
}
- public void setCols(int cols) {
+ public void setCols(final int cols) {
this.cols = cols;
}
@@ -91,7 +91,7 @@ public class PngChunkIHDR extends PngChunkSingle {
return rows;
}
- public void setRows(int rows) {
+ public void setRows(final int rows) {
this.rows = rows;
}
@@ -99,7 +99,7 @@ public class PngChunkIHDR extends PngChunkSingle {
return bitspc;
}
- public void setBitspc(int bitspc) {
+ public void setBitspc(final int bitspc) {
this.bitspc = bitspc;
}
@@ -107,7 +107,7 @@ public class PngChunkIHDR extends PngChunkSingle {
return colormodel;
}
- public void setColormodel(int colormodel) {
+ public void setColormodel(final int colormodel) {
this.colormodel = colormodel;
}
@@ -115,7 +115,7 @@ public class PngChunkIHDR extends PngChunkSingle {
return compmeth;
}
- public void setCompmeth(int compmeth) {
+ public void setCompmeth(final int compmeth) {
this.compmeth = compmeth;
}
@@ -123,7 +123,7 @@ public class PngChunkIHDR extends PngChunkSingle {
return filmeth;
}
- public void setFilmeth(int filmeth) {
+ public void setFilmeth(final int filmeth) {
this.filmeth = filmeth;
}
@@ -131,7 +131,7 @@ public class PngChunkIHDR extends PngChunkSingle {
return interlaced;
}
- public void setInterlaced(int interlaced) {
+ public void setInterlaced(final int interlaced) {
this.interlaced = interlaced;
}
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkITXT.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkITXT.java
index ab52d7c90..738f92471 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkITXT.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkITXT.java
@@ -21,7 +21,7 @@ public class PngChunkITXT extends PngChunkTextVar {
private String translatedTag = "";
// http://www.w3.org/TR/PNG/#11iTXt
- public PngChunkITXT(ImageInfo info) {
+ public PngChunkITXT(final ImageInfo info) {
super(ID, info);
}
@@ -30,7 +30,7 @@ public class PngChunkITXT extends PngChunkTextVar {
if (key.isEmpty())
throw new PngjException("Text chunk key must be non empty");
try {
- ByteArrayOutputStream ba = new ByteArrayOutputStream();
+ final ByteArrayOutputStream ba = new ByteArrayOutputStream();
ba.write(ChunkHelper.toBytes(key));
ba.write(0); // separator
ba.write(compressed ? 1 : 0);
@@ -44,19 +44,19 @@ public class PngChunkITXT extends PngChunkTextVar {
textbytes = ChunkHelper.compressBytes(textbytes, true);
}
ba.write(textbytes);
- byte[] b = ba.toByteArray();
- ChunkRaw chunk = createEmptyChunk(b.length, false);
+ final byte[] b = ba.toByteArray();
+ final ChunkRaw chunk = createEmptyChunk(b.length, false);
chunk.data = b;
return chunk;
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new PngjException(e);
}
}
@Override
- public void parseFromRaw(ChunkRaw c) {
+ public void parseFromRaw(final ChunkRaw c) {
int nullsFound = 0;
- int[] nullsIdx = new int[3];
+ final int[] nullsIdx = new int[3];
for (int i = 0; i < c.data.length; i++) {
if (c.data[i] != 0)
continue;
@@ -80,7 +80,7 @@ public class PngChunkITXT extends PngChunkTextVar {
PngHelperInternal.charsetUTF8);
i = nullsIdx[2] + 1;
if (compressed) {
- byte[] bytes = ChunkHelper.compressBytes(c.data, i, c.data.length - i, false);
+ final byte[] bytes = ChunkHelper.compressBytes(c.data, i, c.data.length - i, false);
val = ChunkHelper.toStringUTF8(bytes);
} else {
val = ChunkHelper.toStringUTF8(c.data, i, c.data.length - i);
@@ -88,8 +88,8 @@ public class PngChunkITXT extends PngChunkTextVar {
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkITXT otherx = (PngChunkITXT) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkITXT otherx = (PngChunkITXT) other;
key = otherx.key;
val = otherx.val;
compressed = otherx.compressed;
@@ -101,7 +101,7 @@ public class PngChunkITXT extends PngChunkTextVar {
return compressed;
}
- public void setCompressed(boolean compressed) {
+ public void setCompressed(final boolean compressed) {
this.compressed = compressed;
}
@@ -109,7 +109,7 @@ public class PngChunkITXT extends PngChunkTextVar {
return langTag;
}
- public void setLangtag(String langtag) {
+ public void setLangtag(final String langtag) {
this.langTag = langtag;
}
@@ -117,7 +117,7 @@ public class PngChunkITXT extends PngChunkTextVar {
return translatedTag;
}
- public void setTranslatedTag(String translatedTag) {
+ public void setTranslatedTag(final String translatedTag) {
this.translatedTag = translatedTag;
}
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkMultiple.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkMultiple.java
index 057f6c25e..5a7bee98c 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkMultiple.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkMultiple.java
@@ -7,7 +7,7 @@ import jogamp.opengl.util.pngj.ImageInfo;
*/
public abstract class PngChunkMultiple extends PngChunk {
- protected PngChunkMultiple(String id, ImageInfo imgInfo) {
+ protected PngChunkMultiple(final String id, final ImageInfo imgInfo) {
super(id, imgInfo);
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkOFFS.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkOFFS.java
index a3bab4995..2217a59b4 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkOFFS.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkOFFS.java
@@ -17,7 +17,7 @@ public class PngChunkOFFS extends PngChunkSingle {
private long posY;
private int units; // 0: pixel 1:micrometer
- public PngChunkOFFS(ImageInfo info) {
+ public PngChunkOFFS(final ImageInfo info) {
super(ID, info);
}
@@ -28,7 +28,7 @@ public class PngChunkOFFS extends PngChunkSingle {
@Override
public ChunkRaw createRawChunk() {
- ChunkRaw c = createEmptyChunk(9, true);
+ final ChunkRaw c = createEmptyChunk(9, true);
PngHelperInternal.writeInt4tobytes((int) posX, c.data, 0);
PngHelperInternal.writeInt4tobytes((int) posY, c.data, 4);
c.data[8] = (byte) units;
@@ -36,7 +36,7 @@ public class PngChunkOFFS extends PngChunkSingle {
}
@Override
- public void parseFromRaw(ChunkRaw chunk) {
+ public void parseFromRaw(final ChunkRaw chunk) {
if (chunk.len != 9)
throw new PngjException("bad chunk length " + chunk);
posX = PngHelperInternal.readInt4fromBytes(chunk.data, 0);
@@ -49,8 +49,8 @@ public class PngChunkOFFS extends PngChunkSingle {
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkOFFS otherx = (PngChunkOFFS) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkOFFS otherx = (PngChunkOFFS) other;
this.posX = otherx.posX;
this.posY = otherx.posY;
this.units = otherx.units;
@@ -66,7 +66,7 @@ public class PngChunkOFFS extends PngChunkSingle {
/**
* 0: pixel, 1:micrometer
*/
- public void setUnits(int units) {
+ public void setUnits(final int units) {
this.units = units;
}
@@ -74,7 +74,7 @@ public class PngChunkOFFS extends PngChunkSingle {
return posX;
}
- public void setPosX(long posX) {
+ public void setPosX(final long posX) {
this.posX = posX;
}
@@ -82,7 +82,7 @@ public class PngChunkOFFS extends PngChunkSingle {
return posY;
}
- public void setPosY(long posY) {
+ public void setPosY(final long posY) {
this.posY = posY;
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkPHYS.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkPHYS.java
index b0a1bb898..fc647273e 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkPHYS.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkPHYS.java
@@ -16,7 +16,7 @@ public class PngChunkPHYS extends PngChunkSingle {
private long pixelsxUnitY;
private int units; // 0: unknown 1:metre
- public PngChunkPHYS(ImageInfo info) {
+ public PngChunkPHYS(final ImageInfo info) {
super(ID, info);
}
@@ -27,7 +27,7 @@ public class PngChunkPHYS extends PngChunkSingle {
@Override
public ChunkRaw createRawChunk() {
- ChunkRaw c = createEmptyChunk(9, true);
+ final ChunkRaw c = createEmptyChunk(9, true);
PngHelperInternal.writeInt4tobytes((int) pixelsxUnitX, c.data, 0);
PngHelperInternal.writeInt4tobytes((int) pixelsxUnitY, c.data, 4);
c.data[8] = (byte) units;
@@ -35,7 +35,7 @@ public class PngChunkPHYS extends PngChunkSingle {
}
@Override
- public void parseFromRaw(ChunkRaw chunk) {
+ public void parseFromRaw(final ChunkRaw chunk) {
if (chunk.len != 9)
throw new PngjException("bad chunk length " + chunk);
pixelsxUnitX = PngHelperInternal.readInt4fromBytes(chunk.data, 0);
@@ -48,8 +48,8 @@ public class PngChunkPHYS extends PngChunkSingle {
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkPHYS otherx = (PngChunkPHYS) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkPHYS otherx = (PngChunkPHYS) other;
this.pixelsxUnitX = otherx.pixelsxUnitX;
this.pixelsxUnitY = otherx.pixelsxUnitY;
this.units = otherx.units;
@@ -59,7 +59,7 @@ public class PngChunkPHYS extends PngChunkSingle {
return pixelsxUnitX;
}
- public void setPixelsxUnitX(long pixelsxUnitX) {
+ public void setPixelsxUnitX(final long pixelsxUnitX) {
this.pixelsxUnitX = pixelsxUnitX;
}
@@ -67,7 +67,7 @@ public class PngChunkPHYS extends PngChunkSingle {
return pixelsxUnitY;
}
- public void setPixelsxUnitY(long pixelsxUnitY) {
+ public void setPixelsxUnitY(final long pixelsxUnitY) {
this.pixelsxUnitY = pixelsxUnitY;
}
@@ -75,7 +75,7 @@ public class PngChunkPHYS extends PngChunkSingle {
return units;
}
- public void setUnits(int units) {
+ public void setUnits(final int units) {
this.units = units;
}
@@ -87,7 +87,7 @@ public class PngChunkPHYS extends PngChunkSingle {
public double getAsDpi() {
if (units != 1 || pixelsxUnitX != pixelsxUnitY)
return -1;
- return ((double) pixelsxUnitX) * 0.0254;
+ return (pixelsxUnitX) * 0.0254;
}
/**
@@ -96,16 +96,16 @@ public class PngChunkPHYS extends PngChunkSingle {
public double[] getAsDpi2() {
if (units != 1)
return new double[] { -1, -1 };
- return new double[] { ((double) pixelsxUnitX) * 0.0254, ((double) pixelsxUnitY) * 0.0254 };
+ return new double[] { (pixelsxUnitX) * 0.0254, (pixelsxUnitY) * 0.0254 };
}
- public void setAsDpi(double dpi) {
+ public void setAsDpi(final double dpi) {
units = 1;
pixelsxUnitX = (long) (dpi / 0.0254 + 0.5);
pixelsxUnitY = pixelsxUnitX;
}
- public void setAsDpi2(double dpix, double dpiy) {
+ public void setAsDpi2(final double dpix, final double dpiy) {
units = 1;
pixelsxUnitX = (long) (dpix / 0.0254 + 0.5);
pixelsxUnitY = (long) (dpiy / 0.0254 + 0.5);
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkPLTE.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkPLTE.java
index dbf5e53c0..0f135d1ed 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkPLTE.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkPLTE.java
@@ -20,7 +20,7 @@ public class PngChunkPLTE extends PngChunkSingle {
*/
private int[] entries;
- public PngChunkPLTE(ImageInfo info) {
+ public PngChunkPLTE(final ImageInfo info) {
super(ID, info);
}
@@ -31,9 +31,9 @@ public class PngChunkPLTE extends PngChunkSingle {
@Override
public ChunkRaw createRawChunk() {
- int len = 3 * nentries;
- int[] rgb = new int[3];
- ChunkRaw c = createEmptyChunk(len, true);
+ final int len = 3 * nentries;
+ final int[] rgb = new int[3];
+ final ChunkRaw c = createEmptyChunk(len, true);
for (int n = 0, i = 0; n < nentries; n++) {
getEntryRgb(n, rgb);
c.data[i++] = (byte) rgb[0];
@@ -44,21 +44,21 @@ public class PngChunkPLTE extends PngChunkSingle {
}
@Override
- public void parseFromRaw(ChunkRaw chunk) {
+ public void parseFromRaw(final ChunkRaw chunk) {
setNentries(chunk.len / 3);
for (int n = 0, i = 0; n < nentries; n++) {
- setEntry(n, (int) (chunk.data[i++] & 0xff), (int) (chunk.data[i++] & 0xff), (int) (chunk.data[i++] & 0xff));
+ setEntry(n, chunk.data[i++] & 0xff, chunk.data[i++] & 0xff, chunk.data[i++] & 0xff);
}
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkPLTE otherx = (PngChunkPLTE) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkPLTE otherx = (PngChunkPLTE) other;
this.setNentries(otherx.getNentries());
System.arraycopy(otherx.entries, 0, entries, 0, nentries);
}
- public void setNentries(int n) {
+ public void setNentries(final int n) {
nentries = n;
if (nentries < 1 || nentries > 256)
throw new PngjException("invalid pallette - nentries=" + nentries);
@@ -71,20 +71,20 @@ public class PngChunkPLTE extends PngChunkSingle {
return nentries;
}
- public void setEntry(int n, int r, int g, int b) {
+ public void setEntry(final int n, final int r, final int g, final int b) {
entries[n] = ((r << 16) | (g << 8) | b);
}
- public int getEntry(int n) {
+ public int getEntry(final int n) {
return entries[n];
}
- public void getEntryRgb(int n, int[] rgb) {
+ public void getEntryRgb(final int n, final int[] rgb) {
getEntryRgb(n, rgb, 0);
}
- public void getEntryRgb(int n, int[] rgb, int offset) {
- int v = entries[n];
+ public void getEntryRgb(final int n, final int[] rgb, final int offset) {
+ final int v = entries[n];
rgb[offset + 0] = ((v & 0xff0000) >> 16);
rgb[offset + 1] = ((v & 0xff00) >> 8);
rgb[offset + 2] = (v & 0xff);
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSBIT.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSBIT.java
index 3a490654a..53858da83 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSBIT.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSBIT.java
@@ -19,7 +19,7 @@ public class PngChunkSBIT extends PngChunkSingle {
private int graysb, alphasb;
private int redsb, greensb, bluesb;
- public PngChunkSBIT(ImageInfo info) {
+ public PngChunkSBIT(final ImageInfo info) {
super(ID, info);
}
@@ -36,7 +36,7 @@ public class PngChunkSBIT extends PngChunkSingle {
}
@Override
- public void parseFromRaw(ChunkRaw c) {
+ public void parseFromRaw(final ChunkRaw c) {
if (c.len != getLen())
throw new PngjException("bad chunk length " + c);
if (imgInfo.greyscale) {
@@ -71,8 +71,8 @@ public class PngChunkSBIT extends PngChunkSingle {
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkSBIT otherx = (PngChunkSBIT) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkSBIT otherx = (PngChunkSBIT) other;
graysb = otherx.graysb;
redsb = otherx.redsb;
greensb = otherx.greensb;
@@ -80,7 +80,7 @@ public class PngChunkSBIT extends PngChunkSingle {
alphasb = otherx.alphasb;
}
- public void setGraysb(int gray) {
+ public void setGraysb(final int gray) {
if (!imgInfo.greyscale)
throw new PngjException("only greyscale images support this");
graysb = gray;
@@ -92,7 +92,7 @@ public class PngChunkSBIT extends PngChunkSingle {
return graysb;
}
- public void setAlphasb(int a) {
+ public void setAlphasb(final int a) {
if (!imgInfo.alpha)
throw new PngjException("only images with alpha support this");
alphasb = a;
@@ -108,7 +108,7 @@ public class PngChunkSBIT extends PngChunkSingle {
* Set rgb values
*
*/
- public void setRGB(int r, int g, int b) {
+ public void setRGB(final int r, final int g, final int b) {
if (imgInfo.greyscale || imgInfo.indexed)
throw new PngjException("only rgb or rgba images support this");
redsb = r;
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSPLT.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSPLT.java
index 2ff65834d..44ff249ac 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSPLT.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSPLT.java
@@ -21,7 +21,7 @@ public class PngChunkSPLT extends PngChunkMultiple {
private int sampledepth; // 8/16
private int[] palette; // 5 elements per entry
- public PngChunkSPLT(ImageInfo info) {
+ public PngChunkSPLT(final ImageInfo info) {
super(ID, info);
}
@@ -33,11 +33,11 @@ public class PngChunkSPLT extends PngChunkMultiple {
@Override
public ChunkRaw createRawChunk() {
try {
- ByteArrayOutputStream ba = new ByteArrayOutputStream();
+ final ByteArrayOutputStream ba = new ByteArrayOutputStream();
ba.write(palName.getBytes(PngHelperInternal.charsetLatin1));
ba.write(0); // separator
ba.write((byte) sampledepth);
- int nentries = getNentries();
+ final int nentries = getNentries();
for (int n = 0; n < nentries; n++) {
for (int i = 0; i < 4; i++) {
if (sampledepth == 8)
@@ -47,17 +47,17 @@ public class PngChunkSPLT extends PngChunkMultiple {
}
PngHelperInternal.writeInt2(ba, palette[n * 5 + 4]);
}
- byte[] b = ba.toByteArray();
- ChunkRaw chunk = createEmptyChunk(b.length, false);
+ final byte[] b = ba.toByteArray();
+ final ChunkRaw chunk = createEmptyChunk(b.length, false);
chunk.data = b;
return chunk;
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new PngjException(e);
}
}
@Override
- public void parseFromRaw(ChunkRaw c) {
+ public void parseFromRaw(final ChunkRaw c) {
int t = -1;
for (int i = 0; i < c.data.length; i++) { // look for first zero
if (c.data[i] == 0) {
@@ -70,7 +70,7 @@ public class PngChunkSPLT extends PngChunkMultiple {
palName = new String(c.data, 0, t, PngHelperInternal.charsetLatin1);
sampledepth = PngHelperInternal.readInt1fromByte(c.data, t + 1);
t += 2;
- int nentries = (c.data.length - t) / (sampledepth == 8 ? 6 : 10);
+ final int nentries = (c.data.length - t) / (sampledepth == 8 ? 6 : 10);
palette = new int[nentries * 5];
int r, g, b, a, f, ne;
ne = 0;
@@ -101,8 +101,8 @@ public class PngChunkSPLT extends PngChunkMultiple {
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkSPLT otherx = (PngChunkSPLT) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkSPLT otherx = (PngChunkSPLT) other;
palName = otherx.palName;
sampledepth = otherx.sampledepth;
palette = new int[otherx.palette.length];
@@ -117,7 +117,7 @@ public class PngChunkSPLT extends PngChunkMultiple {
return palName;
}
- public void setPalName(String palName) {
+ public void setPalName(final String palName) {
this.palName = palName;
}
@@ -125,7 +125,7 @@ public class PngChunkSPLT extends PngChunkMultiple {
return sampledepth;
}
- public void setSampledepth(int sampledepth) {
+ public void setSampledepth(final int sampledepth) {
this.sampledepth = sampledepth;
}
@@ -133,7 +133,7 @@ public class PngChunkSPLT extends PngChunkMultiple {
return palette;
}
- public void setPalette(int[] palette) {
+ public void setPalette(final int[] palette) {
this.palette = palette;
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSRGB.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSRGB.java
index e4d77d40a..19504b917 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSRGB.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSRGB.java
@@ -21,7 +21,7 @@ public class PngChunkSRGB extends PngChunkSingle {
private int intent;
- public PngChunkSRGB(ImageInfo info) {
+ public PngChunkSRGB(final ImageInfo info) {
super(ID, info);
}
@@ -31,7 +31,7 @@ public class PngChunkSRGB extends PngChunkSingle {
}
@Override
- public void parseFromRaw(ChunkRaw c) {
+ public void parseFromRaw(final ChunkRaw c) {
if (c.len != 1)
throw new PngjException("bad chunk length " + c);
intent = PngHelperInternal.readInt1fromByte(c.data, 0);
@@ -46,8 +46,8 @@ public class PngChunkSRGB extends PngChunkSingle {
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkSRGB otherx = (PngChunkSRGB) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkSRGB otherx = (PngChunkSRGB) other;
intent = otherx.intent;
}
@@ -55,7 +55,7 @@ public class PngChunkSRGB extends PngChunkSingle {
return intent;
}
- public void setIntent(int intent) {
+ public void setIntent(final int intent) {
this.intent = intent;
}
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSTER.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSTER.java
index 4dc5edec5..52037b396 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSTER.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSTER.java
@@ -14,7 +14,7 @@ public class PngChunkSTER extends PngChunkSingle {
// http://www.libpng.org/pub/png/spec/register/pngext-1.3.0-pdg.html#C.sTER
private byte mode; // 0: cross-fuse layout 1: diverging-fuse layout
- public PngChunkSTER(ImageInfo info) {
+ public PngChunkSTER(final ImageInfo info) {
super(ID, info);
}
@@ -25,21 +25,21 @@ public class PngChunkSTER extends PngChunkSingle {
@Override
public ChunkRaw createRawChunk() {
- ChunkRaw c = createEmptyChunk(1, true);
- c.data[0] = (byte) mode;
+ final ChunkRaw c = createEmptyChunk(1, true);
+ c.data[0] = mode;
return c;
}
@Override
- public void parseFromRaw(ChunkRaw chunk) {
+ public void parseFromRaw(final ChunkRaw chunk) {
if (chunk.len != 1)
throw new PngjException("bad chunk length " + chunk);
mode = chunk.data[0];
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkSTER otherx = (PngChunkSTER) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkSTER otherx = (PngChunkSTER) other;
this.mode = otherx.mode;
}
@@ -53,7 +53,7 @@ public class PngChunkSTER extends PngChunkSingle {
/**
* 0: cross-fuse layout 1: diverging-fuse layout
*/
- public void setMode(byte mode) {
+ public void setMode(final byte mode) {
this.mode = mode;
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSingle.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSingle.java
index 7df5ba021..c5e9407b1 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSingle.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSingle.java
@@ -8,7 +8,7 @@ import jogamp.opengl.util.pngj.ImageInfo;
*/
public abstract class PngChunkSingle extends PngChunk {
- protected PngChunkSingle(String id, ImageInfo imgInfo) {
+ protected PngChunkSingle(final String id, final ImageInfo imgInfo) {
super(id, imgInfo);
}
@@ -26,14 +26,14 @@ public abstract class PngChunkSingle extends PngChunk {
}
@Override
- public boolean equals(Object obj) {
+ public boolean equals(final Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
- PngChunkSingle other = (PngChunkSingle) obj;
+ final PngChunkSingle other = (PngChunkSingle) obj;
if (id == null) {
if (other.id != null)
return false;
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSkipped.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSkipped.java
index f4c77b4e1..02a18816b 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSkipped.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSkipped.java
@@ -8,7 +8,7 @@ import jogamp.opengl.util.pngj.PngjException;
*/
public class PngChunkSkipped extends PngChunk {
- public PngChunkSkipped(String id, ImageInfo info, int clen) {
+ public PngChunkSkipped(final String id, final ImageInfo info, final int clen) {
super(id, info);
this.length = clen;
}
@@ -24,12 +24,12 @@ public class PngChunkSkipped extends PngChunk {
}
@Override
- public void parseFromRaw(ChunkRaw c) {
+ public void parseFromRaw(final ChunkRaw c) {
throw new PngjException("Non supported for a skipped chunk");
}
@Override
- public void cloneDataFromRead(PngChunk other) {
+ public void cloneDataFromRead(final PngChunk other) {
throw new PngjException("Non supported for a skipped chunk");
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTEXT.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTEXT.java
index d97cd63c5..634d0cd12 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTEXT.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTEXT.java
@@ -12,7 +12,7 @@ import jogamp.opengl.util.pngj.PngjException;
public class PngChunkTEXT extends PngChunkTextVar {
public final static String ID = ChunkHelper.tEXt;
- public PngChunkTEXT(ImageInfo info) {
+ public PngChunkTEXT(final ImageInfo info) {
super(ID, info);
}
@@ -20,14 +20,14 @@ public class PngChunkTEXT extends PngChunkTextVar {
public ChunkRaw createRawChunk() {
if (key.isEmpty())
throw new PngjException("Text chunk key must be non empty");
- byte[] b = (key + "\0" + val).getBytes(PngHelperInternal.charsetLatin1);
- ChunkRaw chunk = createEmptyChunk(b.length, false);
+ final byte[] b = (key + "\0" + val).getBytes(PngHelperInternal.charsetLatin1);
+ final ChunkRaw chunk = createEmptyChunk(b.length, false);
chunk.data = b;
return chunk;
}
@Override
- public void parseFromRaw(ChunkRaw c) {
+ public void parseFromRaw(final ChunkRaw c) {
int i;
for (i = 0; i < c.data.length; i++)
if (c.data[i] == 0)
@@ -38,8 +38,8 @@ public class PngChunkTEXT extends PngChunkTextVar {
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkTEXT otherx = (PngChunkTEXT) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkTEXT otherx = (PngChunkTEXT) other;
key = otherx.key;
val = otherx.val;
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTIME.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTIME.java
index 8f34c78fe..850fb649f 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTIME.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTIME.java
@@ -17,7 +17,7 @@ public class PngChunkTIME extends PngChunkSingle {
// http://www.w3.org/TR/PNG/#11tIME
private int year, mon, day, hour, min, sec;
- public PngChunkTIME(ImageInfo info) {
+ public PngChunkTIME(final ImageInfo info) {
super(ID, info);
}
@@ -28,7 +28,7 @@ public class PngChunkTIME extends PngChunkSingle {
@Override
public ChunkRaw createRawChunk() {
- ChunkRaw c = createEmptyChunk(7, true);
+ final ChunkRaw c = createEmptyChunk(7, true);
PngHelperInternal.writeInt2tobytes(year, c.data, 0);
c.data[2] = (byte) mon;
c.data[3] = (byte) day;
@@ -39,7 +39,7 @@ public class PngChunkTIME extends PngChunkSingle {
}
@Override
- public void parseFromRaw(ChunkRaw chunk) {
+ public void parseFromRaw(final ChunkRaw chunk) {
if (chunk.len != 7)
throw new PngjException("bad chunk " + chunk);
year = PngHelperInternal.readInt2fromBytes(chunk.data, 0);
@@ -51,8 +51,8 @@ public class PngChunkTIME extends PngChunkSingle {
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkTIME x = (PngChunkTIME) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkTIME x = (PngChunkTIME) other;
year = x.year;
mon = x.mon;
day = x.day;
@@ -61,8 +61,8 @@ public class PngChunkTIME extends PngChunkSingle {
sec = x.sec;
}
- public void setNow(int secsAgo) {
- Calendar d = Calendar.getInstance();
+ public void setNow(final int secsAgo) {
+ final Calendar d = Calendar.getInstance();
d.setTimeInMillis(System.currentTimeMillis() - 1000 * (long) secsAgo);
year = d.get(Calendar.YEAR);
mon = d.get(Calendar.MONTH) + 1;
@@ -72,7 +72,7 @@ public class PngChunkTIME extends PngChunkSingle {
sec = d.get(Calendar.SECOND);
}
- public void setYMDHMS(int yearx, int monx, int dayx, int hourx, int minx, int secx) {
+ public void setYMDHMS(final int yearx, final int monx, final int dayx, final int hourx, final int minx, final int secx) {
year = yearx;
mon = monx;
day = dayx;
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTRNS.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTRNS.java
index 867e34861..5e10c041b 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTRNS.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTRNS.java
@@ -21,7 +21,7 @@ public class PngChunkTRNS extends PngChunkSingle {
private int red, green, blue;
private int[] paletteAlpha = new int[] {};
- public PngChunkTRNS(ImageInfo info) {
+ public PngChunkTRNS(final ImageInfo info) {
super(ID, info);
}
@@ -51,14 +51,14 @@ public class PngChunkTRNS extends PngChunkSingle {
}
@Override
- public void parseFromRaw(ChunkRaw c) {
+ public void parseFromRaw(final ChunkRaw c) {
if (imgInfo.greyscale) {
gray = PngHelperInternal.readInt2fromBytes(c.data, 0);
} else if (imgInfo.indexed) {
- int nentries = c.data.length;
+ final int nentries = c.data.length;
paletteAlpha = new int[nentries];
for (int n = 0; n < nentries; n++) {
- paletteAlpha[n] = (int) (c.data[n] & 0xff);
+ paletteAlpha[n] = c.data[n] & 0xff;
}
} else {
red = PngHelperInternal.readInt2fromBytes(c.data, 0);
@@ -68,8 +68,8 @@ public class PngChunkTRNS extends PngChunkSingle {
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkTRNS otherx = (PngChunkTRNS) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkTRNS otherx = (PngChunkTRNS) other;
gray = otherx.gray;
red = otherx.red;
green = otherx.green;
@@ -84,7 +84,7 @@ public class PngChunkTRNS extends PngChunkSingle {
* Set rgb values
*
*/
- public void setRGB(int r, int g, int b) {
+ public void setRGB(final int r, final int g, final int b) {
if (imgInfo.greyscale || imgInfo.indexed)
throw new PngjException("only rgb or rgba images support this");
red = r;
@@ -98,7 +98,7 @@ public class PngChunkTRNS extends PngChunkSingle {
return new int[] { red, green, blue };
}
- public void setGray(int g) {
+ public void setGray(final int g) {
if (!imgInfo.greyscale)
throw new PngjException("only grayscale images support this");
gray = g;
@@ -113,7 +113,7 @@ public class PngChunkTRNS extends PngChunkSingle {
/**
* WARNING: non deep copy
*/
- public void setPalletteAlpha(int[] palAlpha) {
+ public void setPalletteAlpha(final int[] palAlpha) {
if (!imgInfo.indexed)
throw new PngjException("only indexed images support this");
paletteAlpha = palAlpha;
@@ -122,7 +122,7 @@ public class PngChunkTRNS extends PngChunkSingle {
/**
* to use when only one pallete index is set as totally transparent
*/
- public void setIndexEntryAsTransparent(int palAlphaIndex) {
+ public void setIndexEntryAsTransparent(final int palAlphaIndex) {
if (!imgInfo.indexed)
throw new PngjException("only indexed images support this");
paletteAlpha = new int[] { palAlphaIndex + 1 };
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTextVar.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTextVar.java
index ba3ffc30c..d00c29971 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTextVar.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTextVar.java
@@ -21,7 +21,7 @@ public abstract class PngChunkTextVar extends PngChunkMultiple {
public final static String KEY_Source = "Source"; // Device used to create the image
public final static String KEY_Comment = "Comment"; // Miscellaneous comment
- protected PngChunkTextVar(String id, ImageInfo info) {
+ protected PngChunkTextVar(final String id, final ImageInfo info) {
super(id, info);
}
@@ -51,7 +51,7 @@ public abstract class PngChunkTextVar extends PngChunkMultiple {
return val;
}
- public void setKeyVal(String key, String val) {
+ public void setKeyVal(final String key, final String val) {
this.key = key;
this.val = val;
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkUNKNOWN.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkUNKNOWN.java
index 3803428e6..693729e9b 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkUNKNOWN.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkUNKNOWN.java
@@ -11,11 +11,11 @@ public class PngChunkUNKNOWN extends PngChunkMultiple { // unkown, custom or not
private byte[] data;
- public PngChunkUNKNOWN(String id, ImageInfo info) {
+ public PngChunkUNKNOWN(final String id, final ImageInfo info) {
super(id, info);
}
- private PngChunkUNKNOWN(PngChunkUNKNOWN c, ImageInfo info) {
+ private PngChunkUNKNOWN(final PngChunkUNKNOWN c, final ImageInfo info) {
super(c.id, info);
System.arraycopy(c.data, 0, data, 0, c.data.length);
}
@@ -27,13 +27,13 @@ public class PngChunkUNKNOWN extends PngChunkMultiple { // unkown, custom or not
@Override
public ChunkRaw createRawChunk() {
- ChunkRaw p = createEmptyChunk(data.length, false);
+ final ChunkRaw p = createEmptyChunk(data.length, false);
p.data = this.data;
return p;
}
@Override
- public void parseFromRaw(ChunkRaw c) {
+ public void parseFromRaw(final ChunkRaw c) {
data = c.data;
}
@@ -43,14 +43,14 @@ public class PngChunkUNKNOWN extends PngChunkMultiple { // unkown, custom or not
}
/* does not copy! */
- public void setData(byte[] data) {
+ public void setData(final byte[] data) {
this.data = data;
}
@Override
- public void cloneDataFromRead(PngChunk other) {
+ public void cloneDataFromRead(final PngChunk other) {
// THIS SHOULD NOT BE CALLED IF ALREADY CLONED WITH COPY CONSTRUCTOR
- PngChunkUNKNOWN c = (PngChunkUNKNOWN) other;
+ final PngChunkUNKNOWN c = (PngChunkUNKNOWN) other;
data = c.data; // not deep copy
}
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkZTXT.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkZTXT.java
index 64593eae4..c1dfdeb33 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkZTXT.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkZTXT.java
@@ -16,7 +16,7 @@ public class PngChunkZTXT extends PngChunkTextVar {
public final static String ID = ChunkHelper.zTXt;
// http://www.w3.org/TR/PNG/#11zTXt
- public PngChunkZTXT(ImageInfo info) {
+ public PngChunkZTXT(final ImageInfo info) {
super(ID, info);
}
@@ -25,23 +25,23 @@ public class PngChunkZTXT extends PngChunkTextVar {
if (key.isEmpty())
throw new PngjException("Text chunk key must be non empty");
try {
- ByteArrayOutputStream ba = new ByteArrayOutputStream();
+ final ByteArrayOutputStream ba = new ByteArrayOutputStream();
ba.write(key.getBytes(PngHelperInternal.charsetLatin1));
ba.write(0); // separator
ba.write(0); // compression method: 0
- byte[] textbytes = ChunkHelper.compressBytes(val.getBytes(PngHelperInternal.charsetLatin1), true);
+ final byte[] textbytes = ChunkHelper.compressBytes(val.getBytes(PngHelperInternal.charsetLatin1), true);
ba.write(textbytes);
- byte[] b = ba.toByteArray();
- ChunkRaw chunk = createEmptyChunk(b.length, false);
+ final byte[] b = ba.toByteArray();
+ final ChunkRaw chunk = createEmptyChunk(b.length, false);
chunk.data = b;
return chunk;
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new PngjException(e);
}
}
@Override
- public void parseFromRaw(ChunkRaw c) {
+ public void parseFromRaw(final ChunkRaw c) {
int nullsep = -1;
for (int i = 0; i < c.data.length; i++) { // look for first zero
if (c.data[i] != 0)
@@ -52,16 +52,16 @@ public class PngChunkZTXT extends PngChunkTextVar {
if (nullsep < 0 || nullsep > c.data.length - 2)
throw new PngjException("bad zTXt chunk: no separator found");
key = new String(c.data, 0, nullsep, PngHelperInternal.charsetLatin1);
- int compmet = (int) c.data[nullsep + 1];
+ final int compmet = c.data[nullsep + 1];
if (compmet != 0)
throw new PngjException("bad zTXt chunk: unknown compression method");
- byte[] uncomp = ChunkHelper.compressBytes(c.data, nullsep + 2, c.data.length - nullsep - 2, false); // uncompress
+ final byte[] uncomp = ChunkHelper.compressBytes(c.data, nullsep + 2, c.data.length - nullsep - 2, false); // uncompress
val = new String(uncomp, PngHelperInternal.charsetLatin1);
}
@Override
- public void cloneDataFromRead(PngChunk other) {
- PngChunkZTXT otherx = (PngChunkZTXT) other;
+ public void cloneDataFromRead(final PngChunk other) {
+ final PngChunkZTXT otherx = (PngChunkZTXT) other;
key = otherx.key;
val = otherx.val;
}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngMetadata.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngMetadata.java
index 139603448..bba2b3e7c 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngMetadata.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngMetadata.java
@@ -19,7 +19,7 @@ public class PngMetadata {
private final ChunksList chunkList;
private final boolean readonly;
- public PngMetadata(ChunksList chunks) {
+ public PngMetadata(final ChunksList chunks) {
this.chunkList = chunks;
if (chunks instanceof ChunksListForWrite) {
this.readonly = false;
@@ -35,14 +35,14 @@ public class PngMetadata {
* and if so, overwrites it. However if that not check for already written
* chunks.
*/
- public void queueChunk(final PngChunk c, boolean lazyOverwrite) {
- ChunksListForWrite cl = getChunkListW();
+ public void queueChunk(final PngChunk c, final boolean lazyOverwrite) {
+ final ChunksListForWrite cl = getChunkListW();
if (readonly)
throw new PngjException("cannot set chunk : readonly metadata");
if (lazyOverwrite) {
ChunkHelper.trimList(cl.getQueuedChunks(), new ChunkPredicate() {
@Override
- public boolean match(PngChunk c2) {
+ public boolean match(final PngChunk c2) {
return ChunkHelper.equivalent(c, c2);
}
});
@@ -66,19 +66,19 @@ public class PngMetadata {
* returns -1 if not found or dimension unknown
*/
public double[] getDpi() {
- PngChunk c = chunkList.getById1(ChunkHelper.pHYs, true);
+ final PngChunk c = chunkList.getById1(ChunkHelper.pHYs, true);
if (c == null)
return new double[] { -1, -1 };
else
return ((PngChunkPHYS) c).getAsDpi2();
}
- public void setDpi(double x) {
+ public void setDpi(final double x) {
setDpi(x, x);
}
- public void setDpi(double x, double y) {
- PngChunkPHYS c = new PngChunkPHYS(chunkList.imageInfo);
+ public void setDpi(final double x, final double y) {
+ final PngChunkPHYS c = new PngChunkPHYS(chunkList.imageInfo);
c.setAsDpi2(x, y);
queueChunk(c);
}
@@ -92,8 +92,8 @@ public class PngMetadata {
* @return Returns the created-queued chunk, just in case you want to
* examine or modify it
*/
- public PngChunkTIME setTimeNow(int secsAgo) {
- PngChunkTIME c = new PngChunkTIME(chunkList.imageInfo);
+ public PngChunkTIME setTimeNow(final int secsAgo) {
+ final PngChunkTIME c = new PngChunkTIME(chunkList.imageInfo);
c.setNow(secsAgo);
queueChunk(c);
return c;
@@ -110,8 +110,8 @@ public class PngMetadata {
* @return Returns the created-queued chunk, just in case you want to
* examine or modify it
*/
- public PngChunkTIME setTimeYMDHMS(int yearx, int monx, int dayx, int hourx, int minx, int secx) {
- PngChunkTIME c = new PngChunkTIME(chunkList.imageInfo);
+ public PngChunkTIME setTimeYMDHMS(final int yearx, final int monx, final int dayx, final int hourx, final int minx, final int secx) {
+ final PngChunkTIME c = new PngChunkTIME(chunkList.imageInfo);
c.setYMDHMS(yearx, monx, dayx, hourx, minx, secx);
queueChunk(c, true);
return c;
@@ -125,7 +125,7 @@ public class PngMetadata {
}
public String getTimeAsString() {
- PngChunkTIME c = getTime();
+ final PngChunkTIME c = getTime();
return c == null ? "" : c.getAsString();
}
@@ -144,7 +144,7 @@ public class PngMetadata {
* @return Returns the created-queued chunks, just in case you want to
* examine, touch it
*/
- public PngChunkTextVar setText(String k, String val, boolean useLatin1, boolean compress) {
+ public PngChunkTextVar setText(final String k, final String val, final boolean useLatin1, final boolean compress) {
if (compress && !useLatin1)
throw new PngjException("cannot compress non latin text");
PngChunkTextVar c;
@@ -163,7 +163,7 @@ public class PngMetadata {
return c;
}
- public PngChunkTextVar setText(String k, String val) {
+ public PngChunkTextVar setText(final String k, final String val) {
return setText(k, val, false, false);
}
@@ -175,8 +175,9 @@ public class PngMetadata {
* Warning: this does not check the "lang" key of iTxt
*/
@SuppressWarnings("unchecked")
- public List extends PngChunkTextVar> getTxtsForKey(String k) {
+ public List extends PngChunkTextVar> getTxtsForKey(final String k) {
@SuppressWarnings("rawtypes")
+ final
List c = new ArrayList();
c.addAll(chunkList.getById(ChunkHelper.tEXt, k));
c.addAll(chunkList.getById(ChunkHelper.zTXt, k));
@@ -190,12 +191,12 @@ public class PngMetadata {
*
* Use getTxtsForKey() if you don't want this behaviour
*/
- public String getTxtForKey(String k) {
- List extends PngChunkTextVar> li = getTxtsForKey(k);
+ public String getTxtForKey(final String k) {
+ final List extends PngChunkTextVar> li = getTxtsForKey(k);
if (li.isEmpty())
return "";
- StringBuilder t = new StringBuilder();
- for (PngChunkTextVar c : li)
+ final StringBuilder t = new StringBuilder();
+ for (final PngChunkTextVar c : li)
t.append(c.getVal()).append("\n");
return t.toString().trim();
}
@@ -214,7 +215,7 @@ public class PngMetadata {
* the caller, who should fill its entries
*/
public PngChunkPLTE createPLTEChunk() {
- PngChunkPLTE plte = new PngChunkPLTE(chunkList.imageInfo);
+ final PngChunkPLTE plte = new PngChunkPLTE(chunkList.imageInfo);
queueChunk(plte);
return plte;
}
@@ -233,7 +234,7 @@ public class PngMetadata {
* caller, who should fill its entries
*/
public PngChunkTRNS createTRNSChunk() {
- PngChunkTRNS trns = new PngChunkTRNS(chunkList.imageInfo);
+ final PngChunkTRNS trns = new PngChunkTRNS(chunkList.imageInfo);
queueChunk(trns);
return trns;
}
--
cgit v1.2.3