commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dam...@apache.org
Subject svn commit: r1294474 - in /commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan: formats/gif/ formats/pnm/ formats/tiff/ palette/
Date Tue, 28 Feb 2012 06:06:45 GMT
Author: damjan
Date: Tue Feb 28 06:06:45 2012
New Revision: 1294474

URL: http://svn.apache.org/viewvc?rev=1294474&view=rev
Log:
Fix some FindBugs problems.


Modified:
    commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/gif/GifImageParser.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/pnm/PbmWriter.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/pnm/PgmWriter.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/pnm/PpmWriter.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/TiffDirectory.java
    commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/palette/MedianCutQuantizer.java

Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/gif/GifImageParser.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/gif/GifImageParser.java?rev=1294474&r1=1294473&r2=1294474&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/gif/GifImageParser.java
(original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/gif/GifImageParser.java
Tue Feb 28 06:06:45 2012
@@ -284,7 +284,7 @@ public class GifImageParser extends Imag
                     if (formatCompliance != null)
                         formatCompliance
                                 .addComment("Unknown Application Extension ("
-                                        + new String(label) + ")", completeCode);
+                                        + new String(label, "US-ASCII") + ")", completeCode);
 
                     // if (label == new String("ICCRGBG1"))
                     {
@@ -565,7 +565,7 @@ public class GifImageParser extends Imag
             if (block.blockCode == code)
             {
                 byte bytes[] = ((GenericGifBlock) block).appendSubBlocks();
-                result.add(new String(bytes));
+                result.add(new String(bytes, "US-ASCII"));
             }
         }
 

Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/pnm/PbmWriter.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/pnm/PbmWriter.java?rev=1294474&r1=1294473&r2=1294474&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/pnm/PbmWriter.java
(original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/pnm/PbmWriter.java
Tue Feb 28 06:06:45 2012
@@ -40,10 +40,10 @@ public class PbmWriter extends PnmWriter
         int width = src.getWidth();
         int height = src.getHeight();
 
-        os.write(("" + width).getBytes());
+        os.write(("" + width).getBytes("US-ASCII"));
         os.write(PNM_SEPARATOR);
 
-        os.write(("" + height).getBytes());
+        os.write(("" + height).getBytes("US-ASCII"));
         os.write(PNM_NEWLINE);
 
         int bitcache = 0;
@@ -76,7 +76,7 @@ public class PbmWriter extends PnmWriter
                     }
                 } else
                 {
-                    os.write(("" + sample).getBytes()); // max component value
+                    os.write(("" + sample).getBytes("US-ASCII")); // max component value
                     os.write(PNM_SEPARATOR);
                 }
             }

Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/pnm/PgmWriter.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/pnm/PgmWriter.java?rev=1294474&r1=1294473&r2=1294474&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/pnm/PgmWriter.java
(original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/pnm/PgmWriter.java
Tue Feb 28 06:06:45 2012
@@ -42,13 +42,13 @@ public class PgmWriter extends PnmWriter
         int width = src.getWidth();
         int height = src.getHeight();
 
-        os.write(("" + width).getBytes());
+        os.write(("" + width).getBytes("US-ASCII"));
         os.write(PNM_SEPARATOR);
 
-        os.write(("" + height).getBytes());
+        os.write(("" + height).getBytes("US-ASCII"));
         os.write(PNM_SEPARATOR);
 
-        os.write(("" + 255).getBytes()); // max component value
+        os.write(("" + 255).getBytes("US-ASCII")); // max component value
         os.write(PNM_NEWLINE);
 
         for (int y = 0; y < height; y++)
@@ -66,7 +66,7 @@ public class PgmWriter extends PnmWriter
                 }
                 else
                 {
-                    os.write(("" + sample).getBytes()); // max component value
+                    os.write(("" + sample).getBytes("US-ASCII")); // max component value
                     os.write(PNM_SEPARATOR);
                 }
             }

Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/pnm/PpmWriter.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/pnm/PpmWriter.java?rev=1294474&r1=1294473&r2=1294474&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/pnm/PpmWriter.java
(original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/pnm/PpmWriter.java
Tue Feb 28 06:06:45 2012
@@ -42,13 +42,13 @@ public class PpmWriter extends PnmWriter
         int width = src.getWidth();
         int height = src.getHeight();
 
-        os.write(("" + width).getBytes());
+        os.write(("" + width).getBytes("US-ASCII"));
         os.write(PNM_SEPARATOR);
 
-        os.write(("" + height).getBytes());
+        os.write(("" + height).getBytes("US-ASCII"));
         os.write(PNM_SEPARATOR);
 
-        os.write(("" + 255).getBytes()); // max component value
+        os.write(("" + 255).getBytes("US-ASCII")); // max component value
         os.write(PNM_NEWLINE);
 
         for (int y = 0; y < height; y++)
@@ -67,11 +67,11 @@ public class PpmWriter extends PnmWriter
                 }
                 else
                 {
-                    os.write(("" + red).getBytes()); // max component value
+                    os.write(("" + red).getBytes("US-ASCII")); // max component value
                     os.write(PNM_SEPARATOR);
-                    os.write(("" + green).getBytes()); // max component value
+                    os.write(("" + green).getBytes("US-ASCII")); // max component value
                     os.write(PNM_SEPARATOR);
-                    os.write(("" + blue).getBytes()); // max component value
+                    os.write(("" + blue).getBytes("US-ASCII")); // max component value
                     os.write(PNM_SEPARATOR);
                 }
             }

Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/TiffDirectory.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/TiffDirectory.java?rev=1294474&r1=1294473&r2=1294474&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/TiffDirectory.java
(original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/formats/tiff/TiffDirectory.java
Tue Feb 28 06:06:45 2012
@@ -347,7 +347,7 @@ public class TiffDirectory extends TiffE
         return tag.getValue(field);
     }
     
-    public final class ImageDataElement extends TiffElement
+    public static final class ImageDataElement extends TiffElement
     {
         public ImageDataElement(int offset, int length)
         {

Modified: commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/palette/MedianCutQuantizer.java
URL: http://svn.apache.org/viewvc/commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/palette/MedianCutQuantizer.java?rev=1294474&r1=1294473&r2=1294474&view=diff
==============================================================================
--- commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/palette/MedianCutQuantizer.java
(original)
+++ commons/proper/sanselan/trunk/src/main/java/org/apache/commons/sanselan/palette/MedianCutQuantizer.java
Tue Feb 28 06:06:45 2012
@@ -445,7 +445,7 @@ public class MedianCutQuantizer
 
         }
     }
-    private class ColorGroupCut
+    private static class ColorGroupCut
     {
         public final ColorGroup less, more;
         public final int mode, limit;
@@ -486,7 +486,7 @@ public class MedianCutQuantizer
 
     }
 
-    public class MedianCutPalette extends SimplePalette
+    public static class MedianCutPalette extends SimplePalette
     {
         private final ColorGroup root;
 



Mime
View raw message