commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1415850 [6/15] - in /commons/proper/io/trunk/src: main/java/org/apache/commons/io/ main/java/org/apache/commons/io/comparator/ main/java/org/apache/commons/io/filefilter/ main/java/org/apache/commons/io/input/ main/java/org/apache/commons/...
Date Fri, 30 Nov 2012 20:52:08 GMT
Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/CountingOutputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/CountingOutputStream.java?rev=1415850&r1=1415849&r2=1415850&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/CountingOutputStream.java (original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/CountingOutputStream.java Fri Nov 30 20:51:39 2012
@@ -37,7 +37,7 @@ public class CountingOutputStream extend
      * 
      * @param out  the OutputStream to write to
      */
-    public CountingOutputStream( OutputStream out ) {
+    public CountingOutputStream( final OutputStream out ) {
         super(out);
     }
 
@@ -50,7 +50,7 @@ public class CountingOutputStream extend
      * @since 2.0
      */
     @Override
-    protected synchronized void beforeWrite(int n) {
+    protected synchronized void beforeWrite(final int n) {
         count += n;
     }
 
@@ -66,7 +66,7 @@ public class CountingOutputStream extend
      * @throws ArithmeticException if the byte count is too large
      */
     public int getCount() {
-        long result = getByteCount();
+        final long result = getByteCount();
         if (result > Integer.MAX_VALUE) {
             throw new ArithmeticException("The byte count " + result + " is too large to be converted to an int");
         }
@@ -84,7 +84,7 @@ public class CountingOutputStream extend
      * @throws ArithmeticException if the byte count is too large
      */
     public int resetCount() {
-        long result = resetByteCount();
+        final long result = resetByteCount();
         if (result > Integer.MAX_VALUE) {
             throw new ArithmeticException("The byte count " + result + " is too large to be converted to an int");
         }
@@ -116,7 +116,7 @@ public class CountingOutputStream extend
      * @since 1.3
      */
     public synchronized long resetByteCount() {
-        long tmp = this.count;
+        final long tmp = this.count;
         this.count = 0;
         return tmp;
     }

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/DeferredFileOutputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/DeferredFileOutputStream.java?rev=1415850&r1=1415849&r2=1415850&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/DeferredFileOutputStream.java (original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/DeferredFileOutputStream.java Fri Nov 30 20:51:39 2012
@@ -96,7 +96,7 @@ public class DeferredFileOutputStream
      * @param threshold  The number of bytes at which to trigger an event.
      * @param outputFile The file to which data is saved beyond the threshold.
      */
-    public DeferredFileOutputStream(int threshold, File outputFile)
+    public DeferredFileOutputStream(final int threshold, final File outputFile)
     {
         this(threshold,  outputFile, null, null, null);
     }
@@ -113,7 +113,7 @@ public class DeferredFileOutputStream
      *
      * @since 1.4
      */
-    public DeferredFileOutputStream(int threshold, String prefix, String suffix, File directory)
+    public DeferredFileOutputStream(final int threshold, final String prefix, final String suffix, final File directory)
     {
         this(threshold, null, prefix, suffix, directory);
         if (prefix == null) {
@@ -131,7 +131,7 @@ public class DeferredFileOutputStream
      * @param suffix Suffix to use for the temporary file.
      * @param directory Temporary file directory.
      */
-    private DeferredFileOutputStream(int threshold, File outputFile, String prefix, String suffix, File directory) {
+    private DeferredFileOutputStream(final int threshold, final File outputFile, final String prefix, final String suffix, final File directory) {
         super(threshold);
         this.outputFile = outputFile;
 
@@ -175,7 +175,7 @@ public class DeferredFileOutputStream
         if (prefix != null) {
             outputFile = File.createTempFile(prefix, suffix, directory);
         }
-        FileOutputStream fos = new FileOutputStream(outputFile);
+        final FileOutputStream fos = new FileOutputStream(outputFile);
         memoryOutputStream.writeTo(fos);
         currentOutputStream = fos;
         memoryOutputStream = null;
@@ -256,7 +256,7 @@ public class DeferredFileOutputStream
      * @param out output stream to write to.
      * @exception IOException if this stream is not yet closed or an error occurs.
      */
-    public void writeTo(OutputStream out) throws IOException 
+    public void writeTo(final OutputStream out) throws IOException 
     {
         // we may only need to check if this is closed if we are working with a file
         // but we should force the habit of closing wether we are working with
@@ -272,7 +272,7 @@ public class DeferredFileOutputStream
         }
         else
         {
-            FileInputStream fis = new FileInputStream(outputFile);
+            final FileInputStream fis = new FileInputStream(outputFile);
             try {
                 IOUtils.copy(fis, out);
             } finally {

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/DemuxOutputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/DemuxOutputStream.java?rev=1415850&r1=1415849&r2=1415850&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/DemuxOutputStream.java (original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/DemuxOutputStream.java Fri Nov 30 20:51:39 2012
@@ -36,9 +36,9 @@ public class DemuxOutputStream
      * @param output the stream to bind
      * @return the OutputStream that was previously active
      */
-    public OutputStream bindStream( OutputStream output )
+    public OutputStream bindStream( final OutputStream output )
     {
-        OutputStream stream = m_streams.get();
+        final OutputStream stream = m_streams.get();
         m_streams.set( output );
         return stream;
     }
@@ -52,7 +52,7 @@ public class DemuxOutputStream
     public void close()
         throws IOException
     {
-        OutputStream output = m_streams.get();
+        final OutputStream output = m_streams.get();
         if( null != output )
         {
             output.close();
@@ -68,7 +68,7 @@ public class DemuxOutputStream
     public void flush()
         throws IOException
     {
-        OutputStream output = m_streams.get();
+        final OutputStream output = m_streams.get();
         if( null != output )
         {
             output.flush();
@@ -82,10 +82,10 @@ public class DemuxOutputStream
      * @throws IOException if an error occurs
      */
     @Override
-    public void write( int ch )
+    public void write( final int ch )
         throws IOException
     {
-        OutputStream output = m_streams.get();
+        final OutputStream output = m_streams.get();
         if( null != output )
         {
             output.write( ch );

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/FileWriterWithEncoding.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/FileWriterWithEncoding.java?rev=1415850&r1=1415849&r2=1415850&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/FileWriterWithEncoding.java (original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/FileWriterWithEncoding.java Fri Nov 30 20:51:39 2012
@@ -62,7 +62,7 @@ public class FileWriterWithEncoding exte
      * @throws NullPointerException if the file name or encoding is null
      * @throws IOException in case of an I/O error
      */
-    public FileWriterWithEncoding(String filename, String encoding) throws IOException {
+    public FileWriterWithEncoding(final String filename, final String encoding) throws IOException {
         this(new File(filename), encoding, false);
     }
 
@@ -75,7 +75,7 @@ public class FileWriterWithEncoding exte
      * @throws NullPointerException if the file name or encoding is null
      * @throws IOException in case of an I/O error
      */
-    public FileWriterWithEncoding(String filename, String encoding, boolean append) throws IOException {
+    public FileWriterWithEncoding(final String filename, final String encoding, final boolean append) throws IOException {
         this(new File(filename), encoding, append);
     }
 
@@ -87,7 +87,7 @@ public class FileWriterWithEncoding exte
      * @throws NullPointerException if the file name or encoding is null
      * @throws IOException in case of an I/O error
      */
-    public FileWriterWithEncoding(String filename, Charset encoding) throws IOException {
+    public FileWriterWithEncoding(final String filename, final Charset encoding) throws IOException {
         this(new File(filename), encoding, false);
     }
 
@@ -100,7 +100,7 @@ public class FileWriterWithEncoding exte
      * @throws NullPointerException if the file name or encoding is null
      * @throws IOException in case of an I/O error
      */
-    public FileWriterWithEncoding(String filename, Charset encoding, boolean append) throws IOException {
+    public FileWriterWithEncoding(final String filename, final Charset encoding, final boolean append) throws IOException {
         this(new File(filename), encoding, append);
     }
 
@@ -112,7 +112,7 @@ public class FileWriterWithEncoding exte
      * @throws NullPointerException if the file name or encoding is null
      * @throws IOException in case of an I/O error
      */
-    public FileWriterWithEncoding(String filename, CharsetEncoder encoding) throws IOException {
+    public FileWriterWithEncoding(final String filename, final CharsetEncoder encoding) throws IOException {
         this(new File(filename), encoding, false);
     }
 
@@ -125,7 +125,7 @@ public class FileWriterWithEncoding exte
      * @throws NullPointerException if the file name or encoding is null
      * @throws IOException in case of an I/O error
      */
-    public FileWriterWithEncoding(String filename, CharsetEncoder encoding, boolean append) throws IOException {
+    public FileWriterWithEncoding(final String filename, final CharsetEncoder encoding, final boolean append) throws IOException {
         this(new File(filename), encoding, append);
     }
 
@@ -137,7 +137,7 @@ public class FileWriterWithEncoding exte
      * @throws NullPointerException if the file or encoding is null
      * @throws IOException in case of an I/O error
      */
-    public FileWriterWithEncoding(File file, String encoding) throws IOException {
+    public FileWriterWithEncoding(final File file, final String encoding) throws IOException {
         this(file, encoding, false);
     }
 
@@ -150,7 +150,7 @@ public class FileWriterWithEncoding exte
      * @throws NullPointerException if the file or encoding is null
      * @throws IOException in case of an I/O error
      */
-    public FileWriterWithEncoding(File file, String encoding, boolean append) throws IOException {
+    public FileWriterWithEncoding(final File file, final String encoding, final boolean append) throws IOException {
         super();
         this.out = initWriter(file, encoding, append);
     }
@@ -163,7 +163,7 @@ public class FileWriterWithEncoding exte
      * @throws NullPointerException if the file or encoding is null
      * @throws IOException in case of an I/O error
      */
-    public FileWriterWithEncoding(File file, Charset encoding) throws IOException {
+    public FileWriterWithEncoding(final File file, final Charset encoding) throws IOException {
         this(file, encoding, false);
     }
 
@@ -176,7 +176,7 @@ public class FileWriterWithEncoding exte
      * @throws NullPointerException if the file or encoding is null
      * @throws IOException in case of an I/O error
      */
-    public FileWriterWithEncoding(File file, Charset encoding, boolean append) throws IOException {
+    public FileWriterWithEncoding(final File file, final Charset encoding, final boolean append) throws IOException {
         super();
         this.out = initWriter(file, encoding, append);
     }
@@ -189,7 +189,7 @@ public class FileWriterWithEncoding exte
      * @throws NullPointerException if the file or encoding is null
      * @throws IOException in case of an I/O error
      */
-    public FileWriterWithEncoding(File file, CharsetEncoder encoding) throws IOException {
+    public FileWriterWithEncoding(final File file, final CharsetEncoder encoding) throws IOException {
         this(file, encoding, false);
     }
 
@@ -202,7 +202,7 @@ public class FileWriterWithEncoding exte
      * @throws NullPointerException if the file or encoding is null
      * @throws IOException in case of an I/O error
      */
-    public FileWriterWithEncoding(File file, CharsetEncoder encoding, boolean append) throws IOException {
+    public FileWriterWithEncoding(final File file, final CharsetEncoder encoding, final boolean append) throws IOException {
         super();
         this.out = initWriter(file, encoding, append);
     }
@@ -219,14 +219,14 @@ public class FileWriterWithEncoding exte
      * @throws NullPointerException if the file or encoding is null
      * @throws IOException if an error occurs
      */
-     private static Writer initWriter(File file, Object encoding, boolean append) throws IOException {
+     private static Writer initWriter(final File file, final Object encoding, final boolean append) throws IOException {
         if (file == null) {
             throw new NullPointerException("File is missing");
         }
         if (encoding == null) {
             throw new NullPointerException("Encoding is missing");
         }
-        boolean fileExistedAlready = file.exists();
+        final boolean fileExistedAlready = file.exists();
         OutputStream stream = null;
         Writer writer = null;
         try {
@@ -238,14 +238,14 @@ public class FileWriterWithEncoding exte
             } else {
                 writer = new OutputStreamWriter(stream, (String)encoding);
             }
-        } catch (IOException ex) {
+        } catch (final IOException ex) {
             IOUtils.closeQuietly(writer);
             IOUtils.closeQuietly(stream);
             if (fileExistedAlready == false) {
                 FileUtils.deleteQuietly(file);
             }
             throw ex;
-        } catch (RuntimeException ex) {
+        } catch (final RuntimeException ex) {
             IOUtils.closeQuietly(writer);
             IOUtils.closeQuietly(stream);
             if (fileExistedAlready == false) {
@@ -263,7 +263,7 @@ public class FileWriterWithEncoding exte
      * @throws IOException if an I/O error occurs
      */
      @Override
-    public void write(int idx) throws IOException {
+    public void write(final int idx) throws IOException {
         out.write(idx);
     }
 
@@ -273,7 +273,7 @@ public class FileWriterWithEncoding exte
      * @throws IOException if an I/O error occurs
      */
      @Override
-    public void write(char[] chr) throws IOException {
+    public void write(final char[] chr) throws IOException {
         out.write(chr);
     }
 
@@ -285,7 +285,7 @@ public class FileWriterWithEncoding exte
      * @throws IOException if an I/O error occurs
      */
      @Override
-    public void write(char[] chr, int st, int end) throws IOException {
+    public void write(final char[] chr, final int st, final int end) throws IOException {
         out.write(chr, st, end);
     }
 
@@ -295,7 +295,7 @@ public class FileWriterWithEncoding exte
      * @throws IOException if an I/O error occurs
      */
      @Override
-    public void write(String str) throws IOException {
+    public void write(final String str) throws IOException {
         out.write(str);
     }
 
@@ -307,7 +307,7 @@ public class FileWriterWithEncoding exte
      * @throws IOException if an I/O error occurs
      */
      @Override
-    public void write(String str, int st, int end) throws IOException {
+    public void write(final String str, final int st, final int end) throws IOException {
         out.write(str, st, end);
     }
 

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/LockableFileWriter.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/LockableFileWriter.java?rev=1415850&r1=1415849&r2=1415850&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/LockableFileWriter.java (original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/LockableFileWriter.java Fri Nov 30 20:51:39 2012
@@ -70,7 +70,7 @@ public class LockableFileWriter extends 
      * @throws NullPointerException if the file is null
      * @throws IOException in case of an I/O error
      */
-    public LockableFileWriter(String fileName) throws IOException {
+    public LockableFileWriter(final String fileName) throws IOException {
         this(fileName, false, null);
     }
 
@@ -82,7 +82,7 @@ public class LockableFileWriter extends 
      * @throws NullPointerException if the file is null
      * @throws IOException in case of an I/O error
      */
-    public LockableFileWriter(String fileName, boolean append) throws IOException {
+    public LockableFileWriter(final String fileName, final boolean append) throws IOException {
         this(fileName, append, null);
     }
 
@@ -95,7 +95,7 @@ public class LockableFileWriter extends 
      * @throws NullPointerException if the file is null
      * @throws IOException in case of an I/O error
      */
-    public LockableFileWriter(String fileName, boolean append, String lockDir) throws IOException {
+    public LockableFileWriter(final String fileName, final boolean append, final String lockDir) throws IOException {
         this(new File(fileName), append, lockDir);
     }
 
@@ -107,7 +107,7 @@ public class LockableFileWriter extends 
      * @throws NullPointerException if the file is null
      * @throws IOException in case of an I/O error
      */
-    public LockableFileWriter(File file) throws IOException {
+    public LockableFileWriter(final File file) throws IOException {
         this(file, false, null);
     }
 
@@ -119,7 +119,7 @@ public class LockableFileWriter extends 
      * @throws NullPointerException if the file is null
      * @throws IOException in case of an I/O error
      */
-    public LockableFileWriter(File file, boolean append) throws IOException {
+    public LockableFileWriter(final File file, final boolean append) throws IOException {
         this(file, append, null);
     }
 
@@ -132,7 +132,7 @@ public class LockableFileWriter extends 
      * @throws NullPointerException if the file is null
      * @throws IOException in case of an I/O error
      */
-    public LockableFileWriter(File file, boolean append, String lockDir) throws IOException {
+    public LockableFileWriter(final File file, final boolean append, final String lockDir) throws IOException {
         this(file, Charset.defaultCharset(), append, lockDir);
     }
 
@@ -145,7 +145,7 @@ public class LockableFileWriter extends 
      * @throws IOException in case of an I/O error
      * @since 2.3
      */
-    public LockableFileWriter(File file, Charset encoding) throws IOException {
+    public LockableFileWriter(final File file, final Charset encoding) throws IOException {
         this(file, encoding, false, null);
     }
 
@@ -160,7 +160,7 @@ public class LockableFileWriter extends 
      *             thrown instead of {@link UnsupportedEncodingException} in version 2.2 if the encoding is not
      *             supported.
      */
-    public LockableFileWriter(File file, String encoding) throws IOException {
+    public LockableFileWriter(final File file, final String encoding) throws IOException {
         this(file, encoding, false, null);
     }
 
@@ -175,7 +175,7 @@ public class LockableFileWriter extends 
      * @throws IOException in case of an I/O error
      * @since 2.3
      */
-    public LockableFileWriter(File file, Charset encoding, boolean append,
+    public LockableFileWriter(File file, final Charset encoding, final boolean append,
             String lockDir) throws IOException {
         super();
         // init file to create/append
@@ -191,7 +191,7 @@ public class LockableFileWriter extends 
         if (lockDir == null) {
             lockDir = System.getProperty("java.io.tmpdir");
         }
-        File lockDirFile = new File(lockDir);
+        final File lockDirFile = new File(lockDir);
         FileUtils.forceMkdir(lockDirFile);
         testLockDir(lockDirFile);
         lockFile = new File(lockDirFile, file.getName() + LCK);
@@ -216,8 +216,8 @@ public class LockableFileWriter extends 
      *             thrown instead of {@link UnsupportedEncodingException} in version 2.2 if the encoding is not
      *             supported.
      */
-    public LockableFileWriter(File file, String encoding, boolean append,
-            String lockDir) throws IOException {
+    public LockableFileWriter(final File file, final String encoding, final boolean append,
+            final String lockDir) throws IOException {
         this(file, Charsets.toCharset(encoding), append, lockDir);
     }
 
@@ -229,7 +229,7 @@ public class LockableFileWriter extends 
      * @throws IOException if we cannot write to the lock directory
      * @throws IOException if we cannot find the lock file
      */
-    private void testLockDir(File lockDir) throws IOException {
+    private void testLockDir(final File lockDir) throws IOException {
         if (!lockDir.exists()) {
             throw new IOException(
                     "Could not find lockDir: " + lockDir.getAbsolutePath());
@@ -265,14 +265,14 @@ public class LockableFileWriter extends 
      * @return The initialised writer
      * @throws IOException if an error occurs
      */
-    private Writer initWriter(File file, Charset encoding, boolean append) throws IOException {
-        boolean fileExistedAlready = file.exists();
+    private Writer initWriter(final File file, final Charset encoding, final boolean append) throws IOException {
+        final boolean fileExistedAlready = file.exists();
         OutputStream stream = null;
         Writer writer = null;
         try {
             stream = new FileOutputStream(file.getAbsolutePath(), append);
             writer = new OutputStreamWriter(stream, Charsets.toCharset(encoding));
-        } catch (IOException ex) {
+        } catch (final IOException ex) {
             IOUtils.closeQuietly(writer);
             IOUtils.closeQuietly(stream);
             FileUtils.deleteQuietly(lockFile);
@@ -280,7 +280,7 @@ public class LockableFileWriter extends 
                 FileUtils.deleteQuietly(file);
             }
             throw ex;
-        } catch (RuntimeException ex) {
+        } catch (final RuntimeException ex) {
             IOUtils.closeQuietly(writer);
             IOUtils.closeQuietly(stream);
             FileUtils.deleteQuietly(lockFile);
@@ -314,7 +314,7 @@ public class LockableFileWriter extends 
      * @throws IOException if an I/O error occurs
      */
     @Override
-    public void write(int idx) throws IOException {
+    public void write(final int idx) throws IOException {
         out.write(idx);
     }
 
@@ -324,7 +324,7 @@ public class LockableFileWriter extends 
      * @throws IOException if an I/O error occurs
      */
     @Override
-    public void write(char[] chr) throws IOException {
+    public void write(final char[] chr) throws IOException {
         out.write(chr);
     }
 
@@ -336,7 +336,7 @@ public class LockableFileWriter extends 
      * @throws IOException if an I/O error occurs
      */
     @Override
-    public void write(char[] chr, int st, int end) throws IOException {
+    public void write(final char[] chr, final int st, final int end) throws IOException {
         out.write(chr, st, end);
     }
 
@@ -346,7 +346,7 @@ public class LockableFileWriter extends 
      * @throws IOException if an I/O error occurs
      */
     @Override
-    public void write(String str) throws IOException {
+    public void write(final String str) throws IOException {
         out.write(str);
     }
 
@@ -358,7 +358,7 @@ public class LockableFileWriter extends 
      * @throws IOException if an I/O error occurs
      */
     @Override
-    public void write(String str, int st, int end) throws IOException {
+    public void write(final String str, final int st, final int end) throws IOException {
         out.write(str, st, end);
     }
 

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/NullOutputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/NullOutputStream.java?rev=1415850&r1=1415849&r2=1415850&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/NullOutputStream.java (original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/NullOutputStream.java Fri Nov 30 20:51:39 2012
@@ -41,7 +41,7 @@ public class NullOutputStream extends Ou
      * @param len The number of bytes to write
      */
     @Override
-    public void write(byte[] b, int off, int len) {
+    public void write(final byte[] b, final int off, final int len) {
         //to /dev/null
     }
 
@@ -50,7 +50,7 @@ public class NullOutputStream extends Ou
      * @param b The byte to write
      */
     @Override
-    public void write(int b) {
+    public void write(final int b) {
         //to /dev/null
     }
 
@@ -60,7 +60,7 @@ public class NullOutputStream extends Ou
      * @throws IOException never
      */
     @Override
-    public void write(byte[] b) throws IOException {
+    public void write(final byte[] b) throws IOException {
         //to /dev/null
     }
 

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/NullWriter.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/NullWriter.java?rev=1415850&r1=1415849&r2=1415850&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/NullWriter.java (original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/NullWriter.java Fri Nov 30 20:51:39 2012
@@ -46,7 +46,7 @@ public class NullWriter extends Writer {
      * @since 2.0
      */
     @Override
-    public Writer append(char c) {
+    public Writer append(final char c) {
         //to /dev/null
         return this;
     }
@@ -60,7 +60,7 @@ public class NullWriter extends Writer {
      * @since 2.0
      */
     @Override
-    public Writer append(CharSequence csq, int start, int end) {
+    public Writer append(final CharSequence csq, final int start, final int end) {
         //to /dev/null
         return this;
     }
@@ -72,7 +72,7 @@ public class NullWriter extends Writer {
      * @since 2.0
      */
     @Override
-    public Writer append(CharSequence csq) {
+    public Writer append(final CharSequence csq) {
         //to /dev/null
         return this;
     }
@@ -82,7 +82,7 @@ public class NullWriter extends Writer {
      * @param idx The character to write
      */
     @Override
-    public void write(int idx) {
+    public void write(final int idx) {
         //to /dev/null
     }
 
@@ -91,7 +91,7 @@ public class NullWriter extends Writer {
      * @param chr The characters to write
      */
     @Override
-    public void write(char[] chr) {
+    public void write(final char[] chr) {
         //to /dev/null
     }
 
@@ -102,7 +102,7 @@ public class NullWriter extends Writer {
      * @param end The number of characters to write
      */
     @Override
-    public void write(char[] chr, int st, int end) {
+    public void write(final char[] chr, final int st, final int end) {
         //to /dev/null
     }
 
@@ -111,7 +111,7 @@ public class NullWriter extends Writer {
      * @param str The string to write
      */
     @Override
-    public void write(String str) {
+    public void write(final String str) {
         //to /dev/null
     }
 
@@ -122,7 +122,7 @@ public class NullWriter extends Writer {
      * @param end The number of characters to write
      */
     @Override
-    public void write(String str, int st, int end) {
+    public void write(final String str, final int st, final int end) {
         //to /dev/null
     }
 

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/ProxyOutputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/ProxyOutputStream.java?rev=1415850&r1=1415849&r2=1415850&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/ProxyOutputStream.java (original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/ProxyOutputStream.java Fri Nov 30 20:51:39 2012
@@ -38,7 +38,7 @@ public class ProxyOutputStream extends F
      * 
      * @param proxy  the OutputStream to delegate to
      */
-    public ProxyOutputStream(OutputStream proxy) {
+    public ProxyOutputStream(final OutputStream proxy) {
         super(proxy);
         // the proxy is stored in a protected superclass variable named 'out'
     }
@@ -49,12 +49,12 @@ public class ProxyOutputStream extends F
      * @throws IOException if an I/O error occurs
      */
     @Override
-    public void write(int idx) throws IOException {
+    public void write(final int idx) throws IOException {
         try {
             beforeWrite(1);
             out.write(idx);
             afterWrite(1);
-        } catch (IOException e) {
+        } catch (final IOException e) {
             handleIOException(e);
         }
     }
@@ -65,13 +65,13 @@ public class ProxyOutputStream extends F
      * @throws IOException if an I/O error occurs
      */
     @Override
-    public void write(byte[] bts) throws IOException {
+    public void write(final byte[] bts) throws IOException {
         try {
-            int len = bts != null ? bts.length : 0;
+            final int len = bts != null ? bts.length : 0;
             beforeWrite(len);
             out.write(bts);
             afterWrite(len);
-        } catch (IOException e) {
+        } catch (final IOException e) {
             handleIOException(e);
         }
     }
@@ -84,12 +84,12 @@ public class ProxyOutputStream extends F
      * @throws IOException if an I/O error occurs
      */
     @Override
-    public void write(byte[] bts, int st, int end) throws IOException {
+    public void write(final byte[] bts, final int st, final int end) throws IOException {
         try {
             beforeWrite(end);
             out.write(bts, st, end);
             afterWrite(end);
-        } catch (IOException e) {
+        } catch (final IOException e) {
             handleIOException(e);
         }
     }
@@ -102,7 +102,7 @@ public class ProxyOutputStream extends F
     public void flush() throws IOException {
         try {
             out.flush();
-        } catch (IOException e) {
+        } catch (final IOException e) {
             handleIOException(e);
         }
     }
@@ -115,7 +115,7 @@ public class ProxyOutputStream extends F
     public void close() throws IOException {
         try {
             out.close();
-        } catch (IOException e) {
+        } catch (final IOException e) {
             handleIOException(e);
         }
     }
@@ -133,7 +133,7 @@ public class ProxyOutputStream extends F
      * @param n number of bytes to be written
      * @throws IOException if the pre-processing fails
      */
-    protected void beforeWrite(int n) throws IOException {
+    protected void beforeWrite(final int n) throws IOException {
     }
 
     /**
@@ -150,7 +150,7 @@ public class ProxyOutputStream extends F
      * @param n number of bytes written
      * @throws IOException if the post-processing fails
      */
-    protected void afterWrite(int n) throws IOException {
+    protected void afterWrite(final int n) throws IOException {
     }
 
     /**
@@ -162,7 +162,7 @@ public class ProxyOutputStream extends F
      * @throws IOException if an I/O error occurs
      * @since 2.0
      */
-    protected void handleIOException(IOException e) throws IOException {
+    protected void handleIOException(final IOException e) throws IOException {
         throw e;
     }
 

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/ProxyWriter.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/ProxyWriter.java?rev=1415850&r1=1415849&r2=1415850&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/ProxyWriter.java (original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/ProxyWriter.java Fri Nov 30 20:51:39 2012
@@ -37,7 +37,7 @@ public class ProxyWriter extends FilterW
      * 
      * @param proxy  the Writer to delegate to
      */
-    public ProxyWriter(Writer proxy) {
+    public ProxyWriter(final Writer proxy) {
         super(proxy);
         // the proxy is stored in a protected superclass variable named 'out'
     }
@@ -50,12 +50,12 @@ public class ProxyWriter extends FilterW
      * @since 2.0
      */
     @Override
-    public Writer append(char c) throws IOException {
+    public Writer append(final char c) throws IOException {
         try {
             beforeWrite(1);
             out.append(c);
             afterWrite(1);
-        } catch (IOException e) {
+        } catch (final IOException e) {
             handleIOException(e);
         }
         return this;
@@ -71,12 +71,12 @@ public class ProxyWriter extends FilterW
      * @since 2.0
      */
     @Override
-    public Writer append(CharSequence csq, int start, int end) throws IOException {
+    public Writer append(final CharSequence csq, final int start, final int end) throws IOException {
         try {
             beforeWrite(end - start);
             out.append(csq, start, end);
             afterWrite(end - start);
-        } catch (IOException e) {
+        } catch (final IOException e) {
             handleIOException(e);
         }
         return this;
@@ -90,7 +90,7 @@ public class ProxyWriter extends FilterW
      * @since 2.0
      */
     @Override
-    public Writer append(CharSequence csq) throws IOException {
+    public Writer append(final CharSequence csq) throws IOException {
         try {
             int len = 0;
             if (csq != null) {
@@ -100,7 +100,7 @@ public class ProxyWriter extends FilterW
             beforeWrite(len);
             out.append(csq);
             afterWrite(len);
-        } catch (IOException e) {
+        } catch (final IOException e) {
             handleIOException(e);
         }
         return this;
@@ -112,12 +112,12 @@ public class ProxyWriter extends FilterW
      * @throws IOException if an I/O error occurs
      */
     @Override
-    public void write(int idx) throws IOException {
+    public void write(final int idx) throws IOException {
         try {
             beforeWrite(1);
             out.write(idx);
             afterWrite(1);
-        } catch (IOException e) {
+        } catch (final IOException e) {
             handleIOException(e);
         }
     }
@@ -128,7 +128,7 @@ public class ProxyWriter extends FilterW
      * @throws IOException if an I/O error occurs
      */
     @Override
-    public void write(char[] chr) throws IOException {
+    public void write(final char[] chr) throws IOException {
         try {
             int len = 0;
             if (chr != null) {
@@ -138,7 +138,7 @@ public class ProxyWriter extends FilterW
             beforeWrite(len);
             out.write(chr);
             afterWrite(len);
-        } catch (IOException e) {
+        } catch (final IOException e) {
             handleIOException(e);
         }
     }
@@ -151,12 +151,12 @@ public class ProxyWriter extends FilterW
      * @throws IOException if an I/O error occurs
      */
     @Override
-    public void write(char[] chr, int st, int len) throws IOException {
+    public void write(final char[] chr, final int st, final int len) throws IOException {
         try {
             beforeWrite(len);
             out.write(chr, st, len);
             afterWrite(len);
-        } catch (IOException e) {
+        } catch (final IOException e) {
             handleIOException(e);
         }
     }
@@ -167,7 +167,7 @@ public class ProxyWriter extends FilterW
      * @throws IOException if an I/O error occurs
      */
     @Override
-    public void write(String str) throws IOException {
+    public void write(final String str) throws IOException {
         try {
             int len = 0;
             if (str != null) {
@@ -177,7 +177,7 @@ public class ProxyWriter extends FilterW
             beforeWrite(len);
             out.write(str);
             afterWrite(len);
-        } catch (IOException e) {
+        } catch (final IOException e) {
             handleIOException(e);
         }
     }
@@ -190,12 +190,12 @@ public class ProxyWriter extends FilterW
      * @throws IOException if an I/O error occurs
      */
     @Override
-    public void write(String str, int st, int len) throws IOException {
+    public void write(final String str, final int st, final int len) throws IOException {
         try {
             beforeWrite(len);
             out.write(str, st, len);
             afterWrite(len);
-        } catch (IOException e) {
+        } catch (final IOException e) {
             handleIOException(e);
         }
     }
@@ -208,7 +208,7 @@ public class ProxyWriter extends FilterW
     public void flush() throws IOException {
         try {
             out.flush();
-        } catch (IOException e) {
+        } catch (final IOException e) {
             handleIOException(e);
         }
     }
@@ -221,7 +221,7 @@ public class ProxyWriter extends FilterW
     public void close() throws IOException {
         try {
             out.close();
-        } catch (IOException e) {
+        } catch (final IOException e) {
             handleIOException(e);
         }
     }
@@ -239,7 +239,7 @@ public class ProxyWriter extends FilterW
      * @param n number of chars to be written
      * @throws IOException if the pre-processing fails
      */
-    protected void beforeWrite(int n) throws IOException {
+    protected void beforeWrite(final int n) throws IOException {
     }
 
     /**
@@ -256,7 +256,7 @@ public class ProxyWriter extends FilterW
      * @param n number of chars written
      * @throws IOException if the post-processing fails
      */
-    protected void afterWrite(int n) throws IOException {
+    protected void afterWrite(final int n) throws IOException {
     }
 
     /**
@@ -268,7 +268,7 @@ public class ProxyWriter extends FilterW
      * @throws IOException if an I/O error occurs
      * @since 2.0
      */
-    protected void handleIOException(IOException e) throws IOException {
+    protected void handleIOException(final IOException e) throws IOException {
         throw e;
     }
 

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/StringBuilderWriter.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/StringBuilderWriter.java?rev=1415850&r1=1415849&r2=1415850&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/StringBuilderWriter.java (original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/StringBuilderWriter.java Fri Nov 30 20:51:39 2012
@@ -47,7 +47,7 @@ public class StringBuilderWriter extends
      *
      * @param capacity The initial capacity of the underlying {@link StringBuilder}
      */
-    public StringBuilderWriter(int capacity) {
+    public StringBuilderWriter(final int capacity) {
         this.builder = new StringBuilder(capacity);
     }
 
@@ -56,7 +56,7 @@ public class StringBuilderWriter extends
      *
      * @param builder The String builder
      */
-    public StringBuilderWriter(StringBuilder builder) {
+    public StringBuilderWriter(final StringBuilder builder) {
         this.builder = builder != null ? builder : new StringBuilder();
     }
 
@@ -67,7 +67,7 @@ public class StringBuilderWriter extends
      * @return This writer instance
      */
     @Override
-    public Writer append(char value) {
+    public Writer append(final char value) {
         builder.append(value);
         return this;
     }
@@ -79,7 +79,7 @@ public class StringBuilderWriter extends
      * @return This writer instance
      */
     @Override
-    public Writer append(CharSequence value) {
+    public Writer append(final CharSequence value) {
         builder.append(value);
         return this;
     }
@@ -93,7 +93,7 @@ public class StringBuilderWriter extends
      * @return This writer instance
      */
     @Override
-    public Writer append(CharSequence value, int start, int end) {
+    public Writer append(final CharSequence value, final int start, final int end) {
         builder.append(value, start, end);
         return this;
     }
@@ -119,7 +119,7 @@ public class StringBuilderWriter extends
      * @param value The value to write
      */
     @Override
-    public void write(String value) {
+    public void write(final String value) {
         if (value != null) {
             builder.append(value);
         }
@@ -133,7 +133,7 @@ public class StringBuilderWriter extends
      * @param length The number of characters to write
      */
     @Override
-    public void write(char[] value, int offset, int length) {
+    public void write(final char[] value, final int offset, final int length) {
         if (value != null) {
             builder.append(value, offset, length);
         }

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/TaggedOutputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/TaggedOutputStream.java?rev=1415850&r1=1415849&r2=1415850&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/TaggedOutputStream.java (original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/TaggedOutputStream.java Fri Nov 30 20:51:39 2012
@@ -73,7 +73,7 @@ public class TaggedOutputStream extends 
      *
      * @param proxy output stream to be decorated
      */
-    public TaggedOutputStream(OutputStream proxy) {
+    public TaggedOutputStream(final OutputStream proxy) {
         super(proxy);
     }
 
@@ -84,7 +84,7 @@ public class TaggedOutputStream extends 
      * @return {@code true} if the exception was thrown by this stream,
      *         {@code false} otherwise
      */
-    public boolean isCauseOf(Exception exception) {
+    public boolean isCauseOf(final Exception exception) {
         return TaggedIOException.isTaggedWith(exception, tag);
     }
 
@@ -98,7 +98,7 @@ public class TaggedOutputStream extends 
      * @param exception an exception
      * @throws IOException original exception, if any, thrown by this stream
      */
-    public void throwIfCauseOf(Exception exception) throws IOException {
+    public void throwIfCauseOf(final Exception exception) throws IOException {
         TaggedIOException.throwCauseIfTaggedWith(exception, tag);
     }
 
@@ -109,7 +109,7 @@ public class TaggedOutputStream extends 
      * @throws IOException if an I/O error occurs
      */
     @Override
-    protected void handleIOException(IOException e) throws IOException {
+    protected void handleIOException(final IOException e) throws IOException {
         throw new TaggedIOException(e, tag);
     }
 

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/TeeOutputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/TeeOutputStream.java?rev=1415850&r1=1415849&r2=1415850&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/TeeOutputStream.java (original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/TeeOutputStream.java Fri Nov 30 20:51:39 2012
@@ -36,7 +36,7 @@ public class TeeOutputStream extends Pro
      * @param out the main OutputStream
      * @param branch the second OutputStream
      */
-    public TeeOutputStream(OutputStream out, OutputStream branch) {
+    public TeeOutputStream(final OutputStream out, final OutputStream branch) {
         super(out);
         this.branch = branch;
     }
@@ -47,7 +47,7 @@ public class TeeOutputStream extends Pro
      * @throws IOException if an I/O error occurs
      */
     @Override
-    public synchronized void write(byte[] b) throws IOException {
+    public synchronized void write(final byte[] b) throws IOException {
         super.write(b);
         this.branch.write(b);
     }
@@ -60,7 +60,7 @@ public class TeeOutputStream extends Pro
      * @throws IOException if an I/O error occurs
      */
     @Override
-    public synchronized void write(byte[] b, int off, int len) throws IOException {
+    public synchronized void write(final byte[] b, final int off, final int len) throws IOException {
         super.write(b, off, len);
         this.branch.write(b, off, len);
     }
@@ -71,7 +71,7 @@ public class TeeOutputStream extends Pro
      * @throws IOException if an I/O error occurs
      */
     @Override
-    public synchronized void write(int b) throws IOException {
+    public synchronized void write(final int b) throws IOException {
         super.write(b);
         this.branch.write(b);
     }

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/ThresholdingOutputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/ThresholdingOutputStream.java?rev=1415850&r1=1415849&r2=1415850&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/ThresholdingOutputStream.java (original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/ThresholdingOutputStream.java Fri Nov 30 20:51:39 2012
@@ -70,7 +70,7 @@ public abstract class ThresholdingOutput
      *
      * @param threshold The number of bytes at which to trigger an event.
      */
-    public ThresholdingOutputStream(int threshold)
+    public ThresholdingOutputStream(final int threshold)
     {
         this.threshold = threshold;
     }
@@ -87,7 +87,7 @@ public abstract class ThresholdingOutput
      * @exception IOException if an error occurs.
      */
     @Override
-    public void write(int b) throws IOException
+    public void write(final int b) throws IOException
     {
         checkThreshold(1);
         getStream().write(b);
@@ -104,7 +104,7 @@ public abstract class ThresholdingOutput
      * @exception IOException if an error occurs.
      */
     @Override
-    public void write(byte b[]) throws IOException
+    public void write(final byte b[]) throws IOException
     {
         checkThreshold(b.length);
         getStream().write(b);
@@ -123,7 +123,7 @@ public abstract class ThresholdingOutput
      * @exception IOException if an error occurs.
      */
     @Override
-    public void write(byte b[], int off, int len) throws IOException
+    public void write(final byte b[], final int off, final int len) throws IOException
     {
         checkThreshold(len);
         getStream().write(b, off, len);
@@ -157,7 +157,7 @@ public abstract class ThresholdingOutput
         {
             flush();
         }
-        catch (IOException ignored)
+        catch (final IOException ignored)
         {
             // ignore
         }
@@ -216,7 +216,7 @@ public abstract class ThresholdingOutput
      *
      * @exception IOException if an error occurs.
      */
-    protected void checkThreshold(int count) throws IOException
+    protected void checkThreshold(final int count) throws IOException
     {
         if (!thresholdExceeded && written + count > threshold)
         {

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/WriterOutputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/WriterOutputStream.java?rev=1415850&r1=1415849&r2=1415850&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/WriterOutputStream.java (original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/WriterOutputStream.java Fri Nov 30 20:51:39 2012
@@ -100,7 +100,7 @@ public class WriterOutputStream extends 
      * @param decoder the charset decoder
      * @since 2.1
      */
-    public WriterOutputStream(Writer writer, CharsetDecoder decoder) {
+    public WriterOutputStream(final Writer writer, final CharsetDecoder decoder) {
         this(writer, decoder, DEFAULT_BUFFER_SIZE, false);
     }
 
@@ -117,7 +117,7 @@ public class WriterOutputStream extends 
      *                         {@link #flush()} or {@link #close()} is called.
      * @since 2.1
      */
-    public WriterOutputStream(Writer writer, CharsetDecoder decoder, int bufferSize, boolean writeImmediately) {
+    public WriterOutputStream(final Writer writer, final CharsetDecoder decoder, final int bufferSize, final boolean writeImmediately) {
         this.writer = writer;
         this.decoder = decoder;
         this.writeImmediately = writeImmediately;
@@ -136,7 +136,7 @@ public class WriterOutputStream extends 
      *                         output buffer will only be flushed when it overflows or when
      *                         {@link #flush()} or {@link #close()} is called.
      */
-    public WriterOutputStream(Writer writer, Charset charset, int bufferSize, boolean writeImmediately) {
+    public WriterOutputStream(final Writer writer, final Charset charset, final int bufferSize, final boolean writeImmediately) {
         this(writer,
              charset.newDecoder()
                     .onMalformedInput(CodingErrorAction.REPLACE)
@@ -154,7 +154,7 @@ public class WriterOutputStream extends 
      * @param writer the target {@link Writer}
      * @param charset the charset encoding
      */
-    public WriterOutputStream(Writer writer, Charset charset) {
+    public WriterOutputStream(final Writer writer, final Charset charset) {
         this(writer, charset, DEFAULT_BUFFER_SIZE, false);
     }
 
@@ -170,7 +170,7 @@ public class WriterOutputStream extends 
      *                         output buffer will only be flushed when it overflows or when
      *                         {@link #flush()} or {@link #close()} is called.
      */
-    public WriterOutputStream(Writer writer, String charsetName, int bufferSize, boolean writeImmediately) {
+    public WriterOutputStream(final Writer writer, final String charsetName, final int bufferSize, final boolean writeImmediately) {
         this(writer, Charset.forName(charsetName), bufferSize, writeImmediately);
     }
 
@@ -182,7 +182,7 @@ public class WriterOutputStream extends 
      * @param writer the target {@link Writer}
      * @param charsetName the name of the charset encoding
      */
-    public WriterOutputStream(Writer writer, String charsetName) {
+    public WriterOutputStream(final Writer writer, final String charsetName) {
         this(writer, charsetName, DEFAULT_BUFFER_SIZE, false);
     }
 
@@ -193,7 +193,7 @@ public class WriterOutputStream extends 
      * 
      * @param writer the target {@link Writer}
      */
-    public WriterOutputStream(Writer writer) {
+    public WriterOutputStream(final Writer writer) {
         this(writer, Charset.defaultCharset(), DEFAULT_BUFFER_SIZE, false);
     }
 
@@ -206,9 +206,9 @@ public class WriterOutputStream extends 
      * @throws IOException if an I/O error occurs
      */
     @Override
-    public void write(byte[] b, int off, int len) throws IOException {
+    public void write(final byte[] b, int off, int len) throws IOException {
         while (len > 0) {
-            int c = Math.min(len, decoderIn.remaining());
+            final int c = Math.min(len, decoderIn.remaining());
             decoderIn.put(b, off, c);
             processInput(false);
             len -= c;
@@ -226,7 +226,7 @@ public class WriterOutputStream extends 
      * @throws IOException if an I/O error occurs
      */
     @Override
-    public void write(byte[] b) throws IOException {
+    public void write(final byte[] b) throws IOException {
         write(b, 0, b.length);
     }
 
@@ -237,7 +237,7 @@ public class WriterOutputStream extends 
      * @throws IOException if an I/O error occurs
      */
     @Override
-    public void write(int b) throws IOException {
+    public void write(final int b) throws IOException {
         write(new byte[] { (byte)b }, 0, 1);
     }
 
@@ -272,7 +272,7 @@ public class WriterOutputStream extends 
      * @param endOfInput indicates end of input
      * @throws IOException if an I/O error occurs
      */
-    private void processInput(boolean endOfInput) throws IOException {
+    private void processInput(final boolean endOfInput) throws IOException {
         // Prepare decoderIn for reading
         decoderIn.flip();
         CoderResult coderResult;

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/XmlStreamWriter.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/XmlStreamWriter.java?rev=1415850&r1=1415849&r2=1415850&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/XmlStreamWriter.java (original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/XmlStreamWriter.java Fri Nov 30 20:51:39 2012
@@ -56,7 +56,7 @@ public class XmlStreamWriter extends Wri
      *
      * @param out The output stream
      */
-    public XmlStreamWriter(OutputStream out) {
+    public XmlStreamWriter(final OutputStream out) {
         this(out, null);
     }
 
@@ -67,7 +67,7 @@ public class XmlStreamWriter extends Wri
      * @param out The output stream
      * @param defaultEncoding The default encoding if not encoding could be detected
      */
-    public XmlStreamWriter(OutputStream out, String defaultEncoding) {
+    public XmlStreamWriter(final OutputStream out, final String defaultEncoding) {
         this.out = out;
         this.defaultEncoding = defaultEncoding != null ? defaultEncoding : "UTF-8";
     }
@@ -80,7 +80,7 @@ public class XmlStreamWriter extends Wri
      * @throws FileNotFoundException if there is an error creating or
      * opening the file
      */
-    public XmlStreamWriter(File file) throws FileNotFoundException {
+    public XmlStreamWriter(final File file) throws FileNotFoundException {
         this(file, null);
     }
 
@@ -93,7 +93,7 @@ public class XmlStreamWriter extends Wri
      * @throws FileNotFoundException if there is an error creating or
      * opening the file
      */
-    public XmlStreamWriter(File file, String defaultEncoding) throws FileNotFoundException {
+    public XmlStreamWriter(final File file, final String defaultEncoding) throws FileNotFoundException {
         this(new FileOutputStream(file), defaultEncoding);
     }
 
@@ -150,10 +150,10 @@ public class XmlStreamWriter extends Wri
      * @param len The number of characters to write
      * @throws IOException if an error occurs detecting the encoding
      */
-    private void detectEncoding(char[] cbuf, int off, int len)
+    private void detectEncoding(final char[] cbuf, final int off, final int len)
             throws IOException {
         int size = len;
-        StringBuffer xmlProlog = xmlPrologWriter.getBuffer();
+        final StringBuffer xmlProlog = xmlPrologWriter.getBuffer();
         if (xmlProlog.length() + len > BUFFER_SIZE) {
             size = BUFFER_SIZE - xmlProlog.length();
         }
@@ -163,10 +163,10 @@ public class XmlStreamWriter extends Wri
         if (xmlProlog.length() >= 5) {
             if (xmlProlog.substring(0, 5).equals("<?xml")) {
                 // try to extract encoding from XML prolog
-                int xmlPrologEnd = xmlProlog.indexOf("?>");
+                final int xmlPrologEnd = xmlProlog.indexOf("?>");
                 if (xmlPrologEnd > 0) {
                     // ok, full XML prolog written: let's extract encoding
-                    Matcher m = ENCODING_PATTERN.matcher(xmlProlog.substring(0,
+                    final Matcher m = ENCODING_PATTERN.matcher(xmlProlog.substring(0,
                             xmlPrologEnd));
                     if (m.find()) {
                         encoding = m.group(1).toUpperCase();
@@ -208,7 +208,7 @@ public class XmlStreamWriter extends Wri
      * @throws IOException if an error occurs detecting the encoding
      */
     @Override
-    public void write(char[] cbuf, int off, int len) throws IOException {
+    public void write(final char[] cbuf, final int off, final int len) throws IOException {
         if (xmlPrologWriter != null) {
             detectEncoding(cbuf, off, len);
         } else {

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/ByteOrderMarkTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/ByteOrderMarkTestCase.java?rev=1415850&r1=1415849&r2=1415850&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/ByteOrderMarkTestCase.java (original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/ByteOrderMarkTestCase.java Fri Nov 30 20:51:39 2012
@@ -33,7 +33,7 @@ public class ByteOrderMarkTestCase exten
     private static final ByteOrderMark TEST_BOM_2 = new ByteOrderMark("test2", 1, 2);
     private static final ByteOrderMark TEST_BOM_3 = new ByteOrderMark("test3", 1, 2, 3);
 
-    public ByteOrderMarkTestCase(String name) {
+    public ByteOrderMarkTestCase(final String name) {
         super(name);
     }
 
@@ -92,7 +92,7 @@ public class ByteOrderMarkTestCase exten
 
     /** Test {@link ByteOrderMark#hashCode()} */
     public void testHashCode() {
-        int bomClassHash = ByteOrderMark.class.hashCode();
+        final int bomClassHash = ByteOrderMark.class.hashCode();
         assertEquals("hash test1 ", bomClassHash + 1,  TEST_BOM_1.hashCode());
         assertEquals("hash test2 ", bomClassHash + 3,  TEST_BOM_2.hashCode());
         assertEquals("hash test3 ", bomClassHash + 6,  TEST_BOM_3.hashCode());
@@ -103,25 +103,25 @@ public class ByteOrderMarkTestCase exten
         try {
             new ByteOrderMark(null, 1,2,3);
             fail("null charset name, expected IllegalArgumentException");
-        } catch (IllegalArgumentException e) {
+        } catch (final IllegalArgumentException e) {
             // expected
         }
         try {
             new ByteOrderMark("", 1,2,3);
             fail("no charset name, expected IllegalArgumentException");
-        } catch (IllegalArgumentException e) {
+        } catch (final IllegalArgumentException e) {
             // expected
         }
         try {
             new ByteOrderMark("a", (int[])null);
             fail("null bytes, expected IllegalArgumentException");
-        } catch (IllegalArgumentException e) {
+        } catch (final IllegalArgumentException e) {
             // expected
         }
         try {
             new ByteOrderMark("b", new int[0]);
             fail("empty bytes, expected IllegalArgumentException");
-        } catch (IllegalArgumentException e) {
+        } catch (final IllegalArgumentException e) {
             // expected
         }
     }

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/CopyUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/CopyUtilsTest.java?rev=1415850&r1=1415849&r2=1415850&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/CopyUtilsTest.java (original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/CopyUtilsTest.java Fri Nov 30 20:51:39 2012
@@ -49,9 +49,9 @@ public class CopyUtilsTest extends FileB
     private static final int FILE_SIZE = 1024 * 4 + 1;
 
 
-    private byte[] inData = generateTestData(FILE_SIZE);
+    private final byte[] inData = generateTestData(FILE_SIZE);
 
-    public CopyUtilsTest(String testName) {
+    public CopyUtilsTest(final String testName) {
         super(testName);
     }
 
@@ -77,8 +77,8 @@ public class CopyUtilsTest extends FileB
     }
     
     public void testCopy_byteArrayToOutputStream() throws Exception {
-        ByteArrayOutputStream baout = new ByteArrayOutputStream();
-        OutputStream out = new YellOnFlushAndCloseOutputStream(baout, false, true);
+        final ByteArrayOutputStream baout = new ByteArrayOutputStream();
+        final OutputStream out = new YellOnFlushAndCloseOutputStream(baout, false, true);
         
         CopyUtils.copy(inData, out);
 
@@ -87,9 +87,9 @@ public class CopyUtilsTest extends FileB
     }
 
     public void testCopy_byteArrayToWriter() throws Exception {
-        ByteArrayOutputStream baout = new ByteArrayOutputStream();
-        OutputStream out = new YellOnFlushAndCloseOutputStream(baout, false, true);
-        Writer writer = new java.io.OutputStreamWriter(out, "US-ASCII");
+        final ByteArrayOutputStream baout = new ByteArrayOutputStream();
+        final OutputStream out = new YellOnFlushAndCloseOutputStream(baout, false, true);
+        final Writer writer = new java.io.OutputStreamWriter(out, "US-ASCII");
         
         CopyUtils.copy(inData, writer);
         writer.flush();
@@ -99,9 +99,9 @@ public class CopyUtilsTest extends FileB
     }
 
     public void testCopy_byteArrayToWriterWithEncoding() throws Exception {
-        String inDataStr = "data";
-        String charsetName = "UTF-8";
-        StringWriter writer = new StringWriter(); 
+        final String inDataStr = "data";
+        final String charsetName = "UTF-8";
+        final StringWriter writer = new StringWriter(); 
         CopyUtils.copy(inDataStr.getBytes(charsetName), writer, charsetName);
         assertEquals(inDataStr, writer.toString());
     }
@@ -110,10 +110,10 @@ public class CopyUtilsTest extends FileB
         InputStream in = new ByteArrayInputStream(inData);
         in = new YellOnCloseInputStream(in);
 
-        ByteArrayOutputStream baout = new ByteArrayOutputStream();
-        OutputStream out = new YellOnFlushAndCloseOutputStream(baout, false, true);
+        final ByteArrayOutputStream baout = new ByteArrayOutputStream();
+        final OutputStream out = new YellOnFlushAndCloseOutputStream(baout, false, true);
 
-        int count = CopyUtils.copy(in, out);
+        final int count = CopyUtils.copy(in, out);
         
         assertEquals("Not all bytes were read", 0, in.available());
         assertEquals("Sizes differ", inData.length, baout.size());
@@ -125,9 +125,9 @@ public class CopyUtilsTest extends FileB
         InputStream in = new ByteArrayInputStream(inData);
         in = new YellOnCloseInputStream(in);
 
-        ByteArrayOutputStream baout = new ByteArrayOutputStream();
-        OutputStream out = new YellOnFlushAndCloseOutputStream(baout, false, true);
-        Writer writer = new java.io.OutputStreamWriter(out, "US-ASCII");
+        final ByteArrayOutputStream baout = new ByteArrayOutputStream();
+        final OutputStream out = new YellOnFlushAndCloseOutputStream(baout, false, true);
+        final Writer writer = new java.io.OutputStreamWriter(out, "US-ASCII");
         
         CopyUtils.copy(in, writer);
         writer.flush();
@@ -138,9 +138,9 @@ public class CopyUtilsTest extends FileB
     }
 
     public void testCopy_inputStreamToWriterWithEncoding() throws Exception {
-        String inDataStr = "data";
-        String charsetName = "UTF-8";
-        StringWriter writer = new StringWriter();
+        final String inDataStr = "data";
+        final String charsetName = "UTF-8";
+        final StringWriter writer = new StringWriter();
         CopyUtils.copy(new ByteArrayInputStream(inDataStr.getBytes(charsetName)), writer, charsetName);
         assertEquals(inDataStr, writer.toString());
     }
@@ -148,10 +148,10 @@ public class CopyUtilsTest extends FileB
     public void testCopy_readerToOutputStream() throws Exception {
         InputStream in = new ByteArrayInputStream(inData);
         in = new YellOnCloseInputStream(in);
-        Reader reader = new java.io.InputStreamReader(in, "US-ASCII");
+        final Reader reader = new java.io.InputStreamReader(in, "US-ASCII");
         
-        ByteArrayOutputStream baout = new ByteArrayOutputStream();
-        OutputStream out = new YellOnFlushAndCloseOutputStream(baout, false, true);
+        final ByteArrayOutputStream baout = new ByteArrayOutputStream();
+        final OutputStream out = new YellOnFlushAndCloseOutputStream(baout, false, true);
         
         CopyUtils.copy(reader, out);
         //Note: this method *does* flush. It is equivalent to:
@@ -168,13 +168,13 @@ public class CopyUtilsTest extends FileB
     public void testCopy_readerToWriter() throws Exception {
         InputStream in = new ByteArrayInputStream(inData);
         in = new YellOnCloseInputStream(in);
-        Reader reader = new java.io.InputStreamReader(in, "US-ASCII");
+        final Reader reader = new java.io.InputStreamReader(in, "US-ASCII");
 
-        ByteArrayOutputStream baout = new ByteArrayOutputStream();
-        OutputStream out = new YellOnFlushAndCloseOutputStream(baout, false, true);
-        Writer writer = new java.io.OutputStreamWriter(out, "US-ASCII");
+        final ByteArrayOutputStream baout = new ByteArrayOutputStream();
+        final OutputStream out = new YellOnFlushAndCloseOutputStream(baout, false, true);
+        final Writer writer = new java.io.OutputStreamWriter(out, "US-ASCII");
 
-        int count = CopyUtils.copy(reader, writer);
+        final int count = CopyUtils.copy(reader, writer);
         writer.flush();
         assertEquals(
             "The number of characters returned by copy is wrong",
@@ -185,10 +185,10 @@ public class CopyUtilsTest extends FileB
     }
 
     public void testCopy_stringToOutputStream() throws Exception {
-        String str = new String(inData, "US-ASCII");
+        final String str = new String(inData, "US-ASCII");
         
-        ByteArrayOutputStream baout = new ByteArrayOutputStream();
-        OutputStream out = new YellOnFlushAndCloseOutputStream(baout, false, true);
+        final ByteArrayOutputStream baout = new ByteArrayOutputStream();
+        final OutputStream out = new YellOnFlushAndCloseOutputStream(baout, false, true);
 
         CopyUtils.copy(str, out);
         //Note: this method *does* flush. It is equivalent to:
@@ -203,11 +203,11 @@ public class CopyUtilsTest extends FileB
     }
 
     public void testCopy_stringToWriter() throws Exception {
-        String str = new String(inData, "US-ASCII");
+        final String str = new String(inData, "US-ASCII");
 
-        ByteArrayOutputStream baout = new ByteArrayOutputStream();
-        OutputStream out = new YellOnFlushAndCloseOutputStream(baout, false, true);
-        Writer writer = new java.io.OutputStreamWriter(out, "US-ASCII");
+        final ByteArrayOutputStream baout = new ByteArrayOutputStream();
+        final OutputStream out = new YellOnFlushAndCloseOutputStream(baout, false, true);
+        final Writer writer = new java.io.OutputStreamWriter(out, "US-ASCII");
 
         CopyUtils.copy(str, writer);
         writer.flush();

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/DemuxTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/DemuxTestCase.java?rev=1415850&r1=1415849&r2=1415850&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/DemuxTestCase.java (original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/DemuxTestCase.java Fri Nov 30 20:51:39 2012
@@ -46,21 +46,21 @@ public class DemuxTestCase {
     private static final String DATA4 = "Data for thread4";
 
     private static final Random c_random = new Random();
-    private HashMap<String, ByteArrayOutputStream> m_outputMap = new HashMap<String, ByteArrayOutputStream>();
-    private HashMap<String, Thread> m_threadMap = new HashMap<String, Thread>();
+    private final HashMap<String, ByteArrayOutputStream> m_outputMap = new HashMap<String, ByteArrayOutputStream>();
+    private final HashMap<String, Thread> m_threadMap = new HashMap<String, Thread>();
 
-    private String getOutput( String threadName )
+    private String getOutput( final String threadName )
     {
-        ByteArrayOutputStream output =
+        final ByteArrayOutputStream output =
             m_outputMap.get( threadName );
         assertNotNull( "getOutput()", output );
 
         return output.toString();
     }
 
-    private String getInput( String threadName )
+    private String getInput( final String threadName )
     {
-        ReaderThread thread = (ReaderThread)m_threadMap.get( threadName );
+        final ReaderThread thread = (ReaderThread)m_threadMap.get( threadName );
         assertNotNull( "getInput()", thread );
 
         return thread.getData();
@@ -69,11 +69,11 @@ public class DemuxTestCase {
     private void doStart()
         throws Exception
     {
-        Iterator<String> iterator = m_threadMap.keySet().iterator();
+        final Iterator<String> iterator = m_threadMap.keySet().iterator();
         while( iterator.hasNext() )
         {
-            String name = iterator.next();
-            Thread thread = m_threadMap.get( name );
+            final String name = iterator.next();
+            final Thread thread = m_threadMap.get( name );
             thread.start();
         }
     }
@@ -81,34 +81,34 @@ public class DemuxTestCase {
     private void doJoin()
         throws Exception
     {
-        Iterator<String> iterator = m_threadMap.keySet().iterator();
+        final Iterator<String> iterator = m_threadMap.keySet().iterator();
         while( iterator.hasNext() )
         {
-            String name = iterator.next();
-            Thread thread = m_threadMap.get( name );
+            final String name = iterator.next();
+            final Thread thread = m_threadMap.get( name );
             thread.join();
         }
     }
 
-    private void startWriter( String name,
-                              String data,
-                              DemuxOutputStream demux )
+    private void startWriter( final String name,
+                              final String data,
+                              final DemuxOutputStream demux )
         throws Exception
     {
-        ByteArrayOutputStream output = new ByteArrayOutputStream();
+        final ByteArrayOutputStream output = new ByteArrayOutputStream();
         m_outputMap.put( name, output );
-        WriterThread thread =
+        final WriterThread thread =
             new WriterThread( name, data, output, demux );
         m_threadMap.put( name, thread );
     }
 
-    private void startReader( String name,
-                              String data,
-                              DemuxInputStream demux )
+    private void startReader( final String name,
+                              final String data,
+                              final DemuxInputStream demux )
         throws Exception
     {
-        ByteArrayInputStream input = new ByteArrayInputStream( data.getBytes() );
-        ReaderThread thread = new ReaderThread( name, input, demux );
+        final ByteArrayInputStream input = new ByteArrayInputStream( data.getBytes() );
+        final ReaderThread thread = new ReaderThread( name, input, demux );
         m_threadMap.put( name, thread );
     }
 
@@ -116,7 +116,7 @@ public class DemuxTestCase {
     public void testOutputStream()
         throws Exception
     {
-        DemuxOutputStream output = new DemuxOutputStream();
+        final DemuxOutputStream output = new DemuxOutputStream();
         startWriter( T1, DATA1, output );
         startWriter( T2, DATA2, output );
         startWriter( T3, DATA3, output );
@@ -135,7 +135,7 @@ public class DemuxTestCase {
     public void testInputStream()
         throws Exception
     {
-        DemuxInputStream input = new DemuxInputStream();
+        final DemuxInputStream input = new DemuxInputStream();
         startReader( T1, DATA1, input );
         startReader( T2, DATA2, input );
         startReader( T3, DATA3, input );
@@ -153,13 +153,13 @@ public class DemuxTestCase {
     private static class ReaderThread
         extends Thread
     {
-        private StringBuffer m_buffer = new StringBuffer();
-        private InputStream m_input;
-        private DemuxInputStream m_demux;
-
-        ReaderThread( String name,
-                      InputStream input,
-                      DemuxInputStream demux )
+        private final StringBuffer m_buffer = new StringBuffer();
+        private final InputStream m_input;
+        private final DemuxInputStream m_demux;
+
+        ReaderThread( final String name,
+                      final InputStream input,
+                      final DemuxInputStream demux )
         {
             super( name );
             m_input = input;
@@ -184,12 +184,12 @@ public class DemuxTestCase {
                     //System.out.println( "Reading: " + (char)ch );
                     m_buffer.append( (char)ch );
 
-                    int sleepTime = Math.abs( c_random.nextInt() % 10 );
+                    final int sleepTime = Math.abs( c_random.nextInt() % 10 );
                     Thread.sleep( sleepTime );
                     ch = m_demux.read();
                 }
             }
-            catch( Exception e )
+            catch( final Exception e )
             {
                 e.printStackTrace();
             }
@@ -199,14 +199,14 @@ public class DemuxTestCase {
     private static class WriterThread
         extends Thread
     {
-        private byte[] m_data;
-        private OutputStream m_output;
-        private DemuxOutputStream m_demux;
-
-        WriterThread( String name,
-                      String data,
-                      OutputStream output,
-                      DemuxOutputStream demux )
+        private final byte[] m_data;
+        private final OutputStream m_output;
+        private final DemuxOutputStream m_demux;
+
+        WriterThread( final String name,
+                      final String data,
+                      final OutputStream output,
+                      final DemuxOutputStream demux )
         {
             super( name );
             m_output = output;
@@ -218,15 +218,15 @@ public class DemuxTestCase {
         public void run()
         {
             m_demux.bindStream( m_output );
-            for (byte element : m_data) {
+            for (final byte element : m_data) {
                 try
                 {
                     //System.out.println( "Writing: " + (char)m_data[ i ] );
                     m_demux.write( element );
-                    int sleepTime = Math.abs( c_random.nextInt() % 10 );
+                    final int sleepTime = Math.abs( c_random.nextInt() % 10 );
                     Thread.sleep( sleepTime );
                 }
-                catch( Exception e )
+                catch( final Exception e )
                 {
                     e.printStackTrace();
                 }



Mime
View raw message