commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From krosenv...@apache.org
Subject svn commit: r1686260 [5/5] - in /commons/proper/io/trunk/src: main/java/org/apache/commons/io/ main/java/org/apache/commons/io/input/ main/java/org/apache/commons/io/monitor/ test/java/org/apache/commons/io/ test/java/org/apache/commons/io/filefilter/ ...
Date Thu, 18 Jun 2015 15:57:57 GMT
Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/ClassLoaderObjectInputStreamTest.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/ClassLoaderObjectInputStreamTest.java?rev=1686260&r1=1686259&r2=1686260&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/ClassLoaderObjectInputStreamTest.java
(original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/ClassLoaderObjectInputStreamTest.java
Thu Jun 18 15:57:56 2015
@@ -47,14 +47,14 @@ public class ClassLoaderObjectInputStrea
         final ObjectOutputStream oos = new ObjectOutputStream(baos);
 
         final Object input = Boolean.FALSE;
-        oos.writeObject( input );
+        oos.writeObject(input);
 
         final InputStream bais = new ByteArrayInputStream(baos.toByteArray());
         final ClassLoaderObjectInputStream clois =
-            new ClassLoaderObjectInputStream(getClass().getClassLoader(), bais);
+                new ClassLoaderObjectInputStream(getClass().getClassLoader(), bais);
         final Object result = clois.readObject();
 
-        assertEquals(input, result );
+        assertEquals(input, result);
         clois.close();
     }
 
@@ -63,12 +63,12 @@ public class ClassLoaderObjectInputStrea
         final ByteArrayOutputStream baos = new ByteArrayOutputStream();
         final ObjectOutputStream oos = new ObjectOutputStream(baos);
 
-        final Object input = Long.valueOf(123);
+        final Object input = (long) 123;
         oos.writeObject(input);
 
         final InputStream bais = new ByteArrayInputStream(baos.toByteArray());
         final ClassLoaderObjectInputStream clois =
-            new ClassLoaderObjectInputStream(getClass().getClassLoader(), bais);
+                new ClassLoaderObjectInputStream(getClass().getClassLoader(), bais);
         final Object result = clois.readObject();
 
         assertEquals(input, result);
@@ -86,14 +86,14 @@ public class ClassLoaderObjectInputStrea
 
         final InputStream bais = new ByteArrayInputStream(baos.toByteArray());
         final ClassLoaderObjectInputStream clois =
-            new ClassLoaderObjectInputStream(getClass().getClassLoader(), bais);
+                new ClassLoaderObjectInputStream(getClass().getClassLoader(), bais);
         final long result = clois.readLong();
 
         assertEquals(input, result);
         clois.close();
     }
 
-    private static enum E{A, B, C}
+    private static enum E {A, B, C}
 
     private static class Test implements Serializable {
         private static final long serialVersionUID = 1L;
@@ -108,6 +108,7 @@ public class ClassLoaderObjectInputStrea
             this.e = E.A;
             this.o = o;
         }
+
         @Override
         public boolean equals(Object other) {
             if (other instanceof Test) {
@@ -119,12 +120,14 @@ public class ClassLoaderObjectInputStrea
                 return false;
             }
         }
+
         private boolean equalObject(Object other) {
             if (this.o == null) {
                 return other == null;
             }
             return o.equals(other);
         }
+
         @Override
         public int hashCode() {
             return super.hashCode();
@@ -142,7 +145,7 @@ public class ClassLoaderObjectInputStrea
 
         final InputStream bais = new ByteArrayInputStream(baos.toByteArray());
         final ClassLoaderObjectInputStream clois =
-            new ClassLoaderObjectInputStream(getClass().getClassLoader(), bais);
+                new ClassLoaderObjectInputStream(getClass().getClassLoader(), bais);
         final Object result = clois.readObject();
 
         assertEquals(input, result);
@@ -154,13 +157,13 @@ public class ClassLoaderObjectInputStrea
         final ByteArrayOutputStream baos = new ByteArrayOutputStream();
         final ObjectOutputStream oos = new ObjectOutputStream(baos);
 
-        final Object input = new Test(123, Integer.valueOf(0));
+        final Object input = new Test(123, 0);
         oos.writeObject(input);
         oos.close();
 
         final InputStream bais = new ByteArrayInputStream(baos.toByteArray());
         final ClassLoaderObjectInputStream clois =
-            new ClassLoaderObjectInputStream(getClass().getClassLoader(), bais);
+                new ClassLoaderObjectInputStream(getClass().getClassLoader(), bais);
         final Object result = clois.readObject();
 
         assertEquals(input, result);
@@ -171,12 +174,12 @@ public class ClassLoaderObjectInputStrea
 
         final ByteArrayOutputStream baos = new ByteArrayOutputStream();
         final ObjectOutputStream oos = new ObjectOutputStream(baos);
-        oos.writeObject( Boolean.FALSE );
+        oos.writeObject(Boolean.FALSE);
         final InputStream bais = new ByteArrayInputStream(baos.toByteArray());
 
         final ClassLoaderObjectInputStream clois =
-            new ClassLoaderObjectInputStream(getClass().getClassLoader(), bais);
-        final String[] interfaces = new String[] { Comparable.class.getName() };
+                new ClassLoaderObjectInputStream(getClass().getClassLoader(), bais);
+        final String[] interfaces = new String[]{Comparable.class.getName()};
         final Class<?> result = clois.resolveProxyClass(interfaces);
         assertTrue("Assignable", Comparable.class.isAssignableFrom(result));
         clois.close();

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/ProxyReaderTest.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/ProxyReaderTest.java?rev=1686260&r1=1686259&r2=1686260&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/ProxyReaderTest.java
(original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/ProxyReaderTest.java
Thu Jun 18 15:57:56 2015
@@ -44,7 +44,7 @@ public class ProxyReaderTest extends Tes
         }
 
         try {
-            proxy.read((char[])null, 0, 0);
+            proxy.read(null, 0, 0);
         } catch(final Exception e) {
             fail("Writing null String threw " + e);
         }

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/ReversedLinesFileReaderTestParamBlockSize.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/ReversedLinesFileReaderTestParamBlockSize.java?rev=1686260&r1=1686259&r2=1686260&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/ReversedLinesFileReaderTestParamBlockSize.java
(original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/ReversedLinesFileReaderTestParamBlockSize.java
Thu Jun 18 15:57:56 2015
@@ -16,9 +16,7 @@
  */
 package org.apache.commons.io.input;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
+import static org.junit.Assert.*;
 
 import java.io.File;
 import java.io.IOException;
@@ -41,16 +39,16 @@ public class ReversedLinesFileReaderTest
 
     @SuppressWarnings("boxing")
     // small and uneven block sizes are not used in reality but are good to show that the
algorithm is solid
-    @Parameters(name = "BlockSize={0}") 
+    @Parameters(name = "BlockSize={0}")
     public static Collection<Integer[]> blockSizes() {
-            return Arrays.asList(new Integer[][] { {1}, {3}, {8}, {256}, {4096} });
+        return Arrays.asList(new Integer[][]{{1}, {3}, {8}, {256}, {4096}});
     }
 
     private ReversedLinesFileReader reversedLinesFileReader;
     private final int testParamBlockSize;
 
     public ReversedLinesFileReaderTestParamBlockSize(final Integer testWithBlockSize) {
-        testParamBlockSize = testWithBlockSize.intValue();
+        testParamBlockSize = testWithBlockSize;
     }
 
     // Strings are escaped in constants to avoid java source encoding issues (source file
enc is UTF-8):
@@ -63,12 +61,11 @@ public class ReversedLinesFileReaderTest
     private static final String TEST_LINE_SHIFT_JIS2 = "Kanji letters: \u660E\u8F38\u5B50\u4EAC";
 
 
-
     @After
     public void closeReader() {
         try {
             reversedLinesFileReader.close();
-        } catch(final Exception e) {
+        } catch (final Exception e) {
             // ignore
         }
     }
@@ -86,6 +83,7 @@ public class ReversedLinesFileReaderTest
         reversedLinesFileReader = new ReversedLinesFileReader(testFileIso, testParamBlockSize,
UTF_8);
         assertFileWithShrinkingTestLines(reversedLinesFileReader);
     }
+
     @Test
     public void testUTF8FileCRBreaks() throws URISyntaxException, IOException {
         final File testFileIso = new File(this.getClass().getResource("/test-file-utf8-cr-only.bin").toURI());
@@ -151,21 +149,21 @@ public class ReversedLinesFileReaderTest
         final File testFileIso = new File(this.getClass().getResource("/test-file-iso8859-1-shortlines-win-linebr.bin").toURI());
         reversedLinesFileReader = new ReversedLinesFileReader(testFileIso, testParamBlockSize,
ISO_8859_1);
 
-        for(int i=3;i>0;i--) {
-            for(int j=1;j<=3;j++) {
+        for (int i = 3; i > 0; i--) {
+            for (int j = 1; j <= 3; j++) {
                 assertEqualsAndNoLineBreaks("", reversedLinesFileReader.readLine());
             }
-            assertEqualsAndNoLineBreaks(""+i, reversedLinesFileReader.readLine());
+            assertEqualsAndNoLineBreaks("" + i, reversedLinesFileReader.readLine());
         }
     }
 
-    @Test(expected=UnsupportedEncodingException.class)
+    @Test(expected = UnsupportedEncodingException.class)
     public void testUnsupportedEncodingUTF16() throws URISyntaxException, IOException {
         final File testFileEmpty = new File(this.getClass().getResource("/test-file-empty.bin").toURI());
         new ReversedLinesFileReader(testFileEmpty, testParamBlockSize, "UTF-16").close();
     }
 
-    @Test(expected=UnsupportedEncodingException.class)
+    @Test(expected = UnsupportedEncodingException.class)
     public void testUnsupportedEncodingBig5() throws URISyntaxException, IOException {
         final File testFileEncodingBig5 = new File(this.getClass().getResource("/test-file-empty.bin").toURI());
         new ReversedLinesFileReader(testFileEncodingBig5, testParamBlockSize, "Big5").close();
@@ -176,17 +174,18 @@ public class ReversedLinesFileReaderTest
         int lineCount = 0;
         while ((line = reversedLinesFileReader.readLine()) != null) {
             lineCount++;
-            assertEqualsAndNoLineBreaks("Line "+lineCount+" is not matching", TEST_LINE.substring(0,
lineCount), line);
+            assertEqualsAndNoLineBreaks("Line " + lineCount + " is not matching", TEST_LINE.substring(0,
lineCount), line);
         }
     }
 
     static void assertEqualsAndNoLineBreaks(final String msg, final String expected, final
String actual) {
-        if(actual!=null) {
-            assertFalse("Line contains \\n: line="+actual, actual.contains("\n"));
-            assertFalse("Line contains \\r: line="+actual, actual.contains("\r"));
+        if (actual != null) {
+            assertFalse("Line contains \\n: line=" + actual, actual.contains("\n"));
+            assertFalse("Line contains \\r: line=" + actual, actual.contains("\r"));
         }
         assertEquals(msg, expected, actual);
     }
+
     static void assertEqualsAndNoLineBreaks(final String expected, final String actual) {
         assertEqualsAndNoLineBreaks(null, expected, actual);
     }

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/ReversedLinesFileReaderTestParamFile.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/ReversedLinesFileReaderTestParamFile.java?rev=1686260&r1=1686259&r2=1686260&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/ReversedLinesFileReaderTestParamFile.java
(original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/input/ReversedLinesFileReaderTestParamFile.java
Thu Jun 18 15:57:56 2015
@@ -37,28 +37,27 @@ import org.junit.runners.Parameterized.P
 
 /**
  * Test checks symmetric behaviour with  BufferedReader
- *
  */
 @RunWith(Parameterized.class)
 public class ReversedLinesFileReaderTestParamFile {
 
-    @Parameters(name = "{0}, charset={1}") 
+    @Parameters(name = "{0}, charset={1}")
     public static Collection<Object[]> blockSizes() {
-            return Arrays.asList(new Object[][] {
-                    {"test-file-20byteslength.bin", "ISO_8859_1", null},
-                    {"test-file-iso8859-1-shortlines-win-linebr.bin", "ISO_8859_1", null},
-                    {"test-file-iso8859-1.bin", "ISO_8859_1", null},
-                    {"test-file-shiftjis.bin", "Shift_JIS", null},
-                    {"test-file-utf16be.bin", "UTF-16BE", null},
-                    {"test-file-utf16le.bin", "UTF-16LE", null},
-                    {"test-file-utf8-cr-only.bin", "UTF-8", null},
-                    {"test-file-utf8-win-linebr.bin", "UTF-8", null},
-                    {"test-file-utf8-win-linebr.bin", "UTF-8", Integer.valueOf(1)},
-                    {"test-file-utf8-win-linebr.bin", "UTF-8", Integer.valueOf(2)},
-                    {"test-file-utf8-win-linebr.bin", "UTF-8", Integer.valueOf(3)},
-                    {"test-file-utf8-win-linebr.bin", "UTF-8", Integer.valueOf(4)},
-                    {"test-file-utf8.bin", "UTF-8", null},
-            });
+        return Arrays.asList(new Object[][]{
+                {"test-file-20byteslength.bin", "ISO_8859_1", null},
+                {"test-file-iso8859-1-shortlines-win-linebr.bin", "ISO_8859_1", null},
+                {"test-file-iso8859-1.bin", "ISO_8859_1", null},
+                {"test-file-shiftjis.bin", "Shift_JIS", null},
+                {"test-file-utf16be.bin", "UTF-16BE", null},
+                {"test-file-utf16le.bin", "UTF-16LE", null},
+                {"test-file-utf8-cr-only.bin", "UTF-8", null},
+                {"test-file-utf8-win-linebr.bin", "UTF-8", null},
+                {"test-file-utf8-win-linebr.bin", "UTF-8", 1},
+                {"test-file-utf8-win-linebr.bin", "UTF-8", 2},
+                {"test-file-utf8-win-linebr.bin", "UTF-8", 3},
+                {"test-file-utf8-win-linebr.bin", "UTF-8", 4},
+                {"test-file-utf8.bin", "UTF-8", null},
+        });
     }
 
     private ReversedLinesFileReader reversedLinesFileReader;
@@ -71,12 +70,12 @@ public class ReversedLinesFileReaderTest
     public ReversedLinesFileReaderTestParamFile(final String fileName, final String encoding,
final Integer buffsize) {
         this.fileName = fileName;
         this.encoding = encoding;
-        this.buffSize = buffsize == null ? 4096 : buffsize.intValue();
+        this.buffSize = buffsize == null ? 4096 : buffsize;
     }
 
     @Test
     public void testDataIntegrityWithBufferedReader() throws URISyntaxException, IOException
{
-        final File testFileIso = new File(this.getClass().getResource("/"+fileName).toURI());
+        final File testFileIso = new File(this.getClass().getResource("/" + fileName).toURI());
         reversedLinesFileReader = new ReversedLinesFileReader(testFileIso, buffSize, encoding);
 
         final Stack<String> lineStack = new Stack<String>();
@@ -85,12 +84,12 @@ public class ReversedLinesFileReaderTest
         String line = null;
 
         // read all lines in normal order
-        while((line = bufferedReader.readLine())!=null) {
+        while ((line = bufferedReader.readLine()) != null) {
             lineStack.push(line);
         }
 
         // read in reverse order and compare with lines from stack
-        while((line = reversedLinesFileReader.readLine())!=null) {
+        while ((line = reversedLinesFileReader.readLine()) != null) {
             final String lineFromBufferedReader = lineStack.pop();
             assertEquals(lineFromBufferedReader, line);
         }
@@ -101,16 +100,15 @@ public class ReversedLinesFileReaderTest
     public void closeReader() {
         try {
             bufferedReader.close();
-        } catch(final Exception e) {
+        } catch (final Exception e) {
             // ignore
         }
         try {
             reversedLinesFileReader.close();
-        } catch(final Exception e) {
+        } catch (final Exception e) {
             // ignore
         }
     }
 
 
-
 }

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=1686260&r1=1686259&r2=1686260&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
Thu Jun 18 15:57:56 2015
@@ -16,9 +16,7 @@
  */
 package org.apache.commons.io.input;
 
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.Assert.*;
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
@@ -73,7 +71,7 @@ public class XmlStreamReaderTest {
             new XmlStreamReader(is, false);
             fail("It should have failed");
         } catch (final IOException ex) {
-            assertTrue(ex.getMessage().indexOf("Invalid encoding,") > -1);
+            assertTrue(ex.getMessage().contains("Invalid encoding,"));
         }
     }
 
@@ -131,7 +129,7 @@ public class XmlStreamReaderTest {
     }
 
     protected void _testRawBomInvalid(final String bomEnc, final String streamEnc,
-            final String prologEnc) throws Exception {
+                                      final String prologEnc) throws Exception {
         final InputStream is = getXmlStream(bomEnc, XML3, streamEnc, prologEnc);
         XmlStreamReader xmlReader = null;
         try {
@@ -141,7 +139,7 @@ public class XmlStreamReaderTest {
                     + streamEnc + " and prologEnc " + prologEnc + ": found "
                     + foundEnc);
         } catch (final IOException ex) {
-            assertTrue(ex.getMessage().indexOf("Invalid encoding,") > -1);
+            assertTrue(ex.getMessage().contains("Invalid encoding,"));
         }
         if (xmlReader != null) {
             xmlReader.close();
@@ -184,7 +182,7 @@ public class XmlStreamReaderTest {
         _testRawBomInvalid("UTF-32BE-bom", "UTF-32BE", "UTF-32LE");
         _testRawBomInvalid("UTF-32LE-bom", "UTF-32LE", "UTF-32BE");
         _testRawBomInvalid("UTF-32LE-bom", "UTF-32LE", "UTF-8");
-}
+    }
 
 
     @Test
@@ -298,7 +296,7 @@ public class XmlStreamReaderTest {
     }
 
     public void _testAlternateDefaultEncoding(final String cT, final String bomEnc,
-            final String streamEnc, final String prologEnc, final String alternateEnc)
+                                              final String streamEnc, final String prologEnc,
final String alternateEnc)
             throws Exception {
         final InputStream is = getXmlStream(bomEnc, prologEnc == null ? XML1
                 : XML3, streamEnc, prologEnc);
@@ -318,7 +316,7 @@ public class XmlStreamReaderTest {
     }
 
     public void _testHttpValid(final String cT, final String bomEnc, final String streamEnc,
-            final String prologEnc) throws Exception {
+                               final String prologEnc) throws Exception {
         final InputStream is = getXmlStream(bomEnc,
                 prologEnc == null ? XML1 : XML3, streamEnc, prologEnc);
         final XmlStreamReader xmlReader = new XmlStreamReader(is, cT, false);
@@ -335,7 +333,7 @@ public class XmlStreamReaderTest {
     }
 
     protected void _testHttpInvalid(final String cT, final String bomEnc, final String streamEnc,
-            final String prologEnc) throws Exception {
+                                    final String prologEnc) throws Exception {
         final InputStream is = getXmlStream(bomEnc,
                 prologEnc == null ? XML2 : XML3, streamEnc, prologEnc);
         try {
@@ -344,12 +342,12 @@ public class XmlStreamReaderTest {
                     + bomEnc + ", streamEnc " + streamEnc + " and prologEnc "
                     + prologEnc);
         } catch (final IOException ex) {
-            assertTrue(ex.getMessage().indexOf("Invalid encoding,") > -1);
+            assertTrue(ex.getMessage().contains("Invalid encoding,"));
         }
     }
 
     protected void _testHttpLenient(final String cT, final String bomEnc, final String streamEnc,
-            final String prologEnc, final String shouldbe) throws Exception {
+                                    final String prologEnc, final String shouldbe) throws
Exception {
         final InputStream is = getXmlStream(bomEnc,
                 prologEnc == null ? XML2 : XML3, streamEnc, prologEnc);
         final XmlStreamReader xmlReader = new XmlStreamReader(is, cT, true);
@@ -376,11 +374,11 @@ public class XmlStreamReaderTest {
     // XML Stream generator
 
     private static final int[] NO_BOM_BYTES = {};
-    private static final int[] UTF_16BE_BOM_BYTES = { 0xFE, 0xFF };
-    private static final int[] UTF_16LE_BOM_BYTES = { 0xFF, 0XFE };
-    private static final int[] UTF_32BE_BOM_BYTES = { 0x00, 0x00, 0xFE, 0xFF };
-    private static final int[] UTF_32LE_BOM_BYTES = { 0xFF, 0XFE, 0x00, 0x00 };
-    private static final int[] UTF_8_BOM_BYTES = { 0xEF, 0xBB, 0xBF };
+    private static final int[] UTF_16BE_BOM_BYTES = {0xFE, 0xFF};
+    private static final int[] UTF_16LE_BOM_BYTES = {0xFF, 0XFE};
+    private static final int[] UTF_32BE_BOM_BYTES = {0x00, 0x00, 0xFE, 0xFF};
+    private static final int[] UTF_32LE_BOM_BYTES = {0xFF, 0XFE, 0x00, 0x00};
+    private static final int[] UTF_8_BOM_BYTES = {0xEF, 0xBB, 0xBF};
 
     private static final Map<String, int[]> BOMs = new HashMap<String, int[]>();
 
@@ -408,7 +406,7 @@ public class XmlStreamReaderTest {
     private static final MessageFormat INFO = new MessageFormat(
             "\nBOM : {0}\nDoc : {1}\nStream Enc : {2}\nProlog Enc : {3}\n");
 
-    private static final Map<String,MessageFormat> XMLs = new HashMap<String,MessageFormat>();
+    private static final Map<String, MessageFormat> XMLs = new HashMap<String, MessageFormat>();
 
     static {
         XMLs.put(XML1, XML);
@@ -419,16 +417,15 @@ public class XmlStreamReaderTest {
     }
 
     /**
-     *
-     * @param bomType no-bom, UTF-16BE-bom, UTF-16LE-bom, UTF-8-bom
-     * @param xmlType xml, xml-prolog, xml-prolog-charset
+     * @param bomType   no-bom, UTF-16BE-bom, UTF-16LE-bom, UTF-8-bom
+     * @param xmlType   xml, xml-prolog, xml-prolog-charset
      * @param streamEnc encoding of the stream
      * @param prologEnc encoding of the prolog
      * @return XML stream
      * @throws IOException If an I/O error occurs
      */
     protected InputStream getXmlStream(final String bomType, final String xmlType,
-            final String streamEnc, final String prologEnc) throws IOException {
+                                       final String streamEnc, final String prologEnc) throws
IOException {
         final ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
         int[] bom = BOMs.get(bomType);
         if (bom == null) {
@@ -456,10 +453,10 @@ public class XmlStreamReaderTest {
      * Create the XML.
      */
     private String getXML(final String bomType, final String xmlType,
-            final String streamEnc, final String prologEnc) {
+                          final String streamEnc, final String prologEnc) {
         final MessageFormat xml = XMLs.get(xmlType);
-        final String info = INFO.format(new Object[] { bomType, xmlType, prologEnc });
-        final String xmlDoc = xml.format(new Object[] { streamEnc, prologEnc, info });
+        final String info = INFO.format(new Object[]{bomType, xmlType, prologEnc});
+        final String xmlDoc = xml.format(new Object[]{streamEnc, prologEnc, info});
         return xmlDoc;
     }
 }

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/ProxyWriterTest.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/ProxyWriterTest.java?rev=1686260&r1=1686259&r2=1686260&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/ProxyWriterTest.java
(original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/ProxyWriterTest.java
Thu Jun 18 15:57:56 2015
@@ -130,7 +130,7 @@ public class ProxyWriterTest extends Tes
         final ProxyWriter proxy = new ProxyWriter(new NullWriter());
 
         try {
-            proxy.append((String)null);
+            proxy.append(null);
         } catch(final Exception e) {
             fail("Appending null CharSequence threw " + e);
         }

Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/StringBuilderWriterTest.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/StringBuilderWriterTest.java?rev=1686260&r1=1686259&r2=1686260&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/StringBuilderWriterTest.java
(original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/StringBuilderWriterTest.java
Thu Jun 18 15:57:56 2015
@@ -50,7 +50,7 @@ public class StringBuilderWriterTest ext
     }
 
     public void testAppendConstructNull() throws IOException {
-        final Writer writer = new StringBuilderWriter((StringBuilder)null);
+        final Writer writer = new StringBuilderWriter(null);
         writer.append("Foo");
         assertEquals("Foo", writer.toString());
         writer.close();



Mime
View raw message