commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1775889 [2/2] - in /commons/proper/imaging/trunk/src: main/java/org/apache/commons/imaging/color/ main/java/org/apache/commons/imaging/common/itu_t4/ main/java/org/apache/commons/imaging/formats/gif/ main/java/org/apache/commons/imaging/fo...
Date Fri, 23 Dec 2016 18:59:19 GMT
Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcAddTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcAddTest.java?rev=1775889&r1=1775888&r2=1775889&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcAddTest.java
(original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcAddTest.java
Fri Dec 23 18:59:18 2016
@@ -75,7 +75,7 @@ public class IptcAddTest extends IptcBas
         newBlocks.addAll(metadata.photoshopApp13Data.getNonIptcBlocks());
         final List<IptcRecord> oldRecords = metadata.photoshopApp13Data.getRecords();
 
-        List<IptcRecord> newRecords = new ArrayList<>();
+        final List<IptcRecord> newRecords = new ArrayList<>();
         for (final IptcRecord record : oldRecords) {
             if (record.iptcType != IptcTypes.CITY
                     && record.iptcType != IptcTypes.CREDIT) {

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcFullDiscardTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcFullDiscardTest.java?rev=1775889&r1=1775888&r2=1775889&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcFullDiscardTest.java
(original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/jpeg/iptc/IptcFullDiscardTest.java
Fri Dec 23 18:59:18 2016
@@ -30,41 +30,41 @@ import org.junit.Test;
 public class IptcFullDiscardTest {
     
     private byte[] addMetaData(final byte[] bytes) throws Exception {
-        IptcRecord record = new IptcRecord(IptcTypes.KEYWORDS, "meta; data");
-        PhotoshopApp13Data data = new PhotoshopApp13Data(Collections.singletonList(record),
Collections.<IptcBlock> emptyList());
-        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
+        final IptcRecord record = new IptcRecord(IptcTypes.KEYWORDS, "meta; data");
+        final PhotoshopApp13Data data = new PhotoshopApp13Data(Collections.singletonList(record),
Collections.<IptcBlock> emptyList());
+        final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
         new JpegIptcRewriter().writeIPTC(bytes, byteArrayOutputStream, data);
         return byteArrayOutputStream.toByteArray();
     }
     
     private byte[] generateImage() throws Exception {
-        BufferedImage image = new BufferedImage(100, 50, BufferedImage.TYPE_3BYTE_BGR); //
was TYPE_INT_ARGB but that fails on Continuum
-        Graphics2D graphics2D = image.createGraphics();
+        final BufferedImage image = new BufferedImage(100, 50, BufferedImage.TYPE_3BYTE_BGR);
// was TYPE_INT_ARGB but that fails on Continuum
+        final Graphics2D graphics2D = image.createGraphics();
         graphics2D.drawString("Hello World!", 10, 10);
-        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
+        final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
         ImageIO.write(image, "jpg", byteArrayOutputStream);
         return byteArrayOutputStream.toByteArray();
     }
     
     private byte[] removeMetaData(final byte[] bytes, final boolean removeApp13Segment) throws
Exception {
-        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
+        final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
         new JpegIptcRewriter().removeIPTC(bytes, byteArrayOutputStream, removeApp13Segment);
         return byteArrayOutputStream.toByteArray();
     }
 
     @Test
     public void leaveApp13Segment() throws Exception {
-        byte[] originalImage = generateImage();
-        byte[] taggedImage = addMetaData(originalImage);
-        byte[] untaggedImage = removeMetaData(taggedImage, false);
+        final byte[] originalImage = generateImage();
+        final byte[] taggedImage = addMetaData(originalImage);
+        final byte[] untaggedImage = removeMetaData(taggedImage, false);
         Assert.assertEquals(18, untaggedImage.length - originalImage.length);
     }
     
     @Test
     public void removeApp13Segment() throws Exception {
-        byte[] originalImage = generateImage();
-        byte[] taggedImage = addMetaData(originalImage);
-        byte[] untaggedImage = removeMetaData(taggedImage, true);
+        final byte[] originalImage = generateImage();
+        final byte[] taggedImage = addMetaData(originalImage);
+        final byte[] untaggedImage = removeMetaData(taggedImage, true);
         Assert.assertEquals(originalImage.length, untaggedImage.length);
     }
 }

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/png/PngTextTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/png/PngTextTest.java?rev=1775889&r1=1775888&r2=1775889&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/png/PngTextTest.java
(original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/png/PngTextTest.java
Fri Dec 23 18:59:18 2016
@@ -79,7 +79,7 @@ public class PngTextTest extends PngBase
 
         final List<PngText> readTexts = imageInfo.getTextChunks();
         assertEquals(readTexts.size(), 3);
-        for (PngText text : readTexts) {
+        for (final PngText text : readTexts) {
             if (text.keyword.equals("a")) {
                 assertEquals(text.text, "b");
             } else if (text.keyword.equals("c")) {

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/pnm/PnmImageParserTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/pnm/PnmImageParserTest.java?rev=1775889&r1=1775888&r2=1775889&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/pnm/PnmImageParserTest.java
(original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/pnm/PnmImageParserTest.java
Fri Dec 23 18:59:18 2016
@@ -17,10 +17,10 @@ public class PnmImageParserTest {
 
     @Test
     public void testGetImageInfo_happyCase() throws ImageReadException, IOException {
-        byte[] bytes = "P1\n3 2\n0 1 0\n1 0 1\n".getBytes(US_ASCII);
-        Map<String, Object> params = Collections.emptyMap();
-        PnmImageParser underTest = new PnmImageParser();
-        ImageInfo results = underTest.getImageInfo(bytes, params);
+        final byte[] bytes = "P1\n3 2\n0 1 0\n1 0 1\n".getBytes(US_ASCII);
+        final Map<String, Object> params = Collections.emptyMap();
+        final PnmImageParser underTest = new PnmImageParser();
+        final ImageInfo results = underTest.getImageInfo(bytes, params);
         assertEquals(results.getBitsPerPixel(), 1);
         assertEquals(results.getWidth(), 3);
         assertEquals(results.getHeight(), 2);
@@ -33,25 +33,25 @@ public class PnmImageParserTest {
      */
     @Test(expected = ImageReadException.class)
     public void testGetImageInfo_invalidWidth() throws ImageReadException, IOException {
-        byte[] bytes = "P1\na 2\n0 0 0 0 0 0 0 0 0 0 0\n1 1 1 1 1 1 1 1 1 1 1\n".getBytes(US_ASCII);
-        Map<String, Object> params = Collections.emptyMap();
-        PnmImageParser underTest = new PnmImageParser();
+        final byte[] bytes = "P1\na 2\n0 0 0 0 0 0 0 0 0 0 0\n1 1 1 1 1 1 1 1 1 1 1\n".getBytes(US_ASCII);
+        final Map<String, Object> params = Collections.emptyMap();
+        final PnmImageParser underTest = new PnmImageParser();
         underTest.getImageInfo(bytes, params);
     }
 
     @Test(expected = ImageReadException.class)
     public void testGetImageInfo_invalidHeight() throws ImageReadException, IOException {
-        byte[] bytes = "P1\n2 a\n0 0\n0 0\n0 0\n0 0\n0 0\n0 1\n1 1\n1 1\n1 1\n1 1\n1 1\n".getBytes(US_ASCII);
-        Map<String, Object> params = Collections.emptyMap();
-        PnmImageParser underTest = new PnmImageParser();
+        final byte[] bytes = "P1\n2 a\n0 0\n0 0\n0 0\n0 0\n0 0\n0 1\n1 1\n1 1\n1 1\n1 1\n1
1\n".getBytes(US_ASCII);
+        final Map<String, Object> params = Collections.emptyMap();
+        final PnmImageParser underTest = new PnmImageParser();
         underTest.getImageInfo(bytes, params);
     }
 
     @Test(expected = ImageReadException.class)
     public void testGetImageInfo_missingWidthValue() throws ImageReadException, IOException
{
-        byte[] bytes = "P7\nWIDTH \n".getBytes(US_ASCII);
-        Map<String, Object> params = Collections.emptyMap();
-        PnmImageParser underTest = new PnmImageParser();
+        final byte[] bytes = "P7\nWIDTH \n".getBytes(US_ASCII);
+        final Map<String, Object> params = Collections.emptyMap();
+        final PnmImageParser underTest = new PnmImageParser();
         underTest.getImageInfo(bytes, params);
     }
 }

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/tiff/TiffLzwTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/tiff/TiffLzwTest.java?rev=1775889&r1=1775888&r2=1775889&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/tiff/TiffLzwTest.java
(original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/tiff/TiffLzwTest.java
Fri Dec 23 18:59:18 2016
@@ -63,16 +63,16 @@ public class TiffLzwTest extends TiffBas
     @Test
     public void testTiffImageData() throws IOException, ImageReadException,
             ImageWriteException {
-        List<File> images = getTiffImages();
-        for (File image : images) {
+        final List<File> images = getTiffImages();
+        for (final File image : images) {
 
             Debug.debug("imageFile", image);
 
-            ByteSource byteSource = new ByteSourceFile(image);
-            List<byte[]> data = new TiffImageParser().collectRawImageData(byteSource,
+            final ByteSource byteSource = new ByteSourceFile(image);
+            final List<byte[]> data = new TiffImageParser().collectRawImageData(byteSource,
                     Collections.<String, Object>emptyMap());
 
-            for (byte[] bytes : data) {
+            for (final byte[] bytes : data) {
                 decompressRoundtripAndValidate(bytes);
             }
         }

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/tiff/TiffReadWriteTagsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/tiff/TiffReadWriteTagsTest.java?rev=1775889&r1=1775888&r2=1775889&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/tiff/TiffReadWriteTagsTest.java
(original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/tiff/TiffReadWriteTagsTest.java
Fri Dec 23 18:59:18 2016
@@ -41,18 +41,18 @@ public class TiffReadWriteTagsTest exten
 
     @Test
     public void testReadWriteTags() throws ImageWriteException, ImageReadException, IOException
{
-        String description = "A pretty picture";
-        short page = 1;
-        RationalNumber twoThirds = new RationalNumber(2, 3);
-        int t4Options = 0;
-        int width = 10;
-        short height = 10;
-        String area = "A good area";
-        float widthRes = 2.2f;
-        double geoDoubleParams = -8.4;
+        final String description = "A pretty picture";
+        final short page = 1;
+        final RationalNumber twoThirds = new RationalNumber(2, 3);
+        final int t4Options = 0;
+        final int width = 10;
+        final short height = 10;
+        final String area = "A good area";
+        final float widthRes = 2.2f;
+        final double geoDoubleParams = -8.4;
         
-        TiffOutputSet set = new TiffOutputSet();
-        TiffOutputDirectory dir = set.getOrCreateRootDirectory();
+        final TiffOutputSet set = new TiffOutputSet();
+        final TiffOutputDirectory dir = set.getOrCreateRootDirectory();
         dir.add(TiffTagConstants.TIFF_TAG_IMAGE_DESCRIPTION, description);
         dir.add(TiffTagConstants.TIFF_TAG_PAGE_NUMBER, page, page);
         dir.add(TiffTagConstants.TIFF_TAG_YRESOLUTION, twoThirds);
@@ -63,18 +63,18 @@ public class TiffReadWriteTagsTest exten
         dir.add(MicrosoftHdPhotoTagConstants.EXIF_TAG_WIDTH_RESOLUTION, widthRes);
         dir.add(GeoTiffTagConstants.EXIF_TAG_GEO_DOUBLE_PARAMS_TAG, geoDoubleParams);
         
-        TiffImageWriterLossy writer = new TiffImageWriterLossy();
-        ByteArrayOutputStream tiff = new ByteArrayOutputStream();
+        final TiffImageWriterLossy writer = new TiffImageWriterLossy();
+        final ByteArrayOutputStream tiff = new ByteArrayOutputStream();
         writer.write(tiff, set);
         
-        TiffReader reader = new TiffReader(true);
-        Map<String, Object> params = new TreeMap<>();
-        FormatCompliance formatCompliance = new FormatCompliance("");
-        TiffContents contents = reader.readFirstDirectory(new ByteSourceArray(tiff.toByteArray()),
params, true, formatCompliance);
-        TiffDirectory rootDir = contents.directories.get(0);
+        final TiffReader reader = new TiffReader(true);
+        final Map<String, Object> params = new TreeMap<>();
+        final FormatCompliance formatCompliance = new FormatCompliance("");
+        final TiffContents contents = reader.readFirstDirectory(new ByteSourceArray(tiff.toByteArray()),
params, true, formatCompliance);
+        final TiffDirectory rootDir = contents.directories.get(0);
         assertEquals(description, rootDir.getSingleFieldValue(TiffTagConstants.TIFF_TAG_IMAGE_DESCRIPTION));
         assertEquals(page, rootDir.getFieldValue(TiffTagConstants.TIFF_TAG_PAGE_NUMBER, true)[0]);
-        RationalNumber yRes = rootDir.getFieldValue(TiffTagConstants.TIFF_TAG_YRESOLUTION);
+        final RationalNumber yRes = rootDir.getFieldValue(TiffTagConstants.TIFF_TAG_YRESOLUTION);
         assertEquals(twoThirds.numerator, yRes.numerator);
         assertEquals(twoThirds.divisor, yRes.divisor);
         assertEquals(t4Options, rootDir.getFieldValue(TiffTagConstants.TIFF_TAG_T4_OPTIONS));

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/tiff/TiffRoundtripTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/tiff/TiffRoundtripTest.java?rev=1775889&r1=1775888&r2=1775889&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/tiff/TiffRoundtripTest.java
(original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/tiff/TiffRoundtripTest.java
Fri Dec 23 18:59:18 2016
@@ -49,7 +49,7 @@ public class TiffRoundtripTest extends T
             final ImageInfo imageInfo = Imaging.getImageInfo(imageFile);
             assertNotNull(imageInfo);
 
-            BufferedImage image = Imaging.getBufferedImage(imageFile);
+            final BufferedImage image = Imaging.getBufferedImage(imageFile);
             assertNotNull(image);
 
             final int[] compressions = new int[]{

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/tiff/TiffSubImageTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/tiff/TiffSubImageTest.java?rev=1775889&r1=1775888&r2=1775889&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/tiff/TiffSubImageTest.java
(original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/tiff/TiffSubImageTest.java
Fri Dec 23 18:59:18 2016
@@ -34,15 +34,15 @@ public class TiffSubImageTest extends Ti
 
     @Test
     public void testSubImage() throws ImageReadException, ImageWriteException, IOException
{
-        BufferedImage src = new BufferedImage(10, 10, BufferedImage.TYPE_INT_RGB);
-        byte[] imageBytes = Imaging.writeImageToBytes(src, ImageFormats.TIFF, null);
+        final BufferedImage src = new BufferedImage(10, 10, BufferedImage.TYPE_INT_RGB);
+        final byte[] imageBytes = Imaging.writeImageToBytes(src, ImageFormats.TIFF, null);
         
-        Map<String, Object> params = new TreeMap<>();
+        final Map<String, Object> params = new TreeMap<>();
         params.put(TiffConstants.PARAM_KEY_SUBIMAGE_X, 0);
         params.put(TiffConstants.PARAM_KEY_SUBIMAGE_Y, 0);
         params.put(TiffConstants.PARAM_KEY_SUBIMAGE_WIDTH, 2);
         params.put(TiffConstants.PARAM_KEY_SUBIMAGE_HEIGHT, 3);
-        BufferedImage image = Imaging.getBufferedImage(imageBytes, params);
+        final BufferedImage image = Imaging.getBufferedImage(imageBytes, params);
         assertEquals(image.getWidth(), 2);
         assertEquals(image.getHeight(), 3);
     }

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/tiff/TiffTagIntegrityTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/tiff/TiffTagIntegrityTest.java?rev=1775889&r1=1775888&r2=1775889&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/tiff/TiffTagIntegrityTest.java
(original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/tiff/TiffTagIntegrityTest.java
Fri Dec 23 18:59:18 2016
@@ -84,7 +84,7 @@ public class TiffTagIntegrityTest extend
     }
 
     private void verifyFields(final Class<?> cls, final List<TagInfo> allTags)
{
-        ArrayList<Integer> fieldTags = new ArrayList<>();
+        final ArrayList<Integer> fieldTags = new ArrayList<>();
         for (final Field field : cls.getFields()) {
             field.setAccessible(true);
             Object obj = null;
@@ -98,7 +98,7 @@ public class TiffTagIntegrityTest extend
             if (!(obj instanceof TagInfo)) {
                 continue;
             }
-            TagInfo src = (TagInfo) obj;
+            final TagInfo src = (TagInfo) obj;
             if (src.tag == -1) {
                 // Skip TiffTagConstants.TIFF_TAG_UNKNOWN
                 continue;

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputDirectoryTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputDirectoryTest.java?rev=1775889&r1=1775888&r2=1775889&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputDirectoryTest.java
(original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputDirectoryTest.java
Fri Dec 23 18:59:18 2016
@@ -39,11 +39,11 @@ public class TiffOutputDirectoryTest {
     public void testFindField() throws Exception {
         directory.add(TIFF_TAG_DOCUMENT_NAME, "Test.tiff");
 
-        TiffOutputField field = directory.findField(TIFF_TAG_DOCUMENT_NAME);
+        final TiffOutputField field = directory.findField(TIFF_TAG_DOCUMENT_NAME);
 
         assertNotNull(field);
         assertEquals(TIFF_TAG_DOCUMENT_NAME, field.tagInfo);
-        byte[] documentNameAsBytes = TIFF_TAG_DOCUMENT_NAME.encodeValue(TiffConstants.DEFAULT_TIFF_BYTE_ORDER,
"Test.tiff");
+        final byte[] documentNameAsBytes = TIFF_TAG_DOCUMENT_NAME.encodeValue(TiffConstants.DEFAULT_TIFF_BYTE_ORDER,
"Test.tiff");
         assertTrue(field.bytesEqual(documentNameAsBytes));
     }
 }
\ No newline at end of file

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputSetTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputSetTest.java?rev=1775889&r1=1775888&r2=1775889&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputSetTest.java
(original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/formats/tiff/write/TiffOutputSetTest.java
Fri Dec 23 18:59:18 2016
@@ -41,7 +41,7 @@ public class TiffOutputSetTest {
     public void testImaging144() throws Exception {
         tiffOutputSet.setGPSInDegrees(1.0, 1.0);
 
-        TiffOutputField gpsVersionId = tiffOutputSet.findField(GpsTagConstants.GPS_TAG_GPS_VERSION_ID);
+        final TiffOutputField gpsVersionId = tiffOutputSet.findField(GpsTagConstants.GPS_TAG_GPS_VERSION_ID);
 
         assertNotNull(gpsVersionId);
         assertTrue(gpsVersionId.bytesEqual(GpsTagConstants.gpsVersion()));

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/palette/PaletteQuantizationTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/palette/PaletteQuantizationTest.java?rev=1775889&r1=1775888&r2=1775889&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/palette/PaletteQuantizationTest.java
(original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/palette/PaletteQuantizationTest.java
Fri Dec 23 18:59:18 2016
@@ -28,7 +28,7 @@ public class PaletteQuantizationTest ext
 
     @Test
     public void testPaletteQuantization() throws ImageWriteException {
-        BufferedImage whiteImage = new BufferedImage(10, 10, BufferedImage.TYPE_INT_RGB);
+        final BufferedImage whiteImage = new BufferedImage(10, 10, BufferedImage.TYPE_INT_RGB);
         for (int y = 0; y < whiteImage.getHeight(); y++) {
             for (int x = 0; x < whiteImage.getWidth(); x++) {
                 whiteImage.setRGB(x, y, 0xFFFFFF);
@@ -36,7 +36,7 @@ public class PaletteQuantizationTest ext
         }
         checkPaletteDetails(whiteImage, 10, 1);
         
-        BufferedImage whiteAndBlackImage = new BufferedImage(10, 10, BufferedImage.TYPE_INT_RGB);
+        final BufferedImage whiteAndBlackImage = new BufferedImage(10, 10, BufferedImage.TYPE_INT_RGB);
         for (int y = 0; y < whiteImage.getHeight(); y++) {
             for (int x = 0; x < 5; x++) {
                 whiteAndBlackImage.setRGB(x, y, 0xFFFFFF);
@@ -47,7 +47,7 @@ public class PaletteQuantizationTest ext
         }
         checkPaletteDetails(whiteAndBlackImage, 10, 2);
         
-        BufferedImage rainbowImage = new BufferedImage(9, 10, BufferedImage.TYPE_INT_RGB);
+        final BufferedImage rainbowImage = new BufferedImage(9, 10, BufferedImage.TYPE_INT_RGB);
         for (int y = 0; y < whiteImage.getHeight(); y++) {
             for (int x = 0; x < 3; x++) {
                 rainbowImage.setRGB(x, y, 0xFF0000);
@@ -64,7 +64,7 @@ public class PaletteQuantizationTest ext
     }
     
     private void checkPaletteDetails(final BufferedImage image, final int limit, final int
expectedSize) throws ImageWriteException {
-        PaletteFactory paletteFactory = new PaletteFactory();
+        final PaletteFactory paletteFactory = new PaletteFactory();
         Palette palette;
 
         palette = paletteFactory.makeExactRgbPaletteSimple(image, limit);
@@ -93,7 +93,7 @@ public class PaletteQuantizationTest ext
             //checkDithering(image, palette);
         }
         
-        MedianCutQuantizer medianCutQuantizer = new MedianCutQuantizer(true);
+        final MedianCutQuantizer medianCutQuantizer = new MedianCutQuantizer(true);
         palette = medianCutQuantizer.process(
                 image, limit, new MostPopulatedBoxesMedianCut(), false);
         assertEquals(expectedSize, palette.length());
@@ -104,15 +104,15 @@ public class PaletteQuantizationTest ext
     }
     
     private void checkUniqueColors(final BufferedImage src, final Palette palette) throws
ImageWriteException {
-        BufferedImage dst = new BufferedImage(src.getWidth(), src.getHeight(), BufferedImage.TYPE_INT_RGB);
+        final BufferedImage dst = new BufferedImage(src.getWidth(), src.getHeight(), BufferedImage.TYPE_INT_RGB);
         dst.getGraphics().drawImage(src, 0, 0, src.getWidth(), src.getHeight(), null);
         Dithering.applyFloydSteinbergDithering(dst, palette);
-        Palette ditheredPalette = new PaletteFactory().makeExactRgbPaletteSimple(dst, palette.length()
* 2);
+        final Palette ditheredPalette = new PaletteFactory().makeExactRgbPaletteSimple(dst,
palette.length() * 2);
         assertEquals(palette.length(), ditheredPalette.length());
     }
     
     private void checkPixelsAreIdentical(final BufferedImage src, final Palette palette)
throws ImageWriteException {
-        BufferedImage dst = new BufferedImage(src.getWidth(), src.getHeight(), BufferedImage.TYPE_INT_RGB);
+        final BufferedImage dst = new BufferedImage(src.getWidth(), src.getHeight(), BufferedImage.TYPE_INT_RGB);
         dst.getGraphics().drawImage(src, 0, 0, src.getWidth(), src.getHeight(), null);
         Dithering.applyFloydSteinbergDithering(dst, palette);
         for (int y = 0; y < src.getHeight(); y++) {

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/roundtrip/GrayscaleRountripTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/roundtrip/GrayscaleRountripTest.java?rev=1775889&r1=1775888&r2=1775889&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/roundtrip/GrayscaleRountripTest.java
(original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/roundtrip/GrayscaleRountripTest.java
Fri Dec 23 18:59:18 2016
@@ -45,7 +45,7 @@ public class GrayscaleRountripTest exten
 
     @Theory
     public void testGrayscaleRoundtrip(final BufferedImage testImage, final FormatInfo formatInfo)
throws Exception {
-            boolean imageExact = formatInfo.colorSupport != FormatInfo.COLOR_BITMAP;
+            final boolean imageExact = formatInfo.colorSupport != FormatInfo.COLOR_BITMAP;
 
             roundtrip(formatInfo, testImage, "gray", imageExact);
     }

Modified: commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/roundtrip/NullParametersRoundtripTest.java
URL: http://svn.apache.org/viewvc/commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/roundtrip/NullParametersRoundtripTest.java?rev=1775889&r1=1775888&r2=1775889&view=diff
==============================================================================
--- commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/roundtrip/NullParametersRoundtripTest.java
(original)
+++ commons/proper/imaging/trunk/src/test/java/org/apache/commons/imaging/roundtrip/NullParametersRoundtripTest.java
Fri Dec 23 18:59:18 2016
@@ -43,7 +43,7 @@ public class NullParametersRoundtripTest
         Imaging.getImageSize(temp1, null);
         Imaging.getMetadata(temp1, null);
         Imaging.getICCProfile(temp1, null);
-        BufferedImage imageRead = Imaging.getBufferedImage(temp1, null);
+        final BufferedImage imageRead = Imaging.getBufferedImage(temp1, null);
 
         assertNotNull(imageRead);
     }



Mime
View raw message