commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1302748 - in /commons/proper/io/trunk: ./ src/main/java/org/apache/commons/io/ src/main/java/org/apache/commons/io/comparator/ src/main/java/org/apache/commons/io/filefilter/ src/main/java/org/apache/commons/io/input/ src/main/java/org/apa...
Date Tue, 20 Mar 2012 01:35:33 GMT
Author: ggregory
Date: Tue Mar 20 01:35:32 2012
New Revision: 1302748

URL: http://svn.apache.org/viewvc?rev=1302748&view=rev
Log:
Remove noisy and unnecessary parens. Especially painful in return statements: "return (foo + bar);" vs. "return foo + bar;"

Modified:
    commons/proper/io/trunk/pom.xml
    commons/proper/io/trunk/src/main/java/org/apache/commons/io/DirectoryWalker.java
    commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileCleaningTracker.java
    commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileSystemUtils.java
    commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java
    commons/proper/io/trunk/src/main/java/org/apache/commons/io/FilenameUtils.java
    commons/proper/io/trunk/src/main/java/org/apache/commons/io/HexDump.java
    commons/proper/io/trunk/src/main/java/org/apache/commons/io/IOUtils.java
    commons/proper/io/trunk/src/main/java/org/apache/commons/io/comparator/DirectoryFileComparator.java
    commons/proper/io/trunk/src/main/java/org/apache/commons/io/filefilter/DelegateFileFilter.java
    commons/proper/io/trunk/src/main/java/org/apache/commons/io/filefilter/EmptyFileFilter.java
    commons/proper/io/trunk/src/main/java/org/apache/commons/io/filefilter/NameFileFilter.java
    commons/proper/io/trunk/src/main/java/org/apache/commons/io/filefilter/PrefixFileFilter.java
    commons/proper/io/trunk/src/main/java/org/apache/commons/io/filefilter/RegexFileFilter.java
    commons/proper/io/trunk/src/main/java/org/apache/commons/io/filefilter/SuffixFileFilter.java
    commons/proper/io/trunk/src/main/java/org/apache/commons/io/filefilter/WildcardFileFilter.java
    commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/BOMInputStream.java
    commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/CharSequenceReader.java
    commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/NullInputStream.java
    commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/NullReader.java
    commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/ReversedLinesFileReader.java
    commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/SwappedDataInputStream.java
    commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/XmlStreamReader.java
    commons/proper/io/trunk/src/main/java/org/apache/commons/io/monitor/FileAlterationObserver.java
    commons/proper/io/trunk/src/main/java/org/apache/commons/io/monitor/FileEntry.java
    commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/StringBuilderWriter.java
    commons/proper/io/trunk/src/main/java/org/apache/commons/io/output/ThresholdingOutputStream.java
    commons/proper/io/trunk/src/test/java/org/apache/commons/io/DirectoryWalkerTestCase.java
    commons/proper/io/trunk/src/test/java/org/apache/commons/io/DirectoryWalkerTestCaseJava4.java
    commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileSystemUtilsTestCase.java
    commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileUtilsCleanDirectoryTestCase.java
    commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileUtilsTestCase.java
    commons/proper/io/trunk/src/test/java/org/apache/commons/io/FilenameUtilsTestCase.java
    commons/proper/io/trunk/src/test/java/org/apache/commons/io/FilenameUtilsWildcardTestCase.java
    commons/proper/io/trunk/src/test/java/org/apache/commons/io/IOCaseTestCase.java
    commons/proper/io/trunk/src/test/java/org/apache/commons/io/IOUtilsTestCase.java
    commons/proper/io/trunk/src/test/java/org/apache/commons/io/LineIteratorTestCase.java
    commons/proper/io/trunk/src/test/java/org/apache/commons/io/filefilter/FileFilterTestCase.java
    commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/NullInputStreamTest.java
    commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/NullReaderTest.java
    commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/XmlStreamReaderTest.java
    commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/compatibility/XmlStreamReader.java
    commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/XmlStreamWriterTest.java

Modified: commons/proper/io/trunk/pom.xml
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/pom.xml?rev=1302748&r1=1302747&r2=1302748&view=diff
==============================================================================
--- commons/proper/io/trunk/pom.xml (original)
+++ commons/proper/io/trunk/pom.xml Tue Mar 20 01:35:32 2012
@@ -24,7 +24,7 @@
   <modelVersion>4.0.0</modelVersion>
   <groupId>commons-io</groupId>
   <artifactId>commons-io</artifactId>
-  <version>2.2-SNAPSHOT</version>
+  <version>2.2</version>
   <name>Commons IO</name>
 
   <inceptionYear>2002</inceptionYear>

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/DirectoryWalker.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/DirectoryWalker.java?rev=1302748&r1=1302747&r2=1302748&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/DirectoryWalker.java (original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/DirectoryWalker.java Tue Mar 20 01:35:32 2012
@@ -301,8 +301,8 @@ public abstract class DirectoryWalker<T>
         if (directoryFilter == null && fileFilter == null) {
             this.filter = null;
         } else {
-            directoryFilter = (directoryFilter != null ? directoryFilter : TrueFileFilter.TRUE);
-            fileFilter = (fileFilter != null ? fileFilter : TrueFileFilter.TRUE);
+            directoryFilter = directoryFilter != null ? directoryFilter : TrueFileFilter.TRUE;
+            fileFilter = fileFilter != null ? fileFilter : TrueFileFilter.TRUE;
             directoryFilter = FileFilterUtils.makeDirectoryOnly(directoryFilter);
             fileFilter = FileFilterUtils.makeFileOnly(fileFilter);
             this.filter = FileFilterUtils.or(directoryFilter, fileFilter);
@@ -354,7 +354,7 @@ public abstract class DirectoryWalker<T>
             int childDepth = depth + 1;
             if (depthLimit < 0 || childDepth <= depthLimit) {
                 checkIfCancelled(directory, depth, results);
-                File[] childFiles = (filter == null ? directory.listFiles() : directory.listFiles(filter));
+                File[] childFiles = filter == null ? directory.listFiles() : directory.listFiles(filter);
                 childFiles = filterDirectoryContents(directory, depth, childFiles);
                 if (childFiles == null) {
                     handleRestricted(directory, childDepth, results);

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileCleaningTracker.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileCleaningTracker.java?rev=1302748&r1=1302747&r2=1302748&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileCleaningTracker.java (original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileCleaningTracker.java Tue Mar 20 01:35:32 2012
@@ -256,7 +256,7 @@ public class FileCleaningTracker {
         Tracker(String path, FileDeleteStrategy deleteStrategy, Object marker, ReferenceQueue<? super Object> queue) {
             super(marker, queue);
             this.path = path;
-            this.deleteStrategy = (deleteStrategy == null ? FileDeleteStrategy.NORMAL : deleteStrategy);
+            this.deleteStrategy = deleteStrategy == null ? FileDeleteStrategy.NORMAL : deleteStrategy;
         }
 
         /**

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileSystemUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileSystemUtils.java?rev=1302748&r1=1302747&r2=1302748&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileSystemUtils.java (original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileSystemUtils.java Tue Mar 20 01:35:32 2012
@@ -261,7 +261,7 @@ public class FileSystemUtils {
         }
         switch (os) {
             case WINDOWS:
-                return (kb ? freeSpaceWindows(path, timeout) / FileUtils.ONE_KB : freeSpaceWindows(path, timeout));
+                return kb ? freeSpaceWindows(path, timeout) / FileUtils.ONE_KB : freeSpaceWindows(path, timeout);
             case UNIX:
                 return freeSpaceUnix(path, kb, false, timeout);
             case POSIX_UNIX:
@@ -390,7 +390,7 @@ public class FileSystemUtils {
             flags += "P";
         }
         String[] cmdAttribs = 
-            (flags.length() > 1 ? new String[] {DF, flags, path} : new String[] {DF, path});
+            flags.length() > 1 ? new String[] {DF, flags, path} : new String[] {DF, path};
         
         // perform the command, asking for up to 3 lines (header, interesting, overflow)
         List<String> lines = performCommand(cmdAttribs, 3, timeout);

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java?rev=1302748&r1=1302747&r2=1302748&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java (original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java Tue Mar 20 01:35:32 2012
@@ -619,7 +619,7 @@ public class FileUtils {
             filter = new SuffixFileFilter(suffixes);
         }
         return listFiles(directory, filter,
-            (recursive ? TrueFileFilter.INSTANCE : FalseFileFilter.INSTANCE));
+            recursive ? TrueFileFilter.INSTANCE : FalseFileFilter.INSTANCE);
     }
 
     /**
@@ -1072,7 +1072,7 @@ public class FileUtils {
             long pos = 0;
             long count = 0;
             while (pos < size) {
-                count = (size - pos) > FILE_COPY_BUFFER_SIZE ? FILE_COPY_BUFFER_SIZE : (size - pos);
+                count = size - pos > FILE_COPY_BUFFER_SIZE ? FILE_COPY_BUFFER_SIZE : size - pos;
                 pos += output.transferFrom(input, pos, count);
             }
         } finally {

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/FilenameUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/FilenameUtils.java?rev=1302748&r1=1302747&r2=1302748&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/FilenameUtils.java (original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/FilenameUtils.java Tue Mar 20 01:35:32 2012
@@ -146,7 +146,7 @@ public class FilenameUtils {
      * @return true if it is a separator character
      */
     private static boolean isSeparator(char ch) {
-        return (ch == UNIX_SEPARATOR) || (ch == WINDOWS_SEPARATOR);
+        return ch == UNIX_SEPARATOR || ch == WINDOWS_SEPARATOR;
     }
 
     //-----------------------------------------------------------------------
@@ -332,7 +332,7 @@ public class FilenameUtils {
      * @since Commons IO 2.0
      */
     public static String normalizeNoEndSeparator(String filename, boolean unixSeparator) {
-         char separator = (unixSeparator ? UNIX_SEPARATOR : WINDOWS_SEPARATOR);
+         char separator = unixSeparator ? UNIX_SEPARATOR : WINDOWS_SEPARATOR;
         return doNormalize(filename, separator, false);
     }
 
@@ -361,7 +361,7 @@ public class FilenameUtils {
         filename.getChars(0, filename.length(), array, 0);
         
         // fix separators throughout
-        char otherSeparator = (separator == SYSTEM_SEPARATOR ? OTHER_SEPARATOR : SYSTEM_SEPARATOR);
+        char otherSeparator = separator == SYSTEM_SEPARATOR ? OTHER_SEPARATOR : SYSTEM_SEPARATOR;
         for (int i = 0; i < array.length; i++) {
             if (array[i] == otherSeparator) {
                 array[i] = separator;
@@ -413,14 +413,14 @@ public class FilenameUtils {
                     if (array[j] == separator) {
                         // remove b/../ from a/b/../c
                         System.arraycopy(array, i + 1, array, j + 1, size - i);
-                        size -= (i - j);
+                        size -= i - j;
                         i = j + 1;
                         continue outer;
                     }
                 }
                 // remove a/../ from a/../c
                 System.arraycopy(array, i + 1, array, prefix, size - i);
-                size -= (i + 1 - prefix);
+                size -= i + 1 - prefix;
                 i = prefix + 1;
             }
         }
@@ -635,7 +635,7 @@ public class FilenameUtils {
             if (ch0 == '~') {
                 return 2;  // return a length greater than the input
             }
-            return (isSeparator(ch0) ? 1 : 0);
+            return isSeparator(ch0) ? 1 : 0;
         } else {
             if (ch0 == '~') {
                 int posUnix = filename.indexOf(UNIX_SEPARATOR, 1);
@@ -643,8 +643,8 @@ public class FilenameUtils {
                 if (posUnix == -1 && posWin == -1) {
                     return len + 1;  // return a length greater than the input
                 }
-                posUnix = (posUnix == -1 ? posWin : posUnix);
-                posWin = (posWin == -1 ? posUnix : posWin);
+                posUnix = posUnix == -1 ? posWin : posUnix;
+                posWin = posWin == -1 ? posUnix : posWin;
                 return Math.min(posUnix, posWin) + 1;
             }
             char ch1 = filename.charAt(1);
@@ -661,14 +661,14 @@ public class FilenameUtils {
             } else if (isSeparator(ch0) && isSeparator(ch1)) {
                 int posUnix = filename.indexOf(UNIX_SEPARATOR, 2);
                 int posWin = filename.indexOf(WINDOWS_SEPARATOR, 2);
-                if ((posUnix == -1 && posWin == -1) || posUnix == 2 || posWin == 2) {
+                if (posUnix == -1 && posWin == -1 || posUnix == 2 || posWin == 2) {
                     return -1;
                 }
-                posUnix = (posUnix == -1 ? posWin : posUnix);
-                posWin = (posWin == -1 ? posUnix : posWin);
+                posUnix = posUnix == -1 ? posWin : posUnix;
+                posWin = posWin == -1 ? posUnix : posWin;
                 return Math.min(posUnix, posWin) + 1;
             } else {
-                return (isSeparator(ch0) ? 1 : 0);
+                return isSeparator(ch0) ? 1 : 0;
             }
         }
     }
@@ -713,7 +713,7 @@ public class FilenameUtils {
         }
         int extensionPos = filename.lastIndexOf(EXTENSION_SEPARATOR);
         int lastSeparator = indexOfLastSeparator(filename);
-        return (lastSeparator > extensionPos ? -1 : extensionPos);
+        return lastSeparator > extensionPos ? -1 : extensionPos;
     }
 
     //-----------------------------------------------------------------------
@@ -1114,7 +1114,7 @@ public class FilenameUtils {
             boolean normalized, IOCase caseSensitivity) {
         
         if (filename1 == null || filename2 == null) {
-            return (filename1 == null && filename2 == null);
+            return filename1 == null && filename2 == null;
         }
         if (normalized) {
             filename1 = normalize(filename1);
@@ -1147,7 +1147,7 @@ public class FilenameUtils {
             return false;
         }
         if (extension == null || extension.length() == 0) {
-            return (indexOfExtension(filename) == -1);
+            return indexOfExtension(filename) == -1;
         }
         String fileExt = getExtension(filename);
         return fileExt.equals(extension);
@@ -1169,7 +1169,7 @@ public class FilenameUtils {
             return false;
         }
         if (extensions == null || extensions.length == 0) {
-            return (indexOfExtension(filename) == -1);
+            return indexOfExtension(filename) == -1;
         }
         String fileExt = getExtension(filename);
         for (String extension : extensions) {
@@ -1196,7 +1196,7 @@ public class FilenameUtils {
             return false;
         }
         if (extensions == null || extensions.isEmpty()) {
-            return (indexOfExtension(filename) == -1);
+            return indexOfExtension(filename) == -1;
         }
         String fileExt = getExtension(filename);
         for (String extension : extensions) {
@@ -1384,7 +1384,7 @@ public class FilenameUtils {
                 if (array[i] == '?') {
                     list.add("?");
                 } else if (list.isEmpty() ||
-                        (i > 0 && list.get(list.size() - 1).equals("*") == false)) {
+                        i > 0 && list.get(list.size() - 1).equals("*") == false) {
                     list.add("*");
                 }
             } else {

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/HexDump.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/HexDump.java?rev=1302748&r1=1302747&r2=1302748&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/HexDump.java (original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/HexDump.java Tue Mar 20 01:35:32 2012
@@ -73,7 +73,7 @@ public class HexDump {
             throws IOException, ArrayIndexOutOfBoundsException,
             IllegalArgumentException {
         
-        if ((index < 0) || (index >= data.length)) {
+        if (index < 0 || index >= data.length) {
             throw new ArrayIndexOutOfBoundsException(
                     "illegal index: " + index + " into array of length "
                     + data.length);
@@ -100,7 +100,7 @@ public class HexDump {
                 buffer.append(' ');
             }
             for (int k = 0; k < chars_read; k++) {
-                if ((data[k + j] >= ' ') && (data[k + j] < 127)) {
+                if (data[k + j] >= ' ' && data[k + j] < 127) {
                     buffer.append((char) data[k + j]);
                 } else {
                     buffer.append('.');
@@ -139,7 +139,7 @@ public class HexDump {
     private static StringBuilder dump(StringBuilder _lbuffer, long value) {
         for (int j = 0; j < 8; j++) {
             _lbuffer
-                    .append(_hexcodes[((int) (value >> _shifts[j])) & 15]);
+                    .append(_hexcodes[(int) (value >> _shifts[j]) & 15]);
         }
         return _lbuffer;
     }
@@ -153,7 +153,7 @@ public class HexDump {
      */
     private static StringBuilder dump(StringBuilder _cbuffer, byte value) {
         for (int j = 0; j < 2; j++) {
-            _cbuffer.append(_hexcodes[(value >> _shifts[j + 6]) & 15]);
+            _cbuffer.append(_hexcodes[value >> _shifts[j + 6] & 15]);
         }
         return _cbuffer;
     }

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/IOUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/IOUtils.java?rev=1302748&r1=1302747&r2=1302748&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/IOUtils.java (original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/IOUtils.java Tue Mar 20 01:35:32 2012
@@ -480,7 +480,7 @@ public class IOUtils {
         int offset = 0;
         int readed;
 
-        while(offset < size && (readed = input.read(data, offset, (size - offset))) != -1) {
+        while(offset < size && (readed = input.read(data, offset, size - offset)) != -1) {
             offset += readed;
         }
 
@@ -1750,7 +1750,7 @@ public class IOUtils {
         }
 
         int ch2 = input2.read();
-        return (ch2 == -1);
+        return ch2 == -1;
     }
 
     /**
@@ -1787,7 +1787,7 @@ public class IOUtils {
         }
 
         int ch2 = input2.read();
-        return (ch2 == -1);
+        return ch2 == -1;
     }
 
     /**
@@ -1825,7 +1825,7 @@ public class IOUtils {
             line1 = br1.readLine();
             line2 = br2.readLine();
         }
-        return line1 == null ? (line2 == null ? true : false) : line1.equals(line2);
+        return line1 == null ? line2 == null ? true : false : line1.equals(line2);
     }
 
     /**
@@ -1978,7 +1978,7 @@ public class IOUtils {
         }
         int remaining = length;
         while ( remaining > 0 ) {
-            int location = ( length - remaining );
+            int location = length - remaining;
             int count = input.read( buffer, location, remaining );
             if ( -1 == count ) { // EOF
                 break;
@@ -2023,7 +2023,7 @@ public class IOUtils {
         }
         int remaining = length;
         while ( remaining > 0 ) {
-            int location = ( length - remaining );
+            int location = length - remaining;
             int count = input.read( buffer, location, remaining );
             if ( -1 == count ) { // EOF
                 break;

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/comparator/DirectoryFileComparator.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/comparator/DirectoryFileComparator.java?rev=1302748&r1=1302747&r2=1302748&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/comparator/DirectoryFileComparator.java (original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/comparator/DirectoryFileComparator.java Tue Mar 20 01:35:32 2012
@@ -60,7 +60,7 @@ public class DirectoryFileComparator ext
      * {@link File#compareTo(File)} with file2 as the parameter.
      */
     public int compare(File file1, File file2) {
-        return (getType(file1) - getType(file2));
+        return getType(file1) - getType(file2);
     }
 
     /**

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/filefilter/DelegateFileFilter.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/filefilter/DelegateFileFilter.java?rev=1302748&r1=1302747&r2=1302748&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/filefilter/DelegateFileFilter.java (original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/filefilter/DelegateFileFilter.java Tue Mar 20 01:35:32 2012
@@ -101,7 +101,7 @@ public class DelegateFileFilter extends 
      */
     @Override
     public String toString() {
-        String delegate = (fileFilter != null ? fileFilter.toString() : filenameFilter.toString()); 
+        String delegate = fileFilter != null ? fileFilter.toString() : filenameFilter.toString(); 
         return super.toString() + "(" + delegate + ")";
     }
     

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/filefilter/EmptyFileFilter.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/filefilter/EmptyFileFilter.java?rev=1302748&r1=1302747&r2=1302748&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/filefilter/EmptyFileFilter.java (original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/filefilter/EmptyFileFilter.java Tue Mar 20 01:35:32 2012
@@ -76,9 +76,9 @@ public class EmptyFileFilter extends Abs
     public boolean accept(File file) {
         if (file.isDirectory()) {
             File[] files = file.listFiles();
-            return (files == null || files.length == 0);
+            return files == null || files.length == 0;
         } else {
-            return (file.length() == 0);
+            return file.length() == 0;
         }
     }
     

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/filefilter/NameFileFilter.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/filefilter/NameFileFilter.java?rev=1302748&r1=1302747&r2=1302748&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/filefilter/NameFileFilter.java (original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/filefilter/NameFileFilter.java Tue Mar 20 01:35:32 2012
@@ -70,7 +70,7 @@ public class NameFileFilter extends Abst
             throw new IllegalArgumentException("The wildcard must not be null");
         }
         this.names = new String[] {name};
-        this.caseSensitivity = (caseSensitivity == null ? IOCase.SENSITIVE : caseSensitivity);
+        this.caseSensitivity = caseSensitivity == null ? IOCase.SENSITIVE : caseSensitivity;
     }
 
     /**
@@ -102,7 +102,7 @@ public class NameFileFilter extends Abst
         }
         this.names = new String[names.length];
         System.arraycopy(names, 0, this.names, 0, names.length);
-        this.caseSensitivity = (caseSensitivity == null ? IOCase.SENSITIVE : caseSensitivity);
+        this.caseSensitivity = caseSensitivity == null ? IOCase.SENSITIVE : caseSensitivity;
     }
 
     /**
@@ -129,7 +129,7 @@ public class NameFileFilter extends Abst
             throw new IllegalArgumentException("The list of names must not be null");
         }
         this.names = names.toArray(new String[names.size()]);
-        this.caseSensitivity = (caseSensitivity == null ? IOCase.SENSITIVE : caseSensitivity);
+        this.caseSensitivity = caseSensitivity == null ? IOCase.SENSITIVE : caseSensitivity;
     }
 
     //-----------------------------------------------------------------------

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/filefilter/PrefixFileFilter.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/filefilter/PrefixFileFilter.java?rev=1302748&r1=1302747&r2=1302748&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/filefilter/PrefixFileFilter.java (original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/filefilter/PrefixFileFilter.java Tue Mar 20 01:35:32 2012
@@ -73,7 +73,7 @@ public class PrefixFileFilter extends Ab
             throw new IllegalArgumentException("The prefix must not be null");
         }
         this.prefixes = new String[] {prefix};
-        this.caseSensitivity = (caseSensitivity == null ? IOCase.SENSITIVE : caseSensitivity);
+        this.caseSensitivity = caseSensitivity == null ? IOCase.SENSITIVE : caseSensitivity;
     }
 
     /**
@@ -107,7 +107,7 @@ public class PrefixFileFilter extends Ab
         }
         this.prefixes = new String[prefixes.length];
         System.arraycopy(prefixes, 0, this.prefixes, 0, prefixes.length);
-        this.caseSensitivity = (caseSensitivity == null ? IOCase.SENSITIVE : caseSensitivity);
+        this.caseSensitivity = caseSensitivity == null ? IOCase.SENSITIVE : caseSensitivity;
     }
 
     /**
@@ -136,7 +136,7 @@ public class PrefixFileFilter extends Ab
             throw new IllegalArgumentException("The list of prefixes must not be null");
         }
         this.prefixes = prefixes.toArray(new String[prefixes.size()]);
-        this.caseSensitivity = (caseSensitivity == null ? IOCase.SENSITIVE : caseSensitivity);
+        this.caseSensitivity = caseSensitivity == null ? IOCase.SENSITIVE : caseSensitivity;
     }
 
     /**

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/filefilter/RegexFileFilter.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/filefilter/RegexFileFilter.java?rev=1302748&r1=1302747&r2=1302748&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/filefilter/RegexFileFilter.java (original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/filefilter/RegexFileFilter.java Tue Mar 20 01:35:32 2012
@@ -116,7 +116,7 @@ public class RegexFileFilter extends Abs
      */
     @Override
     public boolean accept(File dir, String name) {
-        return (pattern.matcher(name).matches());
+        return pattern.matcher(name).matches();
     }
 
 }

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/filefilter/SuffixFileFilter.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/filefilter/SuffixFileFilter.java?rev=1302748&r1=1302747&r2=1302748&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/filefilter/SuffixFileFilter.java (original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/filefilter/SuffixFileFilter.java Tue Mar 20 01:35:32 2012
@@ -74,7 +74,7 @@ public class SuffixFileFilter extends Ab
             throw new IllegalArgumentException("The suffix must not be null");
         }
         this.suffixes = new String[] {suffix};
-        this.caseSensitivity = (caseSensitivity == null ? IOCase.SENSITIVE : caseSensitivity);
+        this.caseSensitivity = caseSensitivity == null ? IOCase.SENSITIVE : caseSensitivity;
     }
 
     /**
@@ -108,7 +108,7 @@ public class SuffixFileFilter extends Ab
         }
         this.suffixes = new String[suffixes.length];
         System.arraycopy(suffixes, 0, this.suffixes, 0, suffixes.length);
-        this.caseSensitivity = (caseSensitivity == null ? IOCase.SENSITIVE : caseSensitivity);
+        this.caseSensitivity = caseSensitivity == null ? IOCase.SENSITIVE : caseSensitivity;
     }
 
     /**
@@ -137,7 +137,7 @@ public class SuffixFileFilter extends Ab
             throw new IllegalArgumentException("The list of suffixes must not be null");
         }
         this.suffixes = suffixes.toArray(new String[suffixes.size()]);
-        this.caseSensitivity = (caseSensitivity == null ? IOCase.SENSITIVE : caseSensitivity);
+        this.caseSensitivity = caseSensitivity == null ? IOCase.SENSITIVE : caseSensitivity;
     }
 
     /**

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/filefilter/WildcardFileFilter.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/filefilter/WildcardFileFilter.java?rev=1302748&r1=1302747&r2=1302748&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/filefilter/WildcardFileFilter.java (original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/filefilter/WildcardFileFilter.java Tue Mar 20 01:35:32 2012
@@ -77,7 +77,7 @@ public class WildcardFileFilter extends 
             throw new IllegalArgumentException("The wildcard must not be null");
         }
         this.wildcards = new String[] { wildcard };
-        this.caseSensitivity = (caseSensitivity == null ? IOCase.SENSITIVE : caseSensitivity);
+        this.caseSensitivity = caseSensitivity == null ? IOCase.SENSITIVE : caseSensitivity;
     }
 
     /**
@@ -109,7 +109,7 @@ public class WildcardFileFilter extends 
         }
         this.wildcards = new String[wildcards.length];
         System.arraycopy(wildcards, 0, this.wildcards, 0, wildcards.length);
-        this.caseSensitivity = (caseSensitivity == null ? IOCase.SENSITIVE : caseSensitivity);
+        this.caseSensitivity = caseSensitivity == null ? IOCase.SENSITIVE : caseSensitivity;
     }
 
     /**
@@ -136,7 +136,7 @@ public class WildcardFileFilter extends 
             throw new IllegalArgumentException("The wildcard list must not be null");
         }
         this.wildcards = wildcards.toArray(new String[wildcards.size()]);
-        this.caseSensitivity = (caseSensitivity == null ? IOCase.SENSITIVE : caseSensitivity);
+        this.caseSensitivity = caseSensitivity == null ? IOCase.SENSITIVE : caseSensitivity;
     }
 
     //-----------------------------------------------------------------------

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/BOMInputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/BOMInputStream.java?rev=1302748&r1=1302747&r2=1302748&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/BOMInputStream.java (original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/BOMInputStream.java Tue Mar 20 01:35:32 2012
@@ -137,7 +137,7 @@ public class BOMInputStream extends Prox
      * @throws IOException if an error reading the first bytes of the stream occurs
      */
     public boolean hasBOM() throws IOException {
-        return (getBOM() != null);
+        return getBOM() != null;
     }
 
     /**
@@ -154,7 +154,7 @@ public class BOMInputStream extends Prox
         if (!boms.contains(bom)) {
             throw new IllegalArgumentException("Stream not configure to detect " + bom);
         }
-        return (byteOrderMark != null && getBOM().equals(bom));
+        return byteOrderMark != null && getBOM().equals(bom);
     }
 
     /**
@@ -199,7 +199,7 @@ public class BOMInputStream extends Prox
      */
     public String getBOMCharsetName() throws IOException {
         getBOM();
-        return (byteOrderMark == null ? null : byteOrderMark.getCharsetName());
+        return byteOrderMark == null ? null : byteOrderMark.getCharsetName();
     }
 
     /**
@@ -212,7 +212,7 @@ public class BOMInputStream extends Prox
      */
     private int readFirstBytes() throws IOException {
         getBOM();
-        return (fbIndex < fbLength) ? firstBytes[fbIndex++] : -1;
+        return fbIndex < fbLength ? firstBytes[fbIndex++] : -1;
     }
 
     /**
@@ -260,7 +260,7 @@ public class BOMInputStream extends Prox
     @Override
     public int read() throws IOException {
         int b = readFirstBytes();
-        return (b >= 0) ? b : in.read();
+        return b >= 0 ? b : in.read();
     }
 
     /**
@@ -276,7 +276,7 @@ public class BOMInputStream extends Prox
     public int read(byte[] buf, int off, int len) throws IOException {
         int firstCount = 0;
         int b = 0;
-        while ((len > 0) && (b >= 0)) {
+        while (len > 0 && b >= 0) {
             b = readFirstBytes();
             if (b >= 0) {
                 buf[off++] = (byte) (b & 0xFF);
@@ -285,7 +285,7 @@ public class BOMInputStream extends Prox
             }
         }
         int secondCount = in.read(buf, off, len);
-        return (secondCount < 0) ? (firstCount > 0 ? firstCount : -1) : firstCount + secondCount;
+        return secondCount < 0 ? firstCount > 0 ? firstCount : -1 : firstCount + secondCount;
     }
 
     /**
@@ -308,7 +308,7 @@ public class BOMInputStream extends Prox
     @Override
     public synchronized void mark(int readlimit) {
         markFbIndex = fbIndex;
-        markedAtStart = (firstBytes == null);
+        markedAtStart = firstBytes == null;
         in.mark(readlimit);
     }
 
@@ -335,7 +335,7 @@ public class BOMInputStream extends Prox
      */
     @Override
     public long skip(long n) throws IOException {
-        while ((n > 0) && (readFirstBytes() >= 0)) {
+        while (n > 0 && readFirstBytes() >= 0) {
             n--;
         }
         return in.skip(n);

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/CharSequenceReader.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/CharSequenceReader.java?rev=1302748&r1=1302747&r2=1302748&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/CharSequenceReader.java (original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/CharSequenceReader.java Tue Mar 20 01:35:32 2012
@@ -40,7 +40,7 @@ public class CharSequenceReader extends 
      * @param charSequence The character sequence, may be <code>null</code>
      */
     public CharSequenceReader(CharSequence charSequence) {
-        this.charSequence = (charSequence != null ? charSequence : "");
+        this.charSequence = charSequence != null ? charSequence : "";
     }
 
     /**
@@ -104,7 +104,7 @@ public class CharSequenceReader extends 
         if (array == null) {
             throw new NullPointerException("Character array is missing");
         }
-        if (length < 0 || offset < 0 || (offset + length) > array.length) {
+        if (length < 0 || offset < 0 || offset + length > array.length) {
             throw new IndexOutOfBoundsException("Array Size=" + array.length +
                     ", offset=" + offset + ", length=" + length);
         }
@@ -144,7 +144,7 @@ public class CharSequenceReader extends 
         if (idx >= charSequence.length()) {
             return -1;
         }
-        int dest = (int)Math.min(charSequence.length(), (idx + n));
+        int dest = (int)Math.min(charSequence.length(), idx + n);
         int count = dest - idx;
         idx = dest;
         return count;

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/NullInputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/NullInputStream.java?rev=1302748&r1=1302747&r2=1302748&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/NullInputStream.java (original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/NullInputStream.java Tue Mar 20 01:35:32 2012
@@ -256,7 +256,7 @@ public class NullInputStream extends Inp
         if (mark < 0) {
             throw new IOException("No position has been marked");
         }
-        if (position > (mark + readlimit)) {
+        if (position > mark + readlimit) {
             throw new IOException("Marked position [" + mark +
                     "] is no longer valid - passed the read limit [" +
                     readlimit + "]");

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/NullReader.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/NullReader.java?rev=1302748&r1=1302747&r2=1302748&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/NullReader.java (original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/NullReader.java Tue Mar 20 01:35:32 2012
@@ -239,7 +239,7 @@ public class NullReader extends Reader {
         if (mark < 0) {
             throw new IOException("No position has been marked");
         }
-        if (position > (mark + readlimit)) {
+        if (position > mark + readlimit) {
             throw new IOException("Marked position [" + mark +
                     "] is no longer valid - passed the read limit [" +
                     readlimit + "]");

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/ReversedLinesFileReader.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/ReversedLinesFileReader.java?rev=1302748&r1=1302747&r2=1302748&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/ReversedLinesFileReader.java (original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/ReversedLinesFileReader.java Tue Mar 20 01:35:32 2012
@@ -233,7 +233,7 @@ public class ReversedLinesFileReader imp
             String line = null;
             int newLineMatchByteCount;
 
-            boolean isLastFilePart = (no == 1);
+            boolean isLastFilePart = no == 1;
 
             int i = currentLastBytePos;
             while (i > -1) {

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/SwappedDataInputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/SwappedDataInputStream.java?rev=1302748&r1=1302747&r2=1302748&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/SwappedDataInputStream.java (original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/SwappedDataInputStream.java Tue Mar 20 01:35:32 2012
@@ -55,7 +55,7 @@ public class SwappedDataInputStream exte
     public boolean readBoolean()
         throws IOException, EOFException
     {
-        return ( 0 != readByte() );
+        return 0 != readByte();
     }
 
     /**
@@ -136,7 +136,7 @@ public class SwappedDataInputStream exte
 
         while( remaining > 0 )
         {
-            int location = offset + ( length - remaining );
+            int location = offset + length - remaining;
             int count = read( data, location, remaining );
 
             if( -1 == count )

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/XmlStreamReader.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/XmlStreamReader.java?rev=1302748&r1=1302747&r2=1302748&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/XmlStreamReader.java (original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/XmlStreamReader.java Tue Mar 20 01:35:32 2012
@@ -477,7 +477,7 @@ public class XmlStreamReader extends Rea
             encoding = ex.getContentTypeEncoding();
         }
         if (encoding == null) {
-            encoding = (defaultEncoding == null) ? UTF_8 : defaultEncoding;
+            encoding = defaultEncoding == null ? UTF_8 : defaultEncoding;
         }
         return encoding;
     }
@@ -497,7 +497,7 @@ public class XmlStreamReader extends Rea
         // BOM is Null
         if (bomEnc == null) {
             if (xmlGuessEnc == null || xmlEnc == null) {
-                return (defaultEncoding == null ? UTF_8 : defaultEncoding);
+                return defaultEncoding == null ? UTF_8 : defaultEncoding;
             }
             if (xmlEnc.equals(UTF_16) &&
                (xmlGuessEnc.equals(UTF_16BE) || xmlGuessEnc.equals(UTF_16LE))) {
@@ -576,7 +576,7 @@ public class XmlStreamReader extends Rea
             if (appXml) {
                 return calculateRawEncoding(bomEnc, xmlGuessEnc, xmlEnc);
             } else {
-                return (defaultEncoding == null) ? US_ASCII : defaultEncoding;
+                return defaultEncoding == null ? US_ASCII : defaultEncoding;
             }
         }
 
@@ -638,8 +638,8 @@ public class XmlStreamReader extends Rea
             if (i > -1) {
                 String postMime = httpContentType.substring(i + 1);
                 Matcher m = CHARSET_PATTERN.matcher(postMime);
-                encoding = (m.find()) ? m.group(1) : null;
-                encoding = (encoding != null) ? encoding.toUpperCase(Locale.US) : null;
+                encoding = m.find() ? m.group(1) : null;
+                encoding = encoding != null ? encoding.toUpperCase(Locale.US) : null;
             }
         }
         return encoding;
@@ -717,7 +717,7 @@ public class XmlStreamReader extends Rea
                (mime.equals("application/xml") || 
                 mime.equals("application/xml-dtd") ||
                 mime.equals("application/xml-external-parsed-entity") ||
-               (mime.startsWith("application/") && mime.endsWith("+xml")));
+               mime.startsWith("application/") && mime.endsWith("+xml"));
     }
 
     /**
@@ -731,7 +731,7 @@ public class XmlStreamReader extends Rea
         return mime != null &&
               (mime.equals("text/xml") ||
                mime.equals("text/xml-external-parsed-entity") ||
-              (mime.startsWith("text/") && mime.endsWith("+xml")));
+              mime.startsWith("text/") && mime.endsWith("+xml"));
     }
 
     private static final String RAW_EX_1 =

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/monitor/FileAlterationObserver.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/monitor/FileAlterationObserver.java?rev=1302748&r1=1302747&r2=1302748&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/monitor/FileAlterationObserver.java (original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/monitor/FileAlterationObserver.java Tue Mar 20 01:35:32 2012
@@ -428,7 +428,7 @@ public class FileAlterationObserver impl
     private File[] listFiles(File file) {
         File[] children = null;
         if (file.isDirectory()) {
-            children = (fileFilter == null) ? file.listFiles() : file.listFiles(fileFilter);
+            children = fileFilter == null ? file.listFiles() : file.listFiles(fileFilter);
         }
         if (children == null) {
             children = FileUtils.EMPTY_FILE_ARRAY;

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/monitor/FileEntry.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/monitor/FileEntry.java?rev=1302748&r1=1302747&r2=1302748&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/monitor/FileEntry.java (original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/monitor/FileEntry.java Tue Mar 20 01:35:32 2012
@@ -101,15 +101,15 @@ public class FileEntry implements Serial
         // refresh the values
         name         = file.getName();
         exists       = file.exists();
-        directory    = (exists ? file.isDirectory() : false);
-        lastModified = (exists ? file.lastModified() : 0);
-        length       = (exists && !directory ? file.length() : 0);
+        directory    = exists ? file.isDirectory() : false;
+        lastModified = exists ? file.lastModified() : 0;
+        length       = exists && !directory ? file.length() : 0;
 
         // Return if there are changes
-        return (exists != origExists ||
+        return exists != origExists ||
                 lastModified != origLastModified ||
                 directory != origDirectory ||
-                length != origLength);
+                length != origLength;
     }
 
     /**

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=1302748&r1=1302747&r2=1302748&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 Tue Mar 20 01:35:32 2012
@@ -57,7 +57,7 @@ public class StringBuilderWriter extends
      * @param builder The String builder
      */
     public StringBuilderWriter(StringBuilder builder) {
-        this.builder = (builder != null ? builder : new StringBuilder());
+        this.builder = builder != null ? builder : new StringBuilder();
     }
 
     /**

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=1302748&r1=1302747&r2=1302748&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 Tue Mar 20 01:35:32 2012
@@ -199,7 +199,7 @@ public abstract class ThresholdingOutput
      */
     public boolean isThresholdExceeded()
     {
-        return (written > threshold);
+        return written > threshold;
     }
 
 
@@ -218,7 +218,7 @@ public abstract class ThresholdingOutput
      */
     protected void checkThreshold(int count) throws IOException
     {
-        if (!thresholdExceeded && (written + count > threshold))
+        if (!thresholdExceeded && written + count > threshold)
         {
             thresholdExceeded = true;
             thresholdReached();

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/DirectoryWalkerTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/DirectoryWalkerTestCase.java?rev=1302748&r1=1302747&r2=1302748&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/DirectoryWalkerTestCase.java (original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/DirectoryWalkerTestCase.java Tue Mar 20 01:35:32 2012
@@ -92,7 +92,7 @@ public class DirectoryWalkerTestCase ext
      */
     public void testFilter() {
         List<File> results = new TestFileFinder(dirsAndFilesFilter, -1).find(javaDir);
-        assertEquals("Result Size", (1 + dirs.length + ioFiles.length + outputFiles.length), results.size());
+        assertEquals("Result Size", 1 + dirs.length + ioFiles.length + outputFiles.length, results.size());
         assertTrue("Start Dir", results.contains(javaDir));
         checkContainsFiles("Dir", dirs, results);
         checkContainsFiles("IO File", ioFiles, results);
@@ -135,7 +135,7 @@ public class DirectoryWalkerTestCase ext
      */
     public void testFilterAndLimitD() {
         List<File> results = new TestFileFinder(dirsAndFilesFilter, 5).find(javaDir);
-        assertEquals("[D] Result Size", (1 + dirs.length + ioFiles.length), results.size());
+        assertEquals("[D] Result Size", 1 + dirs.length + ioFiles.length, results.size());
         assertTrue("[D] Start Dir", results.contains(javaDir));
         checkContainsFiles("[D] Dir", dirs, results);
         checkContainsFiles("[D] File", ioFiles, results);
@@ -146,7 +146,7 @@ public class DirectoryWalkerTestCase ext
      */
     public void testFilterDirAndFile1() {
         List<File> results = new TestFileFinder(dirsFilter, iofilesFilter, -1).find(javaDir);
-        assertEquals("[DirAndFile1] Result Size", (1 + dirs.length + ioFiles.length), results.size());
+        assertEquals("[DirAndFile1] Result Size", 1 + dirs.length + ioFiles.length, results.size());
         assertTrue("[DirAndFile1] Start Dir", results.contains(javaDir));
         checkContainsFiles("[DirAndFile1] Dir", dirs, results);
         checkContainsFiles("[DirAndFile1] File", ioFiles, results);
@@ -157,7 +157,7 @@ public class DirectoryWalkerTestCase ext
      */
     public void testFilterDirAndFile2() {
         List<File> results = new TestFileFinder((IOFileFilter) null, (IOFileFilter) null, -1).find(javaDir);
-        assertTrue("[DirAndFile2] Result Size", results.size() > (1 + dirs.length + ioFiles.length));
+        assertTrue("[DirAndFile2] Result Size", results.size() > 1 + dirs.length + ioFiles.length);
         assertTrue("[DirAndFile2] Start Dir", results.contains(javaDir));
         checkContainsFiles("[DirAndFile2] Dir", dirs, results);
         checkContainsFiles("[DirAndFile2] File", ioFiles, results);
@@ -169,7 +169,7 @@ public class DirectoryWalkerTestCase ext
     public void testFilterDirAndFile3() {
         List<File> results = new TestFileFinder(dirsFilter, (IOFileFilter) null, -1).find(javaDir);
         List<File> resultDirs = directoriesOnly(results);
-        assertEquals("[DirAndFile3] Result Size", (1 + dirs.length), resultDirs.size());
+        assertEquals("[DirAndFile3] Result Size", 1 + dirs.length, resultDirs.size());
         assertTrue("[DirAndFile3] Start Dir", results.contains(javaDir));
         checkContainsFiles("[DirAndFile3] Dir", dirs, resultDirs);
     }
@@ -367,7 +367,7 @@ public class DirectoryWalkerTestCase ext
      */
     public void testFilterString() {
         List<String> results = new TestFileFinderString(dirsAndFilesFilter, -1).find(javaDir);
-        assertEquals("Result Size", (outputFiles.length + ioFiles.length), results.size());
+        assertEquals("Result Size", outputFiles.length + ioFiles.length, results.size());
         checkContainsString("IO File", ioFiles, results);
         checkContainsString("Output File", outputFiles, results);
     }

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/DirectoryWalkerTestCaseJava4.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/DirectoryWalkerTestCaseJava4.java?rev=1302748&r1=1302747&r2=1302748&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/DirectoryWalkerTestCaseJava4.java (original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/DirectoryWalkerTestCaseJava4.java Tue Mar 20 01:35:32 2012
@@ -94,7 +94,7 @@ public class DirectoryWalkerTestCaseJava
      */
     public void testFilter() {
         List results = new TestFileFinder(dirsAndFilesFilter, -1).find(javaDir);
-        assertEquals("Result Size", (1 + dirs.length + ioFiles.length + outputFiles.length), results.size());
+        assertEquals("Result Size", 1 + dirs.length + ioFiles.length + outputFiles.length, results.size());
         assertTrue("Start Dir", results.contains(javaDir));
         checkContainsFiles("Dir", dirs, results);
         checkContainsFiles("IO File", ioFiles, results);
@@ -137,7 +137,7 @@ public class DirectoryWalkerTestCaseJava
      */
     public void testFilterAndLimitD() {
         List results = new TestFileFinder(dirsAndFilesFilter, 5).find(javaDir);
-        assertEquals("[D] Result Size", (1 + dirs.length + ioFiles.length), results.size());
+        assertEquals("[D] Result Size", 1 + dirs.length + ioFiles.length, results.size());
         assertTrue("[D] Start Dir", results.contains(javaDir));
         checkContainsFiles("[D] Dir", dirs, results);
         checkContainsFiles("[D] File", ioFiles, results);
@@ -148,7 +148,7 @@ public class DirectoryWalkerTestCaseJava
      */
     public void testFilterDirAndFile1() {
         List results = new TestFileFinder(dirsFilter, iofilesFilter, -1).find(javaDir);
-        assertEquals("[DirAndFile1] Result Size", (1 + dirs.length + ioFiles.length), results.size());
+        assertEquals("[DirAndFile1] Result Size", 1 + dirs.length + ioFiles.length, results.size());
         assertTrue("[DirAndFile1] Start Dir", results.contains(javaDir));
         checkContainsFiles("[DirAndFile1] Dir", dirs, results);
         checkContainsFiles("[DirAndFile1] File", ioFiles, results);
@@ -159,7 +159,7 @@ public class DirectoryWalkerTestCaseJava
      */
     public void testFilterDirAndFile2() {
         List results = new TestFileFinder((IOFileFilter) null, (IOFileFilter) null, -1).find(javaDir);
-        assertTrue("[DirAndFile2] Result Size", results.size() > (1 + dirs.length + ioFiles.length));
+        assertTrue("[DirAndFile2] Result Size", results.size() > 1 + dirs.length + ioFiles.length);
         assertTrue("[DirAndFile2] Start Dir", results.contains(javaDir));
         checkContainsFiles("[DirAndFile2] Dir", dirs, results);
         checkContainsFiles("[DirAndFile2] File", ioFiles, results);
@@ -171,7 +171,7 @@ public class DirectoryWalkerTestCaseJava
     public void testFilterDirAndFile3() {
         List results = new TestFileFinder(dirsFilter, (IOFileFilter) null, -1).find(javaDir);
         List resultDirs = directoriesOnly(results);
-        assertEquals("[DirAndFile3] Result Size", (1 + dirs.length), resultDirs.size());
+        assertEquals("[DirAndFile3] Result Size", 1 + dirs.length, resultDirs.size());
         assertTrue("[DirAndFile3] Start Dir", results.contains(javaDir));
         checkContainsFiles("[DirAndFile3] Dir", dirs, resultDirs);
     }

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileSystemUtilsTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileSystemUtilsTestCase.java?rev=1302748&r1=1302747&r2=1302748&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileSystemUtilsTestCase.java (original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileSystemUtilsTestCase.java Tue Mar 20 01:35:32 2012
@@ -148,7 +148,7 @@ public class FileSystemUtilsTestCase ext
         FileSystemUtils fsu = new FileSystemUtils() {
             @Override
             protected long freeSpaceUnix(String path, boolean kb, boolean posix, long timeout) throws IOException {
-                return (kb ? 12345L : 54321);
+                return kb ? 12345L : 54321;
             }
         };
         assertEquals(54321L, fsu.freeSpaceOS("", 2, false, -1));

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileUtilsCleanDirectoryTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileUtilsCleanDirectoryTestCase.java?rev=1302748&r1=1302747&r2=1302748&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileUtilsCleanDirectoryTestCase.java (original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileUtilsCleanDirectoryTestCase.java Tue Mar 20 01:35:32 2012
@@ -147,7 +147,7 @@ public class FileUtilsCleanDirectoryTest
             return false;
         }
         int result = proc.waitFor();
-        return (result == 0);
+        return result == 0;
     }
 
 }

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileUtilsTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileUtilsTestCase.java?rev=1302748&r1=1302747&r2=1302748&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileUtilsTestCase.java (original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/FileUtilsTestCase.java Tue Mar 20 01:35:32 2012
@@ -319,7 +319,7 @@ public class FileUtilsTestCase extends F
         assertEquals(FileUtils.byteCountToDisplaySize(1024 * 1024 * 1023), "1023 MB");
         assertEquals(FileUtils.byteCountToDisplaySize(1024 * 1024 * 1024), "1 GB");
         assertEquals(FileUtils.byteCountToDisplaySize(1024 * 1024 * 1025), "1 GB");
-        assertEquals(FileUtils.byteCountToDisplaySize((1024 * 1024 * 1024 * 2) - 1), "1 GB");
+        assertEquals(FileUtils.byteCountToDisplaySize(1024 * 1024 * 1024 * 2 - 1), "1 GB");
         assertEquals(FileUtils.byteCountToDisplaySize(1024L * 1024 * 1024 * 1024), "1 TB");
         assertEquals(FileUtils.byteCountToDisplaySize(1024L * 1024 * 1024 * 1024 * 1024), "1 PB");
         assertEquals(FileUtils.byteCountToDisplaySize(1024L * 1024 * 1024 * 1024 * 1024 * 1024), "1 EB");
@@ -1127,8 +1127,8 @@ public class FileUtilsTestCase extends F
         File childDir       = new File(parentDir, "child");
         createFilesForTestCopyDirectory(grandParentDir, parentDir, childDir);
 
-        long expectedCount = (LIST_WALKER.list(grandParentDir).size() * 2);
-        long expectedSize =  (FileUtils.sizeOfDirectory(grandParentDir) * 2);
+        long expectedCount = LIST_WALKER.list(grandParentDir).size() * 2;
+        long expectedSize =  FileUtils.sizeOfDirectory(grandParentDir) * 2;
         FileUtils.copyDirectory(grandParentDir, childDir);
         assertEquals(expectedCount, LIST_WALKER.list(grandParentDir).size());
         assertEquals(expectedSize, FileUtils.sizeOfDirectory(grandParentDir));
@@ -1332,8 +1332,8 @@ public class FileUtilsTestCase extends F
         FileUtils.touch(file) ;
         assertEquals("FileUtils.touch() didn't empty the file.", 1, file.length());
         assertEquals("FileUtils.touch() changed lastModified", false, y2k == file.lastModified());
-        assertEquals("FileUtils.touch() changed lastModified to more than now-3s", true, file.lastModified() >= (now - 3000));
-        assertEquals("FileUtils.touch() changed lastModified to less than now+3s", true, file.lastModified() <= (now + 3000));
+        assertEquals("FileUtils.touch() changed lastModified to more than now-3s", true, file.lastModified() >= now - 3000);
+        assertEquals("FileUtils.touch() changed lastModified to less than now+3s", true, file.lastModified() <= now + 3000);
     }
 
     public void testListFiles() throws Exception {
@@ -1365,7 +1365,7 @@ public class FileUtilsTestCase extends F
 
         for (int i = 0; i < count; ++i) {
             boolean found = false;
-            for(int j = 0; (( !found ) && (j < fileNames.length)); ++j) {
+            for(int j = 0; !found && j < fileNames.length; ++j) {
                 if ( fileNames[j].equals(((File) fileObjs[i]).getName())) {
                     foundFileNames.put(fileNames[j], fileNames[j]);
                     found = true;
@@ -1428,7 +1428,7 @@ public class FileUtilsTestCase extends F
             boolean found = false;
             String fileName = files.next().getName();
 
-            for (int j = 0; (( !found ) && (j < fileNames.length)); ++j) {
+            for (int j = 0; !found && j < fileNames.length; ++j) {
                 if ( fileNames[j].equals(fileName)) {
                     foundFileNames.put(fileNames[j], fileNames[j]);
                     found = true;

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/FilenameUtilsTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/FilenameUtilsTestCase.java?rev=1302748&r1=1302747&r2=1302748&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/FilenameUtilsTestCase.java (original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/FilenameUtilsTestCase.java Tue Mar 20 01:35:32 2012
@@ -32,7 +32,7 @@ import org.apache.commons.io.testtools.F
 public class FilenameUtilsTestCase extends FileBasedTestCase {
     
     private static final String SEP = "" + File.separatorChar;
-    private static final boolean WINDOWS = (File.separatorChar == '\\');
+    private static final boolean WINDOWS = File.separatorChar == '\\';
 
     private File testFile1;
     private File testFile2;

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/FilenameUtilsWildcardTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/FilenameUtilsWildcardTestCase.java?rev=1302748&r1=1302747&r2=1302748&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/FilenameUtilsWildcardTestCase.java (original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/FilenameUtilsWildcardTestCase.java Tue Mar 20 01:35:32 2012
@@ -23,7 +23,7 @@ import junit.framework.TestCase;
 
 public class FilenameUtilsWildcardTestCase extends TestCase {
 
-    private static final boolean WINDOWS = (File.separatorChar == '\\');
+    private static final boolean WINDOWS = File.separatorChar == '\\';
 
     public FilenameUtilsWildcardTestCase(String name) {
         super(name);

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/IOCaseTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/IOCaseTestCase.java?rev=1302748&r1=1302747&r2=1302748&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/IOCaseTestCase.java (original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/IOCaseTestCase.java Tue Mar 20 01:35:32 2012
@@ -31,7 +31,7 @@ import org.apache.commons.io.testtools.F
  */
 public class IOCaseTestCase extends FileBasedTestCase {
 
-    private static final boolean WINDOWS = (File.separatorChar == '\\');
+    private static final boolean WINDOWS = File.separatorChar == '\\';
 
     public IOCaseTestCase(String name) {
         super(name);

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/IOUtilsTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/IOUtilsTestCase.java?rev=1302748&r1=1302747&r2=1302748&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/IOUtilsTestCase.java (original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/IOUtilsTestCase.java Tue Mar 20 01:35:32 2012
@@ -53,7 +53,7 @@ import org.apache.commons.io.testtools.F
 public class IOUtilsTestCase extends FileBasedTestCase {
 
     /** Determine if this is windows. */
-    private static final boolean WINDOWS = (File.separatorChar == '\\');
+    private static final boolean WINDOWS = File.separatorChar == '\\';
     /*
      * Note: this is not particularly beautiful code. A better way to check for flush and close status would be to
      * implement "trojan horse" wrapper implementations of the various stream classes, which set a flag when relevant

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/LineIteratorTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/LineIteratorTestCase.java?rev=1302748&r1=1302747&r2=1302748&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/LineIteratorTestCase.java (original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/LineIteratorTestCase.java Tue Mar 20 01:35:32 2012
@@ -402,7 +402,7 @@ public class LineIteratorTestCase extend
             @Override
             protected boolean isValidLine(String line) {
                 char c = line.charAt(line.length() - 1);
-                return ((c - 48) % 3 != 1);
+                return (c - 48) % 3 != 1;
             }
         };
         try {

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/filefilter/FileFilterTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/filefilter/FileFilterTestCase.java?rev=1302748&r1=1302747&r2=1302748&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/filefilter/FileFilterTestCase.java (original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/filefilter/FileFilterTestCase.java Tue Mar 20 01:35:32 2012
@@ -43,7 +43,7 @@ public class FileFilterTestCase extends 
      */
     static final String SVN_DIR_NAME = ".svn";
     
-    private static final boolean WINDOWS = (File.separatorChar == '\\');
+    private static final boolean WINDOWS = File.separatorChar == '\\';
 
     public FileFilterTestCase(String name) {
         super(name);

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/NullInputStreamTest.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/NullInputStreamTest.java?rev=1302748&r1=1302747&r2=1302748&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/NullInputStreamTest.java (original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/NullInputStreamTest.java Tue Mar 20 01:35:32 2012
@@ -53,7 +53,7 @@ public class NullInputStreamTest extends
         int size = 5;
         InputStream input = new TestNullInputStream(size);
         for (int i = 0; i < size; i++) {
-            assertEquals("Check Size [" + i + "]", (size - i), input.available());
+            assertEquals("Check Size [" + i + "]", size - i, input.available());
             assertEquals("Check Value [" + i + "]", i, input.read());
         }
         assertEquals("Available after contents all read", 0, input.available());
@@ -166,7 +166,7 @@ public class NullInputStreamTest extends
 
         // Read further
         for (int i = 0; i < 3; i++) {
-            assertEquals("Read After Mark [" + i +"]",  (position + i), input.read());
+            assertEquals("Read After Mark [" + i +"]",  position + i, input.read());
         }
 
         // Reset
@@ -174,7 +174,7 @@ public class NullInputStreamTest extends
 
         // Read From marked position
         for (int i = 0; i < readlimit + 1; i++) {
-            assertEquals("Read After Reset [" + i +"]",  (position + i), input.read());
+            assertEquals("Read After Reset [" + i +"]",  position + i, input.read());
         }
 
         // Reset after read limit passed
@@ -245,7 +245,7 @@ public class NullInputStreamTest extends
         }
         @Override
         protected int processByte() {
-            return ((int)getPosition() - 1);
+            return (int)getPosition() - 1;
         }
         @Override
         protected void processBytes(byte[] bytes, int offset, int length) {

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/NullReaderTest.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/NullReaderTest.java?rev=1302748&r1=1302747&r2=1302748&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/NullReaderTest.java (original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/NullReaderTest.java Tue Mar 20 01:35:32 2012
@@ -163,7 +163,7 @@ public class NullReaderTest extends Test
 
         // Read further
         for (int i = 0; i < 3; i++) {
-            assertEquals("Read After Mark [" + i +"]",  (position + i), reader.read());
+            assertEquals("Read After Mark [" + i +"]",  position + i, reader.read());
         }
 
         // Reset
@@ -171,7 +171,7 @@ public class NullReaderTest extends Test
 
         // Read From marked position
         for (int i = 0; i < readlimit + 1; i++) {
-            assertEquals("Read After Reset [" + i +"]",  (position + i), reader.read());
+            assertEquals("Read After Reset [" + i +"]",  position + i, reader.read());
         }
 
         // Reset after read limit passed
@@ -242,7 +242,7 @@ public class NullReaderTest extends Test
         }
         @Override
         protected int processChar() {
-            return ((int)getPosition() - 1);
+            return (int)getPosition() - 1;
         }
         @Override
         protected void processChars(char[] chars, int offset, int length) {

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/XmlStreamReaderTest.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/XmlStreamReaderTest.java?rev=1302748&r1=1302747&r2=1302748&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/XmlStreamReaderTest.java (original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/XmlStreamReaderTest.java Tue Mar 20 01:35:32 2012
@@ -243,14 +243,14 @@ public class XmlStreamReaderTest extends
     public void _testAlternateDefaultEncoding(String cT, String bomEnc,
             String streamEnc, String prologEnc, String alternateEnc)
             throws Exception {
-        InputStream is = getXmlStream(bomEnc, (prologEnc == null) ? XML1
+        InputStream is = getXmlStream(bomEnc, prologEnc == null ? XML1
                 : XML3, streamEnc, prologEnc);
         XmlStreamReader xmlReader = new XmlStreamReader(is, cT, false, alternateEnc);
         if (!streamEnc.equals("UTF-16")) {
             // we can not assert things here because UTF-8, US-ASCII and
             // ISO-8859-1 look alike for the chars used for detection
             // (niallp 2010-10-06 - I re-instated the check below - the tests(6) passed)
-            String enc = (alternateEnc != null) ? alternateEnc : streamEnc;
+            String enc = alternateEnc != null ? alternateEnc : streamEnc;
             assertEquals(xmlReader.getEncoding(), enc);
         } else {
             //String enc = (alternateEnc != null) ? alternateEnc : streamEnc;
@@ -262,7 +262,7 @@ public class XmlStreamReaderTest extends
     public void _testHttpValid(String cT, String bomEnc, String streamEnc,
             String prologEnc) throws Exception {
         InputStream is = getXmlStream(bomEnc,
-                (prologEnc == null) ? XML1 : XML3, streamEnc, prologEnc);
+                prologEnc == null ? XML1 : XML3, streamEnc, prologEnc);
         XmlStreamReader xmlReader = new XmlStreamReader(is, cT, false);
         if (!streamEnc.equals("UTF-16")) {
             // we can not assert things here because UTF-8, US-ASCII and
@@ -278,7 +278,7 @@ public class XmlStreamReaderTest extends
     protected void _testHttpInvalid(String cT, String bomEnc, String streamEnc,
             String prologEnc) throws Exception {
         InputStream is = getXmlStream(bomEnc,
-                (prologEnc == null) ? XML2 : XML3, streamEnc, prologEnc);
+                prologEnc == null ? XML2 : XML3, streamEnc, prologEnc);
         try {
             new XmlStreamReader(is, cT, false);
             fail("It should have failed for HTTP Content-type " + cT + ", BOM "
@@ -292,7 +292,7 @@ public class XmlStreamReaderTest extends
     protected void _testHttpLenient(String cT, String bomEnc, String streamEnc,
             String prologEnc, String shouldbe) throws Exception {
         InputStream is = getXmlStream(bomEnc,
-                (prologEnc == null) ? XML2 : XML3, streamEnc, prologEnc);
+                prologEnc == null ? XML2 : XML3, streamEnc, prologEnc);
         XmlStreamReader xmlReader = new XmlStreamReader(is, cT, true);
         assertEquals(xmlReader.getEncoding(), shouldbe);
     }

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/compatibility/XmlStreamReader.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/compatibility/XmlStreamReader.java?rev=1302748&r1=1302747&r2=1302748&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/compatibility/XmlStreamReader.java (original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/compatibility/XmlStreamReader.java Tue Mar 20 01:35:32 2012
@@ -305,7 +305,7 @@ public class XmlStreamReader extends Rea
     public XmlStreamReader(InputStream is, String httpContentType,
             boolean lenient, String defaultEncoding) throws IOException,
             XmlStreamReaderException {
-        this.defaultEncoding = (defaultEncoding == null) ? staticDefaultEncoding
+        this.defaultEncoding = defaultEncoding == null ? staticDefaultEncoding
                 : defaultEncoding;
         try {
             doHttpStream(is, httpContentType, lenient);
@@ -377,7 +377,7 @@ public class XmlStreamReader extends Rea
                 encoding = ex.getContentTypeEncoding();
             }
             if (encoding == null) {
-                encoding = (defaultEncoding == null) ? UTF_8 : defaultEncoding;
+                encoding = defaultEncoding == null ? UTF_8 : defaultEncoding;
             }
             prepareReader(ex.getInputStream(), encoding);
         }
@@ -442,7 +442,7 @@ public class XmlStreamReader extends Rea
         String encoding;
         if (bomEnc == null) {
             if (xmlGuessEnc == null || xmlEnc == null) {
-                encoding = (defaultEncoding == null) ? UTF_8 : defaultEncoding;
+                encoding = defaultEncoding == null ? UTF_8 : defaultEncoding;
             } else if (xmlEnc.equals(UTF_16)
                     && (xmlGuessEnc.equals(UTF_16BE) || xmlGuessEnc
                             .equals(UTF_16LE))) {
@@ -498,7 +498,7 @@ public class XmlStreamReader extends Rea
                         encoding = calculateRawEncoding(bomEnc, xmlGuessEnc,
                                 xmlEnc, is);
                     } else {
-                        encoding = (defaultEncoding == null) ? US_ASCII
+                        encoding = defaultEncoding == null ? US_ASCII
                                 : defaultEncoding;
                     }
                 } else if (bomEnc != null
@@ -534,7 +534,7 @@ public class XmlStreamReader extends Rea
         String mime = null;
         if (httpContentType != null) {
             int i = httpContentType.indexOf(";");
-            mime = ((i == -1) ? httpContentType : httpContentType.substring(0,
+            mime = (i == -1 ? httpContentType : httpContentType.substring(0,
                     i)).trim();
         }
         return mime;
@@ -552,8 +552,8 @@ public class XmlStreamReader extends Rea
             if (i > -1) {
                 String postMime = httpContentType.substring(i + 1);
                 Matcher m = CHARSET_PATTERN.matcher(postMime);
-                encoding = (m.find()) ? m.group(1) : null;
-                encoding = (encoding != null) ? encoding.toUpperCase() : null;
+                encoding = m.find() ? m.group(1) : null;
+                encoding = encoding != null ? encoding.toUpperCase() : null;
             }
         }
         return encoding;
@@ -676,16 +676,16 @@ public class XmlStreamReader extends Rea
                 && (mime.equals("application/xml")
                         || mime.equals("application/xml-dtd")
                         || mime
-                                .equals("application/xml-external-parsed-entity") || (mime
-                        .startsWith("application/") && mime.endsWith("+xml")));
+                                .equals("application/xml-external-parsed-entity") || mime
+                        .startsWith("application/") && mime.endsWith("+xml"));
     }
 
     // indicates if the MIME type belongs to the TEXT XML family
     static boolean isTextXml(String mime) {
         return mime != null
                 && (mime.equals("text/xml")
-                        || mime.equals("text/xml-external-parsed-entity") || (mime
-                        .startsWith("text/") && mime.endsWith("+xml")));
+                        || mime.equals("text/xml-external-parsed-entity") || mime
+                        .startsWith("text/") && mime.endsWith("+xml"));
     }
 
     private static final MessageFormat RAW_EX_1 = new MessageFormat(

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/XmlStreamWriterTest.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/XmlStreamWriterTest.java?rev=1302748&r1=1302747&r2=1302748&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/XmlStreamWriterTest.java (original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/XmlStreamWriterTest.java Tue Mar 20 01:35:32 2012
@@ -69,7 +69,7 @@ public class XmlStreamWriterTest extends
         String xml = createXmlContent(text, encoding);
         String effectiveEncoding = encoding;
         if (effectiveEncoding == null) {
-            effectiveEncoding = (defaultEncoding == null ? "UTF-8" : defaultEncoding);
+            effectiveEncoding = defaultEncoding == null ? "UTF-8" : defaultEncoding;
         }
         checkXmlContent(xml, effectiveEncoding, defaultEncoding);
     }



Mime
View raw message