Index: src/main/java/org/apache/pdfbox/filter/ASCIIHexFilter.java
===================================================================
--- src/main/java/org/apache/pdfbox/filter/ASCIIHexFilter.java	(Revision 1666829)
+++ src/main/java/org/apache/pdfbox/filter/ASCIIHexFilter.java	(Arbeitskopie)
@@ -99,12 +99,12 @@
     //  12  0x0C  Form feed (FF)
     //  13  0x0D  Carriage return (CR)
     //  32  0x20  Space (SP)
-    private boolean isWhitespace(int c)
+    private static boolean isWhitespace(int c)
     {
         return c == 0 || c == 9 || c == 10 || c == 12 || c == 13 || c == 32;
     }
 
-    private boolean isEOD(int c)
+    private static boolean isEOD(int c)
     {
         return c == '>';
     }
Index: src/main/java/org/apache/pdfbox/filter/CCITTFaxFilter.java
===================================================================
--- src/main/java/org/apache/pdfbox/filter/CCITTFaxFilter.java	(Revision 1666829)
+++ src/main/java/org/apache/pdfbox/filter/CCITTFaxFilter.java	(Arbeitskopie)
@@ -115,7 +115,7 @@
         return new DecodeResult(parameters);
     }
 
-    private void invertBitmap(byte[] bufferData)
+    private static void invertBitmap(byte[] bufferData)
     {
         for (int i = 0, c = bufferData.length; i < c; i++)
         {
Index: src/main/java/org/apache/pdfbox/filter/CryptFilter.java
===================================================================
--- src/main/java/org/apache/pdfbox/filter/CryptFilter.java	(Revision 1666829)
+++ src/main/java/org/apache/pdfbox/filter/CryptFilter.java	(Arbeitskopie)
@@ -19,6 +19,7 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+
 import org.apache.pdfbox.cos.COSDictionary;
 import org.apache.pdfbox.cos.COSName;
 
@@ -40,10 +41,7 @@
             identityFilter.decode(encoded, decoded, parameters, index);
             return new DecodeResult(parameters);
         }
-        else
-        {
-            throw new IOException("Unsupported crypt filter " + encryptionName.getName());
-        }
+        throw new IOException("Unsupported crypt filter " + encryptionName.getName());
     }
 
     @Override
Index: src/main/java/org/apache/pdfbox/filter/DCTFilter.java
===================================================================
--- src/main/java/org/apache/pdfbox/filter/DCTFilter.java	(Revision 1666829)
+++ src/main/java/org/apache/pdfbox/filter/DCTFilter.java	(Arbeitskopie)
@@ -24,6 +24,7 @@
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.lang.reflect.Field;
+
 import javax.imageio.IIOException;
 import javax.imageio.ImageIO;
 import javax.imageio.ImageReader;
@@ -30,6 +31,7 @@
 import javax.imageio.metadata.IIOMetadata;
 import javax.imageio.metadata.IIOMetadataNode;
 import javax.imageio.stream.ImageInputStream;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.pdfbox.cos.COSDictionary;
@@ -158,6 +160,8 @@
                     case 2:
                         raster = fromYCCKtoCMYK(raster);
                         break;
+                default:
+                    throw new IllegalArgumentException("Unknown colorTransform");
                 }
             }
             else if (raster.getNumBands() == 3)
@@ -181,7 +185,7 @@
     }
 
     // reads the APP14 Adobe transform tag and returns its value, or 0 if unknown
-    private Integer getAdobeTransform(IIOMetadata metadata)
+    private static Integer getAdobeTransform(IIOMetadata metadata)
     {
         Element tree = (Element)metadata.getAsTree("javax_imageio_jpeg_image_1.0");
         Element markerSequence = (Element)tree.getElementsByTagName("markerSequence").item(0);
@@ -197,7 +201,7 @@
     // converts YCCK image to CMYK. YCCK is an equivalent encoding for
     // CMYK data, so no color management code is needed here, nor does the
     // PDF color space have to be consulted
-    private WritableRaster fromYCCKtoCMYK(Raster raster) throws IOException
+    private static WritableRaster fromYCCKtoCMYK(Raster raster)
     {
         WritableRaster writableRaster = raster.createCompatibleWritableRaster();
 
@@ -236,7 +240,7 @@
     }
 
     // converts from BGR to RGB
-    private WritableRaster fromBGRtoRGB(Raster raster) throws IOException
+    private static WritableRaster fromBGRtoRGB(Raster raster)
     {
         WritableRaster writableRaster = raster.createCompatibleWritableRaster();
 
@@ -260,7 +264,7 @@
     }
     
     // returns the number of channels as a string, or an empty string if there is an error getting the meta data
-    private String getNumChannels(ImageReader reader) throws IOException
+    private static String getNumChannels(ImageReader reader)
     {
         try
         {
@@ -284,7 +288,7 @@
     }    
 
     // clamps value to 0-255 range
-    private int clamp(float value)
+    private static int clamp(float value)
     {
         return (int)((value < 0) ? 0 : ((value > 255) ? 255 : value));
     }
Index: src/main/java/org/apache/pdfbox/filter/Filter.java
===================================================================
--- src/main/java/org/apache/pdfbox/filter/Filter.java	(Revision 1666829)
+++ src/main/java/org/apache/pdfbox/filter/Filter.java	(Arbeitskopie)
@@ -20,6 +20,7 @@
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.util.Iterator;
+
 import javax.imageio.ImageIO;
 import javax.imageio.ImageReader;
 
@@ -76,7 +77,7 @@
 
     // gets the decode params for a specific filter index, this is used to
     // normalise the DecodeParams entry so that it is always a dictionary
-    protected COSDictionary getDecodeParams(COSDictionary dictionary, int index)
+    protected static COSDictionary getDecodeParams(COSDictionary dictionary, int index)
     {
         COSBase obj = dictionary.getDictionaryObject(COSName.DECODE_PARMS, COSName.DP);
         if (obj instanceof COSDictionary)
@@ -107,7 +108,7 @@
      * @return The image reader for the format.
      * @throws MissingImageReaderException if no image reader is found.
      */
-    protected ImageReader findImageReader(String formatName, String errorCause) throws MissingImageReaderException
+    protected static ImageReader findImageReader(String formatName, String errorCause) throws MissingImageReaderException
     {
         Iterator<ImageReader> readers = ImageIO.getImageReadersByFormatName(formatName);
         ImageReader reader = null;
Index: src/main/java/org/apache/pdfbox/filter/FlateFilter.java
===================================================================
--- src/main/java/org/apache/pdfbox/filter/FlateFilter.java	(Revision 1666829)
+++ src/main/java/org/apache/pdfbox/filter/FlateFilter.java	(Arbeitskopie)
@@ -47,7 +47,7 @@
     {
         int predictor = -1;
 
-        COSDictionary decodeParams = getDecodeParams(parameters, index);
+        final COSDictionary decodeParams = getDecodeParams(parameters, index);
         if (decodeParams != null)
         {
             predictor = decodeParams.getInt(COSName.PREDICTOR);
@@ -57,6 +57,7 @@
         {
             if (predictor > 1)
             {
+                @SuppressWarnings("null")
                 int colors = Math.min(decodeParams.getInt(COSName.COLORS, 1), 32);
                 int bitsPerPixel = decodeParams.getInt(COSName.BITS_PER_COMPONENT, 8);
                 int columns = decodeParams.getInt(COSName.COLUMNS, 1);
@@ -86,7 +87,7 @@
 
     // Use Inflater instead of InflateInputStream to avoid an EOFException due to a probably
     // missing Z_STREAM_END, see PDFBOX-1232 for details
-    private void decompress(InputStream in, OutputStream out) throws IOException, DataFormatException 
+    private static void decompress(InputStream in, OutputStream out) throws IOException, DataFormatException 
     { 
         byte[] buf = new byte[2048]; 
         int read = in.read(buf); 
Index: src/main/java/org/apache/pdfbox/filter/JPXFilter.java
===================================================================
--- src/main/java/org/apache/pdfbox/filter/JPXFilter.java	(Revision 1666829)
+++ src/main/java/org/apache/pdfbox/filter/JPXFilter.java	(Arbeitskopie)
@@ -67,7 +67,7 @@
     }
 
     // try to read using JAI Image I/O
-    private BufferedImage readJPX(InputStream input, DecodeResult result) throws IOException
+    private static BufferedImage readJPX(InputStream input, DecodeResult result) throws IOException
     {
         ImageReader reader = findImageReader("JPEG2000", "Java Advanced Imaging (JAI) Image I/O Tools are not installed");
         ImageInputStream iis = null;
Index: src/main/java/org/apache/pdfbox/filter/LZWFilter.java
===================================================================
--- src/main/java/org/apache/pdfbox/filter/LZWFilter.java	(Revision 1666829)
+++ src/main/java/org/apache/pdfbox/filter/LZWFilter.java	(Arbeitskopie)
@@ -24,8 +24,10 @@
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
+
 import javax.imageio.stream.MemoryCacheImageInputStream;
 import javax.imageio.stream.MemoryCacheImageOutputStream;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.pdfbox.cos.COSDictionary;
@@ -80,16 +82,19 @@
         }
         if (predictor > 1)
         {
-            int colors = Math.min(decodeParams.getInt(COSName.COLORS, 1), 32);
-            int bitsPerPixel = decodeParams.getInt(COSName.BITS_PER_COMPONENT, 8);
-            int columns = decodeParams.getInt(COSName.COLUMNS, 1);
-            ByteArrayOutputStream baos = new ByteArrayOutputStream();
-            doLZWDecode(encoded, baos, earlyChange);
-            ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
-            Predictor.decodePredictor(predictor, colors, bitsPerPixel, columns, bais, decoded);
-            decoded.flush();
-            baos.reset();
-            bais.reset();
+            if (decodeParams != null)                
+            {
+                int colors = Math.min(decodeParams.getInt(COSName.COLORS, 1), 32);
+                int bitsPerPixel = decodeParams.getInt(COSName.BITS_PER_COMPONENT, 8);
+                int columns = decodeParams.getInt(COSName.COLUMNS, 1);
+                ByteArrayOutputStream baos = new ByteArrayOutputStream();
+                doLZWDecode(encoded, baos, earlyChange);
+                ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
+                Predictor.decodePredictor(predictor, colors, bitsPerPixel, columns, bais, decoded);
+                decoded.flush();
+                baos.reset();
+                bais.reset();
+            }
         }
         else
         {
@@ -98,11 +103,11 @@
         return new DecodeResult(parameters);
     }
 
-    private void doLZWDecode(InputStream encoded, OutputStream decoded, int earlyChange) throws IOException
+    private static void doLZWDecode(InputStream encoded, OutputStream decoded, int earlyChange) throws IOException
     {
         List<byte[]> codeTable = new ArrayList<byte[]>();
         int chunk = 9;
-        MemoryCacheImageInputStream in = new MemoryCacheImageInputStream(encoded);
+        final MemoryCacheImageInputStream in = new MemoryCacheImageInputStream(encoded);
         long nextCommand;
         long prevCommand = -1;
 
@@ -163,7 +168,7 @@
         int chunk = 9;
 
         byte[] inputPattern = null;
-        MemoryCacheImageOutputStream out = new MemoryCacheImageOutputStream(encoded);
+        final MemoryCacheImageOutputStream out = new MemoryCacheImageOutputStream(encoded);
         out.writeBits(CLEAR_TABLE, chunk);
         int foundCode = -1;
         int r;
@@ -223,7 +228,8 @@
         out.writeBits(0, 7);
         
         // must do or file will be empty :-(
-        out.flush(); 
+        out.flush();
+        out.close();
     }
 
     /**
@@ -234,7 +240,7 @@
      * @return The index of the longest matching pattern or -1 if nothing is
      * found.
      */
-    private int findPatternCode(List<byte[]> codeTable, byte[] pattern)
+    private static int findPatternCode(List<byte[]> codeTable, byte[] pattern)
     {
         int foundCode = -1;
         int foundLen = 0;
@@ -268,7 +274,7 @@
      * Init the code table with 1 byte entries and the EOD and CLEAR_TABLE
      * markers.
      */
-    private List<byte[]> createCodeTable()
+    private static List<byte[]> createCodeTable()
     {
         List<byte[]> codeTable = new ArrayList<byte[]>(4096);
         for (int i = 0; i < 256; ++i)
@@ -288,7 +294,7 @@
      *
      * @return a value between 9 and 12
      */
-    private int calculateChunk(int tabSize, int earlyChange)
+    private static int calculateChunk(int tabSize, int earlyChange)
     {
         if (tabSize >= 2048 - earlyChange)
         {
Index: src/main/java/org/apache/pdfbox/filter/MissingImageReaderException.java
===================================================================
--- src/main/java/org/apache/pdfbox/filter/MissingImageReaderException.java	(Revision 1666829)
+++ src/main/java/org/apache/pdfbox/filter/MissingImageReaderException.java	(Arbeitskopie)
@@ -25,6 +25,11 @@
  */
 public class MissingImageReaderException extends IOException
 {
+    /**
+     * 
+     */
+    private static final long serialVersionUID = 1L;
+
     public MissingImageReaderException(String message)
     {
         super(message);
Index: src/main/java/org/apache/pdfbox/filter/Predictor.java
===================================================================
--- src/main/java/org/apache/pdfbox/filter/Predictor.java	(Revision 1666829)
+++ src/main/java/org/apache/pdfbox/filter/Predictor.java	(Arbeitskopie)
@@ -18,6 +18,7 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+
 import org.apache.pdfbox.io.IOUtils;
 
 /**
