You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ki...@apache.org on 2021/04/25 21:52:55 UTC

[commons-imaging] branch master updated (79ec5d8 -> cf6d30e)

This is an automated email from the ASF dual-hosted git repository.

kinow pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-imaging.git.


    from 79ec5d8  Merge branch 'pr-140'
     new 0db984b  [IMAGING-294] Use java style array declaration
     new 946c792  [IMAGING-294] Changelog
     new cf6d30e  Merge branch 'pr-139'

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/changes/changes.xml                                |  3 +++
 .../imaging/formats/jpeg/decoder/JpegDecoder.java      |  2 +-
 .../formats/tiff/datareaders/ImageDataReader.java      |  2 +-
 .../commons/imaging/color/ColorConversionsTest.java    |  2 +-
 .../imaging/common/bytesource/ByteSourceDataTest.java  | 18 +++++++++---------
 .../imaging/common/bytesource/ByteSourceImageTest.java |  8 ++++----
 .../imaging/common/bytesource/ByteSourceTest.java      | 10 +++++-----
 .../commons/imaging/examples/MetadataExample.java      |  4 ++--
 .../apache/commons/imaging/examples/SampleUsage.java   |  6 +++---
 .../commons/imaging/formats/bmp/BmpRoundtripTest.java  |  2 +-
 .../imaging/formats/png/PngMultipleRoundtripTest.java  |  2 +-
 .../commons/imaging/formats/png/PngWriteReadTest.java  |  4 ++--
 .../formats/tiff/TiffFloatingPointRoundTripTest.java   |  2 +-
 .../commons/imaging/formats/tiff/TiffLzwTest.java      | 12 ++++++------
 .../apache/commons/imaging/roundtrip/ImageAsserts.java |  4 ++--
 .../apache/commons/imaging/roundtrip/TestImages.java   |  2 +-
 .../commons/imaging/test/util/FileSystemTraversal.java |  4 ++--
 17 files changed, 45 insertions(+), 42 deletions(-)

[commons-imaging] 02/03: [IMAGING-294] Changelog

Posted by ki...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kinow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-imaging.git

commit 946c792e774a09f938c0f6d0d4d58d92f7bfce4e
Author: Bruno P. Kinoshita <ki...@apache.org>
AuthorDate: Mon Apr 26 09:52:17 2021 +1200

    [IMAGING-294] Changelog
---
 src/changes/changes.xml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 40f1796..6af5917 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -117,6 +117,9 @@ The <action> type attribute can be add,update,fix,remove.
       <action issue="IMAGING-295" dev="kinow" type="update" due-to="Arturo Bernal">
         Use 'compare()' method to compare numbers
       </action>
+      <action issue="IMAGING-294" dev="kinow" type="update" due-to="Arturo Bernal">
+        Use java style array declaration
+      </action>
     </release>
     <release version="1.0-alpha2" date="2020-08-01" description="Second 1.0 alpha release">
       <action issue="IMAGING-258" dev="kinow" type="update" due-to="Gary Lucas">

[commons-imaging] 01/03: [IMAGING-294] Use java style array declaration

Posted by ki...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kinow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-imaging.git

commit 0db984be2e2e6e2f4a0180b4d77246afaab6ca8c
Author: Arturo Bernal <ar...@gmail.com>
AuthorDate: Sun Apr 25 15:44:39 2021 +0200

    [IMAGING-294] Use java style array declaration
---
 .../imaging/formats/jpeg/decoder/JpegDecoder.java      |  2 +-
 .../formats/tiff/datareaders/ImageDataReader.java      |  2 +-
 .../commons/imaging/color/ColorConversionsTest.java    |  2 +-
 .../imaging/common/bytesource/ByteSourceDataTest.java  | 18 +++++++++---------
 .../imaging/common/bytesource/ByteSourceImageTest.java |  8 ++++----
 .../imaging/common/bytesource/ByteSourceTest.java      | 10 +++++-----
 .../commons/imaging/examples/MetadataExample.java      |  4 ++--
 .../apache/commons/imaging/examples/SampleUsage.java   |  6 +++---
 .../commons/imaging/formats/bmp/BmpRoundtripTest.java  |  2 +-
 .../imaging/formats/png/PngMultipleRoundtripTest.java  |  2 +-
 .../commons/imaging/formats/png/PngWriteReadTest.java  |  4 ++--
 .../formats/tiff/TiffFloatingPointRoundTripTest.java   |  2 +-
 .../commons/imaging/formats/tiff/TiffLzwTest.java      | 12 ++++++------
 .../apache/commons/imaging/roundtrip/ImageAsserts.java |  4 ++--
 .../apache/commons/imaging/roundtrip/TestImages.java   |  2 +-
 .../commons/imaging/test/util/FileSystemTraversal.java |  4 ++--
 16 files changed, 42 insertions(+), 42 deletions(-)

diff --git a/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/JpegDecoder.java b/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/JpegDecoder.java
index 88fe216..21ff0d3 100644
--- a/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/JpegDecoder.java
+++ b/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/JpegDecoder.java
@@ -115,7 +115,7 @@ public class JpegDecoder extends BinaryFileParser implements JpegUtils.Visitor {
             switch (sofnSegment.numberOfComponents) {
             case 4:
                 colorModel = new DirectColorModel(24, 0x00ff0000, 0x0000ff00, 0x000000ff);
-                final int bandMasks[] = new int[] { 0x00ff0000, 0x0000ff00, 0x000000ff };
+                final int[] bandMasks = new int[] { 0x00ff0000, 0x0000ff00, 0x000000ff };
                 raster = Raster.createPackedRaster(DataBuffer.TYPE_INT, sofnSegment.width, sofnSegment.height, bandMasks, null);
                 break;
             case 3:
diff --git a/src/main/java/org/apache/commons/imaging/formats/tiff/datareaders/ImageDataReader.java b/src/main/java/org/apache/commons/imaging/formats/tiff/datareaders/ImageDataReader.java
index 40d57bc..ba6df5a 100644
--- a/src/main/java/org/apache/commons/imaging/formats/tiff/datareaders/ImageDataReader.java
+++ b/src/main/java/org/apache/commons/imaging/formats/tiff/datareaders/ImageDataReader.java
@@ -534,7 +534,7 @@ public abstract class ImageDataReader {
      * @param rasterData the raster data.
      */
     void transferBlockToRaster(final int xBlock, final int yBlock,
-        final int blockWidth, final int blockHeight, final int blockData[],
+        final int blockWidth, final int blockHeight, final int[] blockData,
         final int xRaster, final int yRaster,
         final int rasterWidth, final int rasterHeight, final float[] rasterData) {
 
diff --git a/src/test/java/org/apache/commons/imaging/color/ColorConversionsTest.java b/src/test/java/org/apache/commons/imaging/color/ColorConversionsTest.java
index 7e33412..f88614c 100644
--- a/src/test/java/org/apache/commons/imaging/color/ColorConversionsTest.java
+++ b/src/test/java/org/apache/commons/imaging/color/ColorConversionsTest.java
@@ -23,7 +23,7 @@ import org.apache.commons.imaging.internal.Debug;
 import org.junit.jupiter.api.Test;
 
 public class ColorConversionsTest {
-    private static final int SAMPLE_RGBS[] = { 0xffffffff, 0xff000000,
+    private static final int[] SAMPLE_RGBS = { 0xffffffff, 0xff000000,
             0xffff0000, 0xff00ff00, 0xff0000ff, 0xffff00ff, 0xfff0ff00,
             0xff00ffff, 0x00000000, 0xff7f7f7f, };
 
diff --git a/src/test/java/org/apache/commons/imaging/common/bytesource/ByteSourceDataTest.java b/src/test/java/org/apache/commons/imaging/common/bytesource/ByteSourceDataTest.java
index 837be34..926f2b5 100644
--- a/src/test/java/org/apache/commons/imaging/common/bytesource/ByteSourceDataTest.java
+++ b/src/test/java/org/apache/commons/imaging/common/bytesource/ByteSourceDataTest.java
@@ -40,12 +40,12 @@ public class ByteSourceDataTest extends ByteSourceTest {
     }
 
     private interface ByteSourceFactory {
-        ByteSource getByteSource(byte src[]) throws IOException;
+        ByteSource getByteSource(byte[] src) throws IOException;
     }
 
     private class ByteSourceFileFactory implements ByteSourceFactory {
         @Override
-        public ByteSource getByteSource(final byte src[]) throws IOException {
+        public ByteSource getByteSource(final byte[] src) throws IOException {
             final File file = createTempFile(src);
 
             // test that all bytes written to file.
@@ -57,7 +57,7 @@ public class ByteSourceDataTest extends ByteSourceTest {
 
     private class ByteSourceInputStreamFileFactory implements ByteSourceFactory {
         @Override
-        public ByteSource getByteSource(final byte src[]) throws IOException {
+        public ByteSource getByteSource(final byte[] src) throws IOException {
             final File file = createTempFile(src);
 
             final FileInputStream is = new FileInputStream(file);
@@ -68,7 +68,7 @@ public class ByteSourceDataTest extends ByteSourceTest {
 
     private static class ByteSourceInputStreamRawFactory implements ByteSourceFactory {
         @Override
-        public ByteSource getByteSource(final byte src[]) throws IOException {
+        public ByteSource getByteSource(final byte[] src) throws IOException {
             final ByteArrayInputStream is = new ByteArrayInputStream(src);
 
             return new ByteSourceInputStream(is, null);
@@ -77,14 +77,14 @@ public class ByteSourceDataTest extends ByteSourceTest {
     }
 
     protected void writeAndReadBytes(final ByteSourceFactory byteSourceFactory,
-            final byte src[]) throws IOException {
+            final byte[] src) throws IOException {
         final ByteSource byteSource = byteSourceFactory.getByteSource(src);
 
         // test cache during interrupted read cache by reading only first N
         // bytes.
         {
             try (InputStream is = byteSource.getInputStream()) {
-                final byte prefix[] = new byte[256];
+                final byte[] prefix = new byte[256];
                 final int read = is.read(prefix);
 
                 assertTrue(read <= src.length);
@@ -97,7 +97,7 @@ public class ByteSourceDataTest extends ByteSourceTest {
         // test cache by completely reading InputStream N times.
         for (int j = 0; j < 5; j++) {
             try (final InputStream is = byteSource.getInputStream()) {
-                final byte dst[] = IOUtils.toByteArray(is);
+                final byte[] dst = IOUtils.toByteArray(is);
 
                 assertArrayEquals(src, dst);
             }
@@ -105,7 +105,7 @@ public class ByteSourceDataTest extends ByteSourceTest {
 
         {
             // test getAll() method.
-            final byte all[] = byteSource.getAll();
+            final byte[] all = byteSource.getAll();
             assertArrayEquals(src, all);
         }
 
@@ -115,7 +115,7 @@ public class ByteSourceDataTest extends ByteSourceTest {
             final int start = src.length / 2;
 
             try (InputStream is = byteSource.getInputStream(start)) {
-                final byte dst[] = IOUtils.toByteArray(is);
+                final byte[] dst = IOUtils.toByteArray(is);
 
                 assertEquals(src.length, dst.length + start);
                 for (int i = 0; i < dst.length; i++) {
diff --git a/src/test/java/org/apache/commons/imaging/common/bytesource/ByteSourceImageTest.java b/src/test/java/org/apache/commons/imaging/common/bytesource/ByteSourceImageTest.java
index 3c32d80..801769c 100644
--- a/src/test/java/org/apache/commons/imaging/common/bytesource/ByteSourceImageTest.java
+++ b/src/test/java/org/apache/commons/imaging/common/bytesource/ByteSourceImageTest.java
@@ -58,7 +58,7 @@ public class ByteSourceImageTest extends ByteSourceTest {
         Debug.debug("imageFile", imageFile);
         assertNotNull(imageFile);
 
-        final byte imageFileBytes[] = FileUtils.readFileToByteArray(imageFile);
+        final byte[] imageFileBytes = FileUtils.readFileToByteArray(imageFile);
         assertNotNull(imageFileBytes);
         assertEquals(imageFileBytes.length, imageFile.length());
 
@@ -145,9 +145,9 @@ public class ByteSourceImageTest extends ByteSourceTest {
     public void checkGetICCProfileBytes(final File imageFile, final byte[] imageFileBytes)
             throws Exception {
         // check guessFormat()
-        final byte iccBytesFile[] = Imaging.getICCProfileBytes(imageFile);
+        final byte[] iccBytesFile = Imaging.getICCProfileBytes(imageFile);
 
-        final byte iccBytesBytes[] = Imaging.getICCProfileBytes(imageFileBytes);
+        final byte[] iccBytesBytes = Imaging.getICCProfileBytes(imageFileBytes);
 
         assertEquals((iccBytesFile != null), (iccBytesBytes != null));
 
@@ -176,7 +176,7 @@ public class ByteSourceImageTest extends ByteSourceTest {
         assertNotNull(imageInfoFile);
         assertNotNull(imageInfoBytes);
 
-        final Method methods[] = ImageInfo.class.getMethods();
+        final Method[] methods = ImageInfo.class.getMethods();
         for (final Method method2 : methods) {
             final Method method = method2;
             method.getModifiers();
diff --git a/src/test/java/org/apache/commons/imaging/common/bytesource/ByteSourceTest.java b/src/test/java/org/apache/commons/imaging/common/bytesource/ByteSourceTest.java
index ba285b4..54a787e 100644
--- a/src/test/java/org/apache/commons/imaging/common/bytesource/ByteSourceTest.java
+++ b/src/test/java/org/apache/commons/imaging/common/bytesource/ByteSourceTest.java
@@ -31,7 +31,7 @@ import org.junit.jupiter.api.Assertions;
 import org.junit.jupiter.api.Test;
 
 public abstract class ByteSourceTest extends ImagingTest {
-    protected File createTempFile(final byte src[]) throws IOException {
+    protected File createTempFile(final byte[] src) throws IOException {
         final File file = File.createTempFile("raw_", ".bin");
 
         // write test bytes to file.
@@ -47,24 +47,24 @@ public abstract class ByteSourceTest extends ImagingTest {
     }
 
     protected static byte[][] getTestByteArrays() {
-        final byte single[] = new byte[1];
+        final byte[] single = new byte[1];
         for (int i = 0; i < single.length; i++) {
             single[i] = (byte) i;
         }
 
-        final byte simple[] = new byte[256];
+        final byte[] simple = new byte[256];
         for (int i = 0; i < simple.length; i++) {
             simple[i] = (byte) i;
         }
 
-        final byte zeroes[] = new byte[256];
+        final byte[] zeroes = new byte[256];
 
         final ByteArrayOutputStream baos = new ByteArrayOutputStream();
         for (int i = 0; i < 256 * 256; i++) {
             baos.write(0xff & i);
             baos.write(0xff & (i >> 8));
         }
-        final byte longArray[] = (baos.toByteArray());
+        final byte[] longArray = (baos.toByteArray());
 
         return new byte[][]{ImagingConstants.EMPTY_BYTE_ARRAY, single, simple, zeroes, longArray,};
     }
diff --git a/src/test/java/org/apache/commons/imaging/examples/MetadataExample.java b/src/test/java/org/apache/commons/imaging/examples/MetadataExample.java
index 4bffadb..baf1263 100644
--- a/src/test/java/org/apache/commons/imaging/examples/MetadataExample.java
+++ b/src/test/java/org/apache/commons/imaging/examples/MetadataExample.java
@@ -107,9 +107,9 @@ public class MetadataExample {
                     gpsLongitudeField != null) {
                 // all of these values are strings.
                 final String gpsLatitudeRef = (String) gpsLatitudeRefField.getValue();
-                final RationalNumber gpsLatitude[] = (RationalNumber[]) (gpsLatitudeField.getValue());
+                final RationalNumber[] gpsLatitude = (RationalNumber[]) (gpsLatitudeField.getValue());
                 final String gpsLongitudeRef = (String) gpsLongitudeRefField.getValue();
-                final RationalNumber gpsLongitude[] = (RationalNumber[]) gpsLongitudeField.getValue();
+                final RationalNumber[] gpsLongitude = (RationalNumber[]) gpsLongitudeField.getValue();
 
                 final RationalNumber gpsLatitudeDegrees = gpsLatitude[0];
                 final RationalNumber gpsLatitudeMinutes = gpsLatitude[1];
diff --git a/src/test/java/org/apache/commons/imaging/examples/SampleUsage.java b/src/test/java/org/apache/commons/imaging/examples/SampleUsage.java
index 5b40d00..4e7955d 100644
--- a/src/test/java/org/apache/commons/imaging/examples/SampleUsage.java
+++ b/src/test/java/org/apache/commons/imaging/examples/SampleUsage.java
@@ -43,7 +43,7 @@ public class SampleUsage {
             // Imaging works equally well with File, byte array or InputStream
             // inputs.</b>
             final BufferedImage someImage = null;
-            final byte someBytes[] = null;
+            final byte[] someBytes = null;
             final File someFile = null;
             final InputStream someInputStream = null;
             final OutputStream someOutputStream = null;
@@ -52,7 +52,7 @@ public class SampleUsage {
             // </b>
 
             // <b>how to read an image: </b>
-            final byte imageBytes[] = someBytes;
+            final byte[] imageBytes = someBytes;
             final BufferedImage image_1 = Imaging.getBufferedImage(imageBytes);
 
             // <b>methods of Imaging usually accept files, byte arrays, or
@@ -74,7 +74,7 @@ public class SampleUsage {
             Imaging.writeImage(image, os, format, optionalParams);
 
             // <b>get the image's embedded ICC Profile, if it has one. </b>
-            final byte iccProfileBytes[] = Imaging.getICCProfileBytes(imageBytes);
+            final byte[] iccProfileBytes = Imaging.getICCProfileBytes(imageBytes);
 
             final ICC_Profile iccProfile = Imaging.getICCProfile(imageBytes);
 
diff --git a/src/test/java/org/apache/commons/imaging/formats/bmp/BmpRoundtripTest.java b/src/test/java/org/apache/commons/imaging/formats/bmp/BmpRoundtripTest.java
index 197d3e2..d9d8945 100644
--- a/src/test/java/org/apache/commons/imaging/formats/bmp/BmpRoundtripTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/bmp/BmpRoundtripTest.java
@@ -160,7 +160,7 @@ public class BmpRoundtripTest extends BmpBaseTest {
         assertEquals(srcImage.getWidth(), dstImage.getWidth());
         assertEquals(srcImage.getHeight(), dstImage.getHeight());
 
-        final int dstData[][] = bufferedImageToImageData(dstImage);
+        final int[][] dstData = bufferedImageToImageData(dstImage);
         compare(rawData, dstData);
     }
 
diff --git a/src/test/java/org/apache/commons/imaging/formats/png/PngMultipleRoundtripTest.java b/src/test/java/org/apache/commons/imaging/formats/png/PngMultipleRoundtripTest.java
index ab368b4..4c0e930 100644
--- a/src/test/java/org/apache/commons/imaging/formats/png/PngMultipleRoundtripTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/png/PngMultipleRoundtripTest.java
@@ -40,7 +40,7 @@ public class PngMultipleRoundtripTest extends PngBaseTest {
         final File imagesFolder = new File(imagesFolderPath);
         assertTrue(imagesFolder.exists() && imagesFolder.isDirectory());
 
-        final File files[] = imagesFolder.listFiles();
+        final File[] files = imagesFolder.listFiles();
         for (final File file : files) {
             final File imageFile = file;
             if (!imageFile.isFile()) {
diff --git a/src/test/java/org/apache/commons/imaging/formats/png/PngWriteReadTest.java b/src/test/java/org/apache/commons/imaging/formats/png/PngWriteReadTest.java
index fa3f5e4..e045a6c 100644
--- a/src/test/java/org/apache/commons/imaging/formats/png/PngWriteReadTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/png/PngWriteReadTest.java
@@ -201,7 +201,7 @@ public class PngWriteReadTest extends ImagingTest {
         assertEquals(srcImage.getWidth(), dstImage.getWidth());
         assertEquals(srcImage.getHeight(), dstImage.getHeight());
 
-        final int dstData[][] = bufferedImageToImageData(dstImage);
+        final int[][] dstData = bufferedImageToImageData(dstImage);
         assertArrayEquals(rawData, dstData);
     }
 
@@ -230,7 +230,7 @@ public class PngWriteReadTest extends ImagingTest {
         assertEquals(srcImage.getWidth(), dstImage.getWidth());
         assertEquals(srcImage.getHeight(), dstImage.getHeight());
 
-        final int dstData[][] = bufferedImageToImageData(dstImage);
+        final int[][] dstData = bufferedImageToImageData(dstImage);
         assertArrayEquals(rawData, dstData);
 
         final ImageMetadata imageMetadata = Imaging.getMetadata(bytes);
diff --git a/src/test/java/org/apache/commons/imaging/formats/tiff/TiffFloatingPointRoundTripTest.java b/src/test/java/org/apache/commons/imaging/formats/tiff/TiffFloatingPointRoundTripTest.java
index a21fd6f..87c4333 100644
--- a/src/test/java/org/apache/commons/imaging/formats/tiff/TiffFloatingPointRoundTripTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/tiff/TiffFloatingPointRoundTripTest.java
@@ -81,7 +81,7 @@ public class TiffFloatingPointRoundTripTest extends TiffBaseTest {
         try {
             final PhotometricInterpreterFloat pi = getPhotometricInterpreter();
             final ImageBuilder builder = new ImageBuilder(width, height, false);
-            final int samples[] = new int[1];
+            final int[] samples = new int[1];
             for (int iCol = 0; iCol < width; iCol++) {
                 for (int iRow = 0; iRow < height; iRow++) {
                     final int index = iRow * width + iCol;
diff --git a/src/test/java/org/apache/commons/imaging/formats/tiff/TiffLzwTest.java b/src/test/java/org/apache/commons/imaging/formats/tiff/TiffLzwTest.java
index 839f26c..7c6433f 100644
--- a/src/test/java/org/apache/commons/imaging/formats/tiff/TiffLzwTest.java
+++ b/src/test/java/org/apache/commons/imaging/formats/tiff/TiffLzwTest.java
@@ -76,7 +76,7 @@ public class TiffLzwTest extends TiffBaseTest {
         }
     }
 
-    private void compressRoundtripAndValidate(final byte src[]) throws IOException {
+    private void compressRoundtripAndValidate(final byte[] src) throws IOException {
         final boolean DEBUG = false;
 
         if (DEBUG) {
@@ -110,7 +110,7 @@ public class TiffLzwTest extends TiffBaseTest {
 
         final MyLzwCompressor compressor = new MyLzwCompressor(LZW_MINIMUM_CODE_SIZE,
                 ByteOrder.BIG_ENDIAN, true, compressionListener);
-        final byte compressed[] = compressor.compress(src);
+        final byte[] compressed = compressor.compress(src);
 
         final MyLzwDecompressor.Listener decompressionListener = new MyLzwDecompressor.Listener() {
 
@@ -161,7 +161,7 @@ public class TiffLzwTest extends TiffBaseTest {
                 LZW_MINIMUM_CODE_SIZE, ByteOrder.BIG_ENDIAN,
                 decompressionListener);
         decompressor.setTiffLZWMode();
-        final byte decompressed[] = decompressor.decompress(is, src.length);
+        final byte[] decompressed = decompressor.decompress(is, src.length);
 
         assertEquals(src.length, decompressed.length);
         for (int i = 0; i < src.length; i++) {
@@ -169,7 +169,7 @@ public class TiffLzwTest extends TiffBaseTest {
         }
     }
 
-    private void decompressRoundtripAndValidate(final byte src[]) throws IOException {
+    private void decompressRoundtripAndValidate(final byte[] src) throws IOException {
         Debug.debug();
         Debug.debug("roundtripAndValidate: " + src.length);
         Debug.debug();
@@ -198,7 +198,7 @@ public class TiffLzwTest extends TiffBaseTest {
                 LZW_MINIMUM_CODE_SIZE, ByteOrder.BIG_ENDIAN,
                 decompressionListener);
         decompressor.setTiffLZWMode();
-        final byte decompressed[] = decompressor.decompress(is, src.length);
+        final byte[] decompressed = decompressor.decompress(is, src.length);
 
         final MyLzwCompressor.Listener compressionListener = new MyLzwCompressor.Listener() {
 
@@ -261,7 +261,7 @@ public class TiffLzwTest extends TiffBaseTest {
 
         final MyLzwCompressor compressor = new MyLzwCompressor(LZW_MINIMUM_CODE_SIZE,
                 ByteOrder.BIG_ENDIAN, true, compressionListener);
-        final byte compressed[] = compressor.compress(decompressed);
+        final byte[] compressed = compressor.compress(decompressed);
 
         assertEquals(src.length, compressed.length);
         for (int i = 0; i < src.length; i++) {
diff --git a/src/test/java/org/apache/commons/imaging/roundtrip/ImageAsserts.java b/src/test/java/org/apache/commons/imaging/roundtrip/ImageAsserts.java
index 14b77e1..32c499c 100644
--- a/src/test/java/org/apache/commons/imaging/roundtrip/ImageAsserts.java
+++ b/src/test/java/org/apache/commons/imaging/roundtrip/ImageAsserts.java
@@ -82,8 +82,8 @@ final class ImageAsserts {
         assertTrue(b.exists() && b.isFile());
         Assertions.assertEquals(a.length(), b.length());
 
-        final byte aData[] = FileUtils.readFileToByteArray(a);
-        final byte bData[] = FileUtils.readFileToByteArray(b);
+        final byte[] aData = FileUtils.readFileToByteArray(a);
+        final byte[] bData = FileUtils.readFileToByteArray(b);
 
         for (int i = 0; i < a.length(); i++) {
             final int aByte = 0xff & aData[i];
diff --git a/src/test/java/org/apache/commons/imaging/roundtrip/TestImages.java b/src/test/java/org/apache/commons/imaging/roundtrip/TestImages.java
index ffd410b..1c3d314 100644
--- a/src/test/java/org/apache/commons/imaging/roundtrip/TestImages.java
+++ b/src/test/java/org/apache/commons/imaging/roundtrip/TestImages.java
@@ -82,7 +82,7 @@ final class TestImages {
     }
 
     static BufferedImage createLimitedColorImage(final int width, final int height) {
-        final int colors[] = {0xffffffff, 0xff000000, 0xfff00000, 0xff0000ff,
+        final int[] colors = {0xffffffff, 0xff000000, 0xfff00000, 0xff0000ff,
                 0xff123456, 0xfffefeff, 0xff7f817f,};
 
         final BufferedImage result = new BufferedImage(width, height,
diff --git a/src/test/java/org/apache/commons/imaging/test/util/FileSystemTraversal.java b/src/test/java/org/apache/commons/imaging/test/util/FileSystemTraversal.java
index 7da17dc..77408ba 100644
--- a/src/test/java/org/apache/commons/imaging/test/util/FileSystemTraversal.java
+++ b/src/test/java/org/apache/commons/imaging/test/util/FileSystemTraversal.java
@@ -61,7 +61,7 @@ public class FileSystemTraversal {
                 }
             }
         } else if (file.isDirectory()) {
-            final File files[] = file.listFiles();
+            final File[] files = file.listFiles();
             if (files != null) {
                 for (int i = 0; i < files.length; i++) {
                     final File child = files[i];
@@ -134,7 +134,7 @@ public class FileSystemTraversal {
 
     private boolean traverse(final int mode, final Visitor visitor, final double estimate,
             final double estimateIncrement) {
-        File roots[] = File.listRoots();
+        File[] roots = File.listRoots();
 
         if (ON_MAC_OS_X) {
             final File Volumes = new File("/Volumes/");

[commons-imaging] 03/03: Merge branch 'pr-139'

Posted by ki...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kinow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-imaging.git

commit cf6d30e944364fa8aefb94e83e47181eecb66bca
Merge: 79ec5d8 946c792
Author: Bruno P. Kinoshita <ki...@apache.org>
AuthorDate: Mon Apr 26 09:52:27 2021 +1200

    Merge branch 'pr-139'
    
    This closes #139

 src/changes/changes.xml                                |  3 +++
 .../imaging/formats/jpeg/decoder/JpegDecoder.java      |  2 +-
 .../formats/tiff/datareaders/ImageDataReader.java      |  2 +-
 .../commons/imaging/color/ColorConversionsTest.java    |  2 +-
 .../imaging/common/bytesource/ByteSourceDataTest.java  | 18 +++++++++---------
 .../imaging/common/bytesource/ByteSourceImageTest.java |  8 ++++----
 .../imaging/common/bytesource/ByteSourceTest.java      | 10 +++++-----
 .../commons/imaging/examples/MetadataExample.java      |  4 ++--
 .../apache/commons/imaging/examples/SampleUsage.java   |  6 +++---
 .../commons/imaging/formats/bmp/BmpRoundtripTest.java  |  2 +-
 .../imaging/formats/png/PngMultipleRoundtripTest.java  |  2 +-
 .../commons/imaging/formats/png/PngWriteReadTest.java  |  4 ++--
 .../formats/tiff/TiffFloatingPointRoundTripTest.java   |  2 +-
 .../commons/imaging/formats/tiff/TiffLzwTest.java      | 12 ++++++------
 .../apache/commons/imaging/roundtrip/ImageAsserts.java |  4 ++--
 .../apache/commons/imaging/roundtrip/TestImages.java   |  2 +-
 .../commons/imaging/test/util/FileSystemTraversal.java |  4 ++--
 17 files changed, 45 insertions(+), 42 deletions(-)