[prev in list] [next in list] [prev in thread] [next in thread]
List: jakarta-commons-dev
Subject: svn commit: r1415850 [15/15] - in /commons/proper/io/trunk/src: main/java/org/apache/commons/io/ mai
From: ggregory () apache ! org
Date: 2012-11-30 20:52:08
Message-ID: 20121130205235.B8BA42388C7C () eris ! apache ! org
[Download RAW message or body]
Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/monitor/FileAlterationObserverTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/com \
mons/io/monitor/FileAlterationObserverTestCase.java?rev=1415850&r1=1415849&r2=1415850&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/monitor/FileAlterationObserverTestCase.java \
(original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/monitor/FileAlterationObserverTestCase.java \
Fri Nov 30 20:51:39 2012 @@ -34,7 +34,7 @@ public class FileAlterationObserverTestC
*
* @param name The name of the test
*/
- public FileAlterationObserverTestCase(String name) {
+ public FileAlterationObserverTestCase(final String name) {
super(name);
testDirName = "test-observer";
}
@@ -49,7 +49,7 @@ public class FileAlterationObserverTestC
* Test add/remove listeners.
*/
public void testAddRemoveListeners() {
- FileAlterationObserver observer = new FileAlterationObserver("/foo");
+ final FileAlterationObserver observer = new FileAlterationObserver("/foo");
// Null Listener
observer.addListener(null);
assertFalse("Listeners[1]", observer.getListeners().iterator().hasNext());
@@ -57,9 +57,9 @@ public class FileAlterationObserverTestC
assertFalse("Listeners[2]", observer.getListeners().iterator().hasNext());
// Add Listener
- FileAlterationListenerAdaptor listener = new \
FileAlterationListenerAdaptor(); + final FileAlterationListenerAdaptor \
listener = new FileAlterationListenerAdaptor(); observer.addListener(listener);
- Iterator<FileAlterationListener> it = observer.getListeners().iterator();
+ final Iterator<FileAlterationListener> it = \
observer.getListeners().iterator(); assertTrue("Listeners[3]", it.hasNext());
assertEquals("Added", listener, it.next());
assertFalse("Listeners[4]", it.hasNext());
@@ -73,7 +73,7 @@ public class FileAlterationObserverTestC
* Test toString().
*/
public void testToString() {
- File file = new File("/foo");
+ final File file = new File("/foo");
FileAlterationObserver observer = null;
observer = new FileAlterationObserver(file);
@@ -94,17 +94,17 @@ public class FileAlterationObserverTestC
try {
checkAndNotify();
checkCollectionsEmpty("A");
- File testDirA = new File(testDir, "test-dir-A");
- File testDirB = new File(testDir, "test-dir-B");
- File testDirC = new File(testDir, "test-dir-C");
+ final File testDirA = new File(testDir, "test-dir-A");
+ final File testDirB = new File(testDir, "test-dir-B");
+ final File testDirC = new File(testDir, "test-dir-C");
testDirA.mkdir();
testDirB.mkdir();
testDirC.mkdir();
- File testDirAFile1 = touch(new File(testDirA, "A-file1.java"));
- File testDirAFile2 = touch(new File(testDirA, "A-file2.txt")); // filter \
should ignore this
- File testDirAFile3 = touch(new File(testDirA, "A-file3.java"));
+ final File testDirAFile1 = touch(new File(testDirA, "A-file1.java"));
+ final File testDirAFile2 = touch(new File(testDirA, "A-file2.txt")); // \
filter should ignore this + final File testDirAFile3 = touch(new \
File(testDirA, "A-file3.java"));
File testDirAFile4 = touch(new File(testDirA, "A-file4.java"));
- File testDirBFile1 = touch(new File(testDirB, "B-file1.java"));
+ final File testDirBFile1 = touch(new File(testDirB, "B-file1.java"));
checkAndNotify();
checkCollectionSizes("B", 3, 0, 0, 4, 0, 0);
@@ -143,7 +143,7 @@ public class FileAlterationObserverTestC
checkAndNotify();
checkCollectionsEmpty("G");
- } catch (Exception e) {
+ } catch (final Exception e) {
e.printStackTrace();
fail("Threw " + e);
}
@@ -161,9 +161,9 @@ public class FileAlterationObserverTestC
testDir = touch(testDir);
testDirA = touch(testDirA);
File testDirAFile1 = new File(testDirA, "A-file1.java");
- File testDirAFile2 = touch(new File(testDirA, "A-file2.java"));
+ final File testDirAFile2 = touch(new File(testDirA, "A-file2.java"));
File testDirAFile3 = new File(testDirA, "A-file3.java");
- File testDirAFile4 = touch(new File(testDirA, "A-file4.java"));
+ final File testDirAFile4 = touch(new File(testDirA, "A-file4.java"));
File testDirAFile5 = new File(testDirA, "A-file5.java");
checkAndNotify();
@@ -206,7 +206,7 @@ public class FileAlterationObserverTestC
checkCollectionSizes("F", 0, 1, 0, 1, 0, 0);
assertTrue("F testDirAFile5 exists", testDirAFile5.exists());
assertTrue("F testDirAFile5", \
listener.getCreatedFiles().contains(testDirAFile5));
- } catch (Exception e) {
+ } catch (final Exception e) {
fail("Threw " + e);
}
}
@@ -223,9 +223,9 @@ public class FileAlterationObserverTestC
testDir = touch(testDir);
testDirA = touch(testDirA);
File testDirAFile1 = touch(new File(testDirA, "A-file1.java"));
- File testDirAFile2 = touch(new File(testDirA, "A-file2.java"));
+ final File testDirAFile2 = touch(new File(testDirA, "A-file2.java"));
File testDirAFile3 = touch(new File(testDirA, "A-file3.java"));
- File testDirAFile4 = touch(new File(testDirA, "A-file4.java"));
+ final File testDirAFile4 = touch(new File(testDirA, "A-file4.java"));
File testDirAFile5 = touch(new File(testDirA, "A-file5.java"));
checkAndNotify();
@@ -265,7 +265,7 @@ public class FileAlterationObserverTestC
checkAndNotify();
checkCollectionSizes("F", 0, 1, 0, 0, 1, 0);
assertTrue("F testDirAFile5", \
listener.getChangedFiles().contains(testDirAFile5));
- } catch (Exception e) {
+ } catch (final Exception e) {
fail("Threw " + e);
}
}
@@ -281,11 +281,11 @@ public class FileAlterationObserverTestC
testDirA.mkdir();
testDir = touch(testDir);
testDirA = touch(testDirA);
- File testDirAFile1 = touch(new File(testDirA, "A-file1.java"));
- File testDirAFile2 = touch(new File(testDirA, "A-file2.java"));
- File testDirAFile3 = touch(new File(testDirA, "A-file3.java"));
- File testDirAFile4 = touch(new File(testDirA, "A-file4.java"));
- File testDirAFile5 = touch(new File(testDirA, "A-file5.java"));
+ final File testDirAFile1 = touch(new File(testDirA, "A-file1.java"));
+ final File testDirAFile2 = touch(new File(testDirA, "A-file2.java"));
+ final File testDirAFile3 = touch(new File(testDirA, "A-file3.java"));
+ final File testDirAFile4 = touch(new File(testDirA, "A-file4.java"));
+ final File testDirAFile5 = touch(new File(testDirA, "A-file5.java"));
assertTrue("B testDirAFile1 exists", testDirAFile1.exists());
assertTrue("B testDirAFile2 exists", testDirAFile2.exists());
@@ -328,7 +328,7 @@ public class FileAlterationObserverTestC
assertFalse("F testDirAFile5 exists", testDirAFile5.exists());
assertTrue("F testDirAFile5", \
listener.getDeletedFiles().contains(testDirAFile5));
- } catch (Exception e) {
+ } catch (final Exception e) {
fail("Threw " + e);
}
}
@@ -338,11 +338,11 @@ public class FileAlterationObserverTestC
*/
public void testObserveSingleFile() {
try {
- File testDirA = new File(testDir, "test-dir-A");
+ final File testDirA = new File(testDir, "test-dir-A");
File testDirAFile1 = new File(testDirA, "A-file1.java");
testDirA.mkdir();
- FileFilter nameFilter = \
FileFilterUtils.nameFileFilter(testDirAFile1.getName()); + final \
FileFilter nameFilter = FileFilterUtils.nameFileFilter(testDirAFile1.getName()); \
createObserver(testDirA, nameFilter); checkAndNotify();
checkCollectionsEmpty("A");
@@ -384,7 +384,7 @@ public class FileAlterationObserverTestC
assertFalse("E deleted", \
listener.getDeletedFiles().contains(testDirAFile2));
assertFalse("E deleted", \
listener.getDeletedFiles().contains(testDirAFile3));
- } catch (Exception e) {
+ } catch (final Exception e) {
fail("Threw " + e);
}
}
Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/BrokenOutputStreamTest.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/com \
mons/io/output/BrokenOutputStreamTest.java?rev=1415850&r1=1415849&r2=1415850&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/BrokenOutputStreamTest.java \
(original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/BrokenOutputStreamTest.java \
Fri Nov 30 20:51:39 2012 @@ -40,21 +40,21 @@ public class BrokenOutputStreamTest exte
try {
stream.write(1);
fail("Expected exception not thrown.");
- } catch (IOException e) {
+ } catch (final IOException e) {
assertEquals(exception, e);
}
try {
stream.write(new byte[1]);
fail("Expected exception not thrown.");
- } catch (IOException e) {
+ } catch (final IOException e) {
assertEquals(exception, e);
}
try {
stream.write(new byte[1], 0, 1);
fail("Expected exception not thrown.");
- } catch (IOException e) {
+ } catch (final IOException e) {
assertEquals(exception, e);
}
}
@@ -63,7 +63,7 @@ public class BrokenOutputStreamTest exte
try {
stream.flush();
fail("Expected exception not thrown.");
- } catch (IOException e) {
+ } catch (final IOException e) {
assertEquals(exception, e);
}
}
@@ -72,7 +72,7 @@ public class BrokenOutputStreamTest exte
try {
stream.close();
fail("Expected exception not thrown.");
- } catch (IOException e) {
+ } catch (final IOException e) {
assertEquals(exception, e);
}
}
Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/ByteArrayOutputStreamTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/com \
mons/io/output/ByteArrayOutputStreamTestCase.java?rev=1415850&r1=1415849&r2=1415850&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/ByteArrayOutputStreamTestCase.java \
(original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/ByteArrayOutputStreamTestCase.java \
Fri Nov 30 20:51:39 2012 @@ -34,13 +34,13 @@ public class ByteArrayOutputStreamTestCa
}
}
- public ByteArrayOutputStreamTestCase(String name) {
+ public ByteArrayOutputStreamTestCase(final String name) {
super(name);
}
- private int writeData(ByteArrayOutputStream baout,
- java.io.ByteArrayOutputStream ref,
- int count) {
+ private int writeData(final ByteArrayOutputStream baout,
+ final java.io.ByteArrayOutputStream ref,
+ final int count) {
if (count > DATA.length) {
throw new IllegalArgumentException("Requesting too many bytes");
}
@@ -55,17 +55,17 @@ public class ByteArrayOutputStreamTestCa
}
}
- private int writeData(ByteArrayOutputStream baout,
- java.io.ByteArrayOutputStream ref,
- int[] instructions) {
+ private int writeData(final ByteArrayOutputStream baout,
+ final java.io.ByteArrayOutputStream ref,
+ final int[] instructions) {
int written = 0;
- for (int instruction : instructions) {
+ for (final int instruction : instructions) {
written += writeData(baout, ref, instruction);
}
return written;
}
- private static boolean byteCmp(byte[] src, byte[] cmp) {
+ private static boolean byteCmp(final byte[] src, final byte[] cmp) {
for (int i = 0; i < cmp.length; i++) {
if (src[i] != cmp[i]) {
return false;
@@ -74,7 +74,7 @@ public class ByteArrayOutputStreamTestCa
return true;
}
- private void checkByteArrays(byte[] expected, byte[] actual) {
+ private void checkByteArrays(final byte[] expected, final byte[] actual) {
if (expected.length != actual.length) {
fail("Resulting byte arrays are not equally long");
}
@@ -84,11 +84,11 @@ public class ByteArrayOutputStreamTestCa
}
private void checkStreams(
- ByteArrayOutputStream actual,
- java.io.ByteArrayOutputStream expected) {
+ final ByteArrayOutputStream actual,
+ final java.io.ByteArrayOutputStream expected) {
assertEquals("Sizes are not equal", expected.size(), actual.size());
- byte[] buf = actual.toByteArray();
- byte[] refbuf = expected.toByteArray();
+ final byte[] buf = actual.toByteArray();
+ final byte[] refbuf = expected.toByteArray();
checkByteArrays(buf, refbuf);
}
@@ -97,8 +97,8 @@ public class ByteArrayOutputStreamTestCa
//The ByteArrayOutputStream is initialized with 32 bytes to match
//the original more closely for this test.
- ByteArrayOutputStream baout = new ByteArrayOutputStream(32);
- java.io.ByteArrayOutputStream ref = new java.io.ByteArrayOutputStream();
+ final ByteArrayOutputStream baout = new ByteArrayOutputStream(32);
+ final java.io.ByteArrayOutputStream ref = new \
java.io.ByteArrayOutputStream();
//First three writes
written = writeData(baout, ref, new int[] {4, 10, 22});
@@ -127,15 +127,15 @@ public class ByteArrayOutputStreamTestCa
//Write the commons Byte[]OutputStream to a java.io.Byte[]OutputStream
//and vice-versa to test the writeTo() method.
- ByteArrayOutputStream baout1 = new ByteArrayOutputStream(32);
+ final ByteArrayOutputStream baout1 = new ByteArrayOutputStream(32);
ref.writeTo(baout1);
- java.io.ByteArrayOutputStream ref1 = new java.io.ByteArrayOutputStream();
+ final java.io.ByteArrayOutputStream ref1 = new \
java.io.ByteArrayOutputStream(); baout.writeTo(ref1);
checkStreams(baout1, ref1);
//Testing toString(String)
- String baoutString = baout.toString("ASCII");
- String refString = ref.toString("ASCII");
+ final String baoutString = baout.toString("ASCII");
+ final String refString = ref.toString("ASCII");
assertEquals("ASCII decoded String must be equal", refString, baoutString);
//Make sure that empty ByteArrayOutputStreams really don't create garbage
Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/CloseShieldOutputStreamTest.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/com \
mons/io/output/CloseShieldOutputStreamTest.java?rev=1415850&r1=1415849&r2=1415850&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/CloseShieldOutputStreamTest.java \
(original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/CloseShieldOutputStreamTest.java \
Fri Nov 30 20:51:39 2012 @@ -53,7 +53,7 @@ public class CloseShieldOutputStreamTest
try {
shielded.write('x');
fail("write(b)");
- } catch (IOException e) {
+ } catch (final IOException e) {
// expected
}
original.write('y');
Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/ClosedOutputStreamTest.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/com \
mons/io/output/ClosedOutputStreamTest.java?rev=1415850&r1=1415849&r2=1415850&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/ClosedOutputStreamTest.java \
(original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/ClosedOutputStreamTest.java \
Fri Nov 30 20:51:39 2012 @@ -32,7 +32,7 @@ public class ClosedOutputStreamTest exte
try {
new ClosedOutputStream().write('x');
fail("write(b)");
- } catch (IOException e) {
+ } catch (final IOException e) {
// expected
}
}
Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/CountingOutputStreamTest.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/com \
mons/io/output/CountingOutputStreamTest.java?rev=1415850&r1=1415849&r2=1415850&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/CountingOutputStreamTest.java \
(original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/CountingOutputStreamTest.java \
Fri Nov 30 20:51:39 2012 @@ -33,13 +33,13 @@ import org.apache.commons.io.input.NullI
public class CountingOutputStreamTest extends TestCase {
- public CountingOutputStreamTest(String name) {
+ public CountingOutputStreamTest(final String name) {
super(name);
}
public void testCounting() throws IOException {
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- CountingOutputStream cos = new CountingOutputStream(baos);
+ final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ final CountingOutputStream cos = new CountingOutputStream(baos);
for(int i = 0; i < 20; i++) {
cos.write(i);
@@ -47,7 +47,7 @@ public class CountingOutputStreamTest ex
assertByteArrayEquals("CountingOutputStream.write(int)", baos.toByteArray(), \
0, 20);
assertEquals("CountingOutputStream.getCount()", cos.getCount(), 20);
- byte[] array = new byte[10];
+ final byte[] array = new byte[10];
for(int i = 20; i < 30; i++) {
array[i-20] = (byte)i;
}
@@ -62,7 +62,7 @@ public class CountingOutputStreamTest ex
assertByteArrayEquals("CountingOutputStream.write(byte[], int, int)", \
baos.toByteArray(), 0, 35);
assertEquals("CountingOutputStream.getCount()", cos.getCount(), 35);
- int count = cos.resetCount();
+ final int count = cos.resetCount();
assertEquals("CountingOutputStream.resetCount()", count, 35);
for(int i = 0; i < 10; i++) {
@@ -77,24 +77,24 @@ public class CountingOutputStreamTest ex
* Test for files > 2GB in size - see issue IO-84
*/
public void testLargeFiles_IO84() throws Exception {
- long size = (long)Integer.MAX_VALUE + (long)1;
+ final long size = (long)Integer.MAX_VALUE + (long)1;
- NullInputStream mock = new NullInputStream(size);
- OutputStream nos = new NullOutputStream();
- CountingOutputStream cos = new CountingOutputStream(nos);
+ final NullInputStream mock = new NullInputStream(size);
+ final OutputStream nos = new NullOutputStream();
+ final CountingOutputStream cos = new CountingOutputStream(nos);
// Test integer methods
IOUtils.copyLarge(mock, cos);
try {
cos.getCount();
fail("Expected getCount() to throw an ArithmeticException");
- } catch (ArithmeticException ae) {
+ } catch (final ArithmeticException ae) {
// expected result
}
try {
cos.resetCount();
fail("Expected resetCount() to throw an ArithmeticException");
- } catch (ArithmeticException ae) {
+ } catch (final ArithmeticException ae) {
// expected result
}
@@ -106,7 +106,7 @@ public class CountingOutputStreamTest ex
assertEquals("resetByteCount()", size, cos.resetByteCount());
}
- private void assertByteArrayEquals(String msg, byte[] array, int start, int end) \
{ + private void assertByteArrayEquals(final String msg, final byte[] array, final \
int start, final int end) { for (int i = start; i < end; i++) {
assertEquals(msg+": array[" + i + "] mismatch", array[i], i-start);
}
Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/DeferredFileOutputStreamTest.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/com \
mons/io/output/DeferredFileOutputStreamTest.java?rev=1415850&r1=1415849&r2=1415850&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/DeferredFileOutputStreamTest.java \
(original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/DeferredFileOutputStreamTest.java \
Fri Nov 30 20:51:39 2012 @@ -35,19 +35,19 @@ public class DeferredFileOutputStreamTes
/**
* The test data as a string (which is the simplest form).
*/
- private String testString = "0123456789";
+ private final String testString = "0123456789";
/**
* The test data as a byte array, derived from the string.
*/
- private byte[] testBytes = testString.getBytes();
+ private final byte[] testBytes = testString.getBytes();
/**
* Standard JUnit test case constructor.
*
* @param name The name of the test case.
*/
- public DeferredFileOutputStreamTest(String name)
+ public DeferredFileOutputStreamTest(final String name)
{
super(name);
}
@@ -58,19 +58,19 @@ public class DeferredFileOutputStreamTes
*/
public void testBelowThreshold()
{
- DeferredFileOutputStream dfos =
+ final DeferredFileOutputStream dfos =
new DeferredFileOutputStream(testBytes.length + 42, null);
try
{
dfos.write(testBytes, 0, testBytes.length);
dfos.close();
}
- catch (IOException e) {
+ catch (final IOException e) {
fail("Unexpected IOException");
}
assertTrue(dfos.isInMemory());
- byte[] resultBytes = dfos.getData();
+ final byte[] resultBytes = dfos.getData();
assertEquals(testBytes.length, resultBytes.length);
assertTrue(Arrays.equals(resultBytes, testBytes));
}
@@ -81,19 +81,19 @@ public class DeferredFileOutputStreamTes
* data being below (i.e. not exceeding) the threshold.
*/
public void testAtThreshold() {
- DeferredFileOutputStream dfos =
+ final DeferredFileOutputStream dfos =
new DeferredFileOutputStream(testBytes.length, null);
try
{
dfos.write(testBytes, 0, testBytes.length);
dfos.close();
}
- catch (IOException e) {
+ catch (final IOException e) {
fail("Unexpected IOException");
}
assertTrue(dfos.isInMemory());
- byte[] resultBytes = dfos.getData();
+ final byte[] resultBytes = dfos.getData();
assertEquals(testBytes.length, resultBytes.length);
assertTrue(Arrays.equals(resultBytes, testBytes));
}
@@ -104,19 +104,19 @@ public class DeferredFileOutputStreamTes
* as is the file itself.
*/
public void testAboveThreshold() {
- File testFile = new File("testAboveThreshold.dat");
+ final File testFile = new File("testAboveThreshold.dat");
// Ensure that the test starts from a clean base.
testFile.delete();
- DeferredFileOutputStream dfos =
+ final DeferredFileOutputStream dfos =
new DeferredFileOutputStream(testBytes.length - 5, testFile);
try
{
dfos.write(testBytes, 0, testBytes.length);
dfos.close();
}
- catch (IOException e) {
+ catch (final IOException e) {
fail("Unexpected IOException");
}
assertFalse(dfos.isInMemory());
@@ -134,14 +134,14 @@ public class DeferredFileOutputStreamTes
* once, as the threshold is crossed for the first time.
*/
public void testThresholdReached() {
- File testFile = new File("testThresholdReached.dat");
+ final File testFile = new File("testThresholdReached.dat");
// Ensure that the test starts from a clean base.
testFile.delete();
- DeferredFileOutputStream dfos =
+ final DeferredFileOutputStream dfos =
new DeferredFileOutputStream(testBytes.length / 2, testFile);
- int chunkSize = testBytes.length / 3;
+ final int chunkSize = testBytes.length / 3;
try
{
@@ -151,7 +151,7 @@ public class DeferredFileOutputStreamTes
testBytes.length - chunkSize * 2);
dfos.close();
}
- catch (IOException e) {
+ catch (final IOException e) {
fail("Unexpected IOException");
}
assertFalse(dfos.isInMemory());
@@ -168,12 +168,12 @@ public class DeferredFileOutputStreamTes
* Test wether writeTo() properly writes small content.
*/
public void testWriteToSmall(){
- File testFile = new File("testWriteToMem.dat");
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ final File testFile = new File("testWriteToMem.dat");
+ final ByteArrayOutputStream baos = new ByteArrayOutputStream();
// Ensure that the test starts from a clean base.
testFile.delete();
- DeferredFileOutputStream dfos =
+ final DeferredFileOutputStream dfos =
new DeferredFileOutputStream(testBytes.length *2, testFile);
try{
dfos.write(testBytes);
@@ -184,16 +184,16 @@ public class DeferredFileOutputStreamTes
try {
dfos.writeTo(baos);
fail("Should not have been able to write before closing");
- } catch (IOException ioe) {
+ } catch (final IOException ioe) {
// ok, as expected
}
dfos.close();
dfos.writeTo(baos);
- } catch (IOException ioe) {
+ } catch (final IOException ioe) {
fail("Unexpected IOException");
}
- byte[] copiedBytes = baos.toByteArray();
+ final byte[] copiedBytes = baos.toByteArray();
assertTrue(Arrays.equals(testBytes, copiedBytes));
testFile.delete();
@@ -203,12 +203,12 @@ public class DeferredFileOutputStreamTes
* Test wether writeTo() properly writes large content.
*/
public void testWriteToLarge(){
- File testFile = new File("testWriteToFile.dat");
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ final File testFile = new File("testWriteToFile.dat");
+ final ByteArrayOutputStream baos = new ByteArrayOutputStream();
// Ensure that the test starts from a clean base.
testFile.delete();
- DeferredFileOutputStream dfos =
+ final DeferredFileOutputStream dfos =
new DeferredFileOutputStream(testBytes.length / 2, testFile);
try{
dfos.write(testBytes);
@@ -219,16 +219,16 @@ public class DeferredFileOutputStreamTes
try {
dfos.writeTo(baos);
fail("Should not have been able to write before closeing");
- } catch (IOException ioe) {
+ } catch (final IOException ioe) {
// ok, as expected
}
dfos.close();
dfos.writeTo(baos);
- } catch (IOException ioe) {
+ } catch (final IOException ioe) {
fail("Unexpected IOException");
}
- byte[] copiedBytes = baos.toByteArray();
+ final byte[] copiedBytes = baos.toByteArray();
assertTrue(Arrays.equals(testBytes, copiedBytes));
verifyResultFile(testFile);
testFile.delete();
@@ -239,10 +239,10 @@ public class DeferredFileOutputStreamTes
*/
public void testTempFileBelowThreshold() {
- String prefix = "commons-io-test";
- String suffix = ".out";
- File tempDir = new File(".");
- DeferredFileOutputStream dfos =
+ final String prefix = "commons-io-test";
+ final String suffix = ".out";
+ final File tempDir = new File(".");
+ final DeferredFileOutputStream dfos =
new DeferredFileOutputStream(testBytes.length + 42, prefix, suffix, \
tempDir); assertNull("Check file is null-A", dfos.getFile());
try
@@ -250,7 +250,7 @@ public class DeferredFileOutputStreamTes
dfos.write(testBytes, 0, testBytes.length);
dfos.close();
}
- catch (IOException e) {
+ catch (final IOException e) {
fail("Unexpected IOException");
}
assertTrue(dfos.isInMemory());
@@ -262,10 +262,10 @@ public class DeferredFileOutputStreamTes
*/
public void testTempFileAboveThreshold() {
- String prefix = "commons-io-test";
- String suffix = ".out";
- File tempDir = new File(".");
- DeferredFileOutputStream dfos =
+ final String prefix = "commons-io-test";
+ final String suffix = ".out";
+ final File tempDir = new File(".");
+ final DeferredFileOutputStream dfos =
new DeferredFileOutputStream(testBytes.length - 5, prefix, suffix, \
tempDir); assertNull("Check file is null-A", dfos.getFile());
try
@@ -273,7 +273,7 @@ public class DeferredFileOutputStreamTes
dfos.write(testBytes, 0, testBytes.length);
dfos.close();
}
- catch (IOException e) {
+ catch (final IOException e) {
fail("Unexpected IOException");
}
assertFalse(dfos.isInMemory());
@@ -295,10 +295,10 @@ public class DeferredFileOutputStreamTes
*/
public void testTempFileAboveThresholdPrefixOnly() {
- String prefix = "commons-io-test";
- String suffix = null;
- File tempDir = null;
- DeferredFileOutputStream dfos =
+ final String prefix = "commons-io-test";
+ final String suffix = null;
+ final File tempDir = null;
+ final DeferredFileOutputStream dfos =
new DeferredFileOutputStream(testBytes.length - 5, prefix, suffix, \
tempDir); assertNull("Check file is null-A", dfos.getFile());
try
@@ -306,7 +306,7 @@ public class DeferredFileOutputStreamTes
dfos.write(testBytes, 0, testBytes.length);
dfos.close();
}
- catch (IOException e) {
+ catch (final IOException e) {
fail("Unexpected IOException");
}
assertFalse(dfos.isInMemory());
@@ -327,15 +327,15 @@ public class DeferredFileOutputStreamTes
*/
public void testTempFileError() {
- String prefix = null;
- String suffix = ".out";
- File tempDir = new File(".");
+ final String prefix = null;
+ final String suffix = ".out";
+ final File tempDir = new File(".");
try
{
new DeferredFileOutputStream(testBytes.length - 5, prefix, suffix, \
tempDir); fail("Expected IllegalArgumentException ");
}
- catch (IllegalArgumentException e) {
+ catch (final IllegalArgumentException e) {
// expected
}
}
@@ -346,13 +346,13 @@ public class DeferredFileOutputStreamTes
*
* @param testFile The file containing the test output.
*/
- private void verifyResultFile(File testFile) {
+ private void verifyResultFile(final File testFile) {
try
{
- FileInputStream fis = new FileInputStream(testFile);
+ final FileInputStream fis = new FileInputStream(testFile);
assertEquals(testBytes.length, fis.available());
- byte[] resultBytes = new byte[testBytes.length];
+ final byte[] resultBytes = new byte[testBytes.length];
assertEquals(testBytes.length, fis.read(resultBytes));
assertTrue(Arrays.equals(resultBytes, testBytes));
@@ -362,14 +362,14 @@ public class DeferredFileOutputStreamTes
{
fis.close();
}
- catch (IOException e) {
+ catch (final IOException e) {
// Ignore an exception on close
}
}
- catch (FileNotFoundException e) {
+ catch (final FileNotFoundException e) {
fail("Unexpected FileNotFoundException");
}
- catch (IOException e) {
+ catch (final IOException e) {
fail("Unexpected IOException");
}
}
Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/FileWriterWithEncodingTest.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/com \
mons/io/output/FileWriterWithEncodingTest.java?rev=1415850&r1=1415849&r2=1415850&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/FileWriterWithEncodingTest.java \
(original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/FileWriterWithEncodingTest.java \
Fri Nov 30 20:51:39 2012 @@ -42,25 +42,25 @@ public class FileWriterWithEncodingTest
private File file2;
private String textContent;
- public FileWriterWithEncodingTest(String name) {
+ public FileWriterWithEncodingTest(final String name) {
super(name);
}
@Override
public void setUp() {
- File encodingFinder = new File(getTestDirectory(), "finder.txt");
+ final File encodingFinder = new File(getTestDirectory(), "finder.txt");
OutputStreamWriter out = null;
try {
out = new OutputStreamWriter(new FileOutputStream(encodingFinder));
defaultEncoding = out.getEncoding();
- } catch (IOException ex) {
+ } catch (final IOException ex) {
throw new RuntimeException(ex.getMessage());
} finally {
IOUtils.closeQuietly(out);
}
file1 = new File(getTestDirectory(), "testfile1.txt");
file2 = new File(getTestDirectory(), "testfile2.txt");
- char[] arr = new char[1024];
+ final char[] arr = new char[1024];
for (int i = 0; i < arr.length; i++) {
arr[i] = (char) i;
}
@@ -117,7 +117,7 @@ public class FileWriterWithEncodingTest
try {
checkFile(file1, file2);
fail();
- } catch (AssertionFailedError ex) {
+ } catch (final AssertionFailedError ex) {
// success
}
@@ -145,7 +145,7 @@ public class FileWriterWithEncodingTest
try {
checkFile(file1, file2);
fail();
- } catch (AssertionFailedError ex) {
+ } catch (final AssertionFailedError ex) {
// success
}
@@ -164,7 +164,7 @@ public class FileWriterWithEncodingTest
try {
writer = new FileWriterWithEncoding(file1, "BAD-ENCODE");
fail();
- } catch (IOException ex) {
+ } catch (final IOException ex) {
// expected
assertFalse(file1.exists());
} finally {
@@ -179,7 +179,7 @@ public class FileWriterWithEncodingTest
try {
writer = new FileWriterWithEncoding(getTestDirectory(), \
defaultEncoding); fail();
- } catch (IOException ex) {
+ } catch (final IOException ex) {
// expected
assertFalse(file1.exists());
} finally {
@@ -194,7 +194,7 @@ public class FileWriterWithEncodingTest
try {
writer = new FileWriterWithEncoding((File) null, defaultEncoding);
fail();
- } catch (NullPointerException ex) {
+ } catch (final NullPointerException ex) {
// expected
assertFalse(file1.exists());
} finally {
@@ -209,7 +209,7 @@ public class FileWriterWithEncodingTest
try {
writer = new FileWriterWithEncoding((String) null, defaultEncoding);
fail();
- } catch (NullPointerException ex) {
+ } catch (final NullPointerException ex) {
// expected
assertFalse(file1.exists());
} finally {
Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/LockableFileWriterTest.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/com \
mons/io/output/LockableFileWriterTest.java?rev=1415850&r1=1415849&r2=1415850&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/LockableFileWriterTest.java \
(original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/LockableFileWriterTest.java \
Fri Nov 30 20:51:39 2012 @@ -38,7 +38,7 @@ public class LockableFileWriterTest exte
private File altLockDir;
private File altLockFile;
- public LockableFileWriterTest(String name) {
+ public LockableFileWriterTest(final String name) {
super(name);
}
@@ -73,8 +73,8 @@ public class LockableFileWriterTest exte
try {
lfw2 = new LockableFileWriter(file);
fail("Somehow able to open a locked file. ");
- } catch(IOException ioe) {
- String msg = ioe.getMessage();
+ } catch(final IOException ioe) {
+ final String msg = ioe.getMessage();
assertTrue( "Exception message does not start correctly. ",
msg.startsWith("Can't write file, lock ") );
assertTrue(file.exists());
@@ -85,8 +85,8 @@ public class LockableFileWriterTest exte
try {
lfw3 = new LockableFileWriter(file);
fail("Somehow able to open a locked file. ");
- } catch(IOException ioe) {
- String msg = ioe.getMessage();
+ } catch(final IOException ioe) {
+ final String msg = ioe.getMessage();
assertTrue( "Exception message does not start correctly. ",
msg.startsWith("Can't write file, lock ") );
assertTrue(file.exists());
@@ -116,8 +116,8 @@ public class LockableFileWriterTest exte
try {
lfw2 = new LockableFileWriter(file, true, \
altLockDir.getAbsolutePath()); fail("Somehow able to open a locked file. ");
- } catch(IOException ioe) {
- String msg = ioe.getMessage();
+ } catch(final IOException ioe) {
+ final String msg = ioe.getMessage();
assertTrue( "Exception message does not start correctly. ",
msg.startsWith("Can't write file, lock ") );
assertTrue(file.exists());
@@ -165,7 +165,7 @@ public class LockableFileWriterTest exte
try {
writer = new LockableFileWriter(file, "BAD-ENCODE");
fail();
- } catch (UnsupportedCharsetException ex) {
+ } catch (final UnsupportedCharsetException ex) {
// expected
assertFalse(file.exists());
assertFalse(lockFile.exists());
@@ -182,7 +182,7 @@ public class LockableFileWriterTest exte
try {
writer = new LockableFileWriter(getTestDirectory());
fail();
- } catch (IOException ex) {
+ } catch (final IOException ex) {
// expected
assertFalse(file.exists());
assertFalse(lockFile.exists());
@@ -199,7 +199,7 @@ public class LockableFileWriterTest exte
try {
writer = new LockableFileWriter((File) null);
fail();
- } catch (NullPointerException ex) {
+ } catch (final NullPointerException ex) {
// expected
assertFalse(file.exists());
assertFalse(lockFile.exists());
@@ -216,7 +216,7 @@ public class LockableFileWriterTest exte
try {
writer = new LockableFileWriter((String) null);
fail();
- } catch (NullPointerException ex) {
+ } catch (final NullPointerException ex) {
// expected
assertFalse(file.exists());
assertFalse(lockFile.exists());
Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/NullOutputStreamTest.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/com \
mons/io/output/NullOutputStreamTest.java?rev=1415850&r1=1415849&r2=1415850&view=diff \
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/NullOutputStreamTest.java \
(original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/NullOutputStreamTest.java \
Fri Nov 30 20:51:39 2012 @@ -31,12 +31,12 @@ import junit.framework.TestCase;
public class NullOutputStreamTest extends TestCase {
- public NullOutputStreamTest(String name) {
+ public NullOutputStreamTest(final String name) {
super(name);
}
public void testNull() throws IOException {
- NullOutputStream nos = new NullOutputStream();
+ final NullOutputStream nos = new NullOutputStream();
nos.write("string".getBytes());
nos.write("some string".getBytes(), 3, 5);
nos.write(1);
Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/NullWriterTest.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/NullWriterTest.java?rev=1415850&r1=1415849&r2=1415850&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/NullWriterTest.java \
(original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/NullWriterTest.java \
Fri Nov 30 20:51:39 2012 @@ -26,13 +26,13 @@ import junit.framework.TestCase;
*/
public class NullWriterTest extends TestCase {
- public NullWriterTest(String name) {
+ public NullWriterTest(final String name) {
super(name);
}
public void testNull() {
- char[] chars = new char[] {'A', 'B', 'C'};
- NullWriter writer = new NullWriter();
+ final char[] chars = new char[] {'A', 'B', 'C'};
+ final NullWriter writer = new NullWriter();
writer.write(1);
writer.write(chars);
writer.write(chars, 1, 1);
Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/ProxyOutputStreamTest.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/com \
mons/io/output/ProxyOutputStreamTest.java?rev=1415850&r1=1415849&r2=1415850&view=diff \
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/ProxyOutputStreamTest.java \
(original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/ProxyOutputStreamTest.java \
Fri Nov 30 20:51:39 2012 @@ -34,7 +34,7 @@ public class ProxyOutputStreamTest exten
protected void setUp() {
original = new ByteArrayOutputStream(){
@Override
- public void write(byte[] ba) throws IOException {
+ public void write(final byte[] ba) throws IOException {
if (ba != null){
super.write(ba);
}
@@ -50,7 +50,7 @@ public class ProxyOutputStreamTest exten
}
public void testWriteNullBaSucceeds() throws Exception {
- byte[] ba = null;
+ final byte[] ba = null;
original.write(ba);
proxied.write(ba);
}
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=1415850&r1=1415849&r2=1415850&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 \
Fri Nov 30 20:51:39 2012 @@ -25,17 +25,17 @@ import junit.framework.TestCase;
*/
public class ProxyWriterTest extends TestCase {
- public ProxyWriterTest(String name) {
+ public ProxyWriterTest(final String name) {
super(name);
}
/** Test Appending a CharSequence */
public void testAppendCharSequence() {
- StringBuilderWriter writer = new StringBuilderWriter();
- ProxyWriter proxy = new ProxyWriter(writer);
+ final StringBuilderWriter writer = new StringBuilderWriter();
+ final ProxyWriter proxy = new ProxyWriter(writer);
try {
proxy.append("ABC");
- } catch(Exception e) {
+ } catch(final Exception e) {
fail("Appending CharSequence threw " + e);
}
assertEquals("ABC", writer.toString());
@@ -44,11 +44,11 @@ public class ProxyWriterTest extends Tes
/** Test Writing a String */
public void testWriteString() {
- StringBuilderWriter writer = new StringBuilderWriter();
- ProxyWriter proxy = new ProxyWriter(writer);
+ final StringBuilderWriter writer = new StringBuilderWriter();
+ final ProxyWriter proxy = new ProxyWriter(writer);
try {
proxy.write("ABC");
- } catch(Exception e) {
+ } catch(final Exception e) {
fail("Writing String threw " + e);
}
assertEquals("ABC", writer.toString());
@@ -57,11 +57,11 @@ public class ProxyWriterTest extends Tes
/** Test Writing a Partial String */
public void testWriteStringPartial() {
- StringBuilderWriter writer = new StringBuilderWriter();
- ProxyWriter proxy = new ProxyWriter(writer);
+ final StringBuilderWriter writer = new StringBuilderWriter();
+ final ProxyWriter proxy = new ProxyWriter(writer);
try {
proxy.write("ABC", 1, 2);
- } catch(Exception e) {
+ } catch(final Exception e) {
fail("Writing String threw " + e);
}
assertEquals("BC", writer.toString());
@@ -70,11 +70,11 @@ public class ProxyWriterTest extends Tes
/** Test Writing a Char array */
public void testWriteCharArray() {
- StringBuilderWriter writer = new StringBuilderWriter();
- ProxyWriter proxy = new ProxyWriter(writer);
+ final StringBuilderWriter writer = new StringBuilderWriter();
+ final ProxyWriter proxy = new ProxyWriter(writer);
try {
proxy.write(new char[] {'A', 'B', 'C'});
- } catch(Exception e) {
+ } catch(final Exception e) {
fail("Writing char[] threw " + e);
}
assertEquals("ABC", writer.toString());
@@ -83,11 +83,11 @@ public class ProxyWriterTest extends Tes
/** Test Writing a Partial Char array */
public void testWriteCharArrayPartial() {
- StringBuilderWriter writer = new StringBuilderWriter();
- ProxyWriter proxy = new ProxyWriter(writer);
+ final StringBuilderWriter writer = new StringBuilderWriter();
+ final ProxyWriter proxy = new ProxyWriter(writer);
try {
proxy.write(new char[] {'A', 'B', 'C'}, 1, 2);
- } catch(Exception e) {
+ } catch(final Exception e) {
fail("Writing char[] threw " + e);
}
assertEquals("BC", writer.toString());
@@ -97,17 +97,17 @@ public class ProxyWriterTest extends Tes
/** Test writing Null String */
public void testNullString() {
- ProxyWriter proxy = new ProxyWriter(new NullWriter());
+ final ProxyWriter proxy = new ProxyWriter(new NullWriter());
try {
proxy.write((String)null);
- } catch(Exception e) {
+ } catch(final Exception e) {
fail("Writing null String threw " + e);
}
try {
proxy.write((String)null, 0, 0);
- } catch(Exception e) {
+ } catch(final Exception e) {
fail("Writing null String threw " + e);
}
}
@@ -115,17 +115,17 @@ public class ProxyWriterTest extends Tes
/** Test writing Null Char array */
public void testNullCharArray() {
- ProxyWriter proxy = new ProxyWriter(new NullWriter());
+ final ProxyWriter proxy = new ProxyWriter(new NullWriter());
try {
proxy.write((char[])null);
- } catch(Exception e) {
+ } catch(final Exception e) {
fail("Writing null char[] threw " + e);
}
try {
proxy.write((char[])null, 0, 0);
- } catch(Exception e) {
+ } catch(final Exception e) {
fail("Writing null char[] threw " + e);
}
}
@@ -133,11 +133,11 @@ public class ProxyWriterTest extends Tes
/** Test appending Null CharSequence */
public void testNullCharSequencec() {
- ProxyWriter proxy = new ProxyWriter(new NullWriter());
+ final ProxyWriter proxy = new ProxyWriter(new NullWriter());
try {
proxy.append((String)null);
- } catch(Exception e) {
+ } 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/com \
mons/io/output/StringBuilderWriterTest.java?rev=1415850&r1=1415849&r2=1415850&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 \
Fri Nov 30 20:51:39 2012 @@ -33,21 +33,21 @@ public class StringBuilderWriterTest ext
* Contruct a new test case.
* @param name The name of the test
*/
- public StringBuilderWriterTest(String name) {
+ public StringBuilderWriterTest(final String name) {
super(name);
}
/** Test {@link StringBuilderWriter} constructor. */
public void testAppendConstructCapacity() throws IOException {
- Writer writer = new StringBuilderWriter(100);
+ final Writer writer = new StringBuilderWriter(100);
writer.append("Foo");
assertEquals("Foo", writer.toString());
}
/** Test {@link StringBuilderWriter} constructor. */
public void testAppendConstructStringBuilder() {
- StringBuilder builder = new StringBuilder("Foo");
- StringBuilderWriter writer = new StringBuilderWriter(builder);
+ final StringBuilder builder = new StringBuilder("Foo");
+ final StringBuilderWriter writer = new StringBuilderWriter(builder);
writer.append("Bar");
assertEquals("FooBar", writer.toString());
assertSame(builder, writer.getBuilder());
@@ -55,40 +55,40 @@ public class StringBuilderWriterTest ext
/** Test {@link StringBuilderWriter} constructor. */
public void testAppendConstructNull() throws IOException {
- Writer writer = new StringBuilderWriter((StringBuilder)null);
+ final Writer writer = new StringBuilderWriter((StringBuilder)null);
writer.append("Foo");
assertEquals("Foo", writer.toString());
}
/** Test {@link Writer#append(char)}. */
public void testAppendChar() throws IOException {
- Writer writer = new StringBuilderWriter();
+ final Writer writer = new StringBuilderWriter();
writer.append('F').append('o').append('o');
assertEquals("Foo", writer.toString());
}
/** Test {@link Writer#append(CharSequence)}. */
public void testAppendCharSequence() throws IOException {
- Writer writer = new StringBuilderWriter();
+ final Writer writer = new StringBuilderWriter();
writer.append("Foo").append("Bar");
assertEquals("FooBar", writer.toString());
}
/** Test {@link Writer#append(CharSequence, int, int)}. */
public void testAppendCharSequencePortion() throws IOException {
- Writer writer = new StringBuilderWriter();
+ final Writer writer = new StringBuilderWriter();
writer.append("FooBar", 3, 6).append(new StringBuffer("FooBar"), 0, 3);
assertEquals("BarFoo", writer.toString());
}
/** Test {@link Writer#close()}. */
public void testClose() {
- Writer writer = new StringBuilderWriter();
+ final Writer writer = new StringBuilderWriter();
try {
writer.append("Foo");
writer.close();
writer.append("Bar");
- } catch (Throwable t) {
+ } catch (final Throwable t) {
fail("Threw: " + t);
}
assertEquals("FooBar", writer.toString());
@@ -96,7 +96,7 @@ public class StringBuilderWriterTest ext
/** Test {@link Writer#write(int)}. */
public void testWriteChar() throws IOException {
- Writer writer = new StringBuilderWriter();
+ final Writer writer = new StringBuilderWriter();
writer.write('F');
assertEquals("F", writer.toString());
writer.write('o');
@@ -107,7 +107,7 @@ public class StringBuilderWriterTest ext
/** Test {@link Writer#write(char[])}. */
public void testWriteCharArray() throws IOException {
- Writer writer = new StringBuilderWriter();
+ final Writer writer = new StringBuilderWriter();
writer.write(new char[] {'F', 'o', 'o'});
assertEquals("Foo", writer.toString());
writer.write(new char[] {'B', 'a', 'r'});
@@ -116,7 +116,7 @@ public class StringBuilderWriterTest ext
/** Test {@link Writer#write(char[], int, int)}. */
public void testWriteCharArrayPortion() throws IOException {
- Writer writer = new StringBuilderWriter();
+ final Writer writer = new StringBuilderWriter();
writer.write(FOOBAR_CHARS, 3, 3);
assertEquals("Bar", writer.toString());
writer.write(FOOBAR_CHARS, 0, 3);
@@ -125,7 +125,7 @@ public class StringBuilderWriterTest ext
/** Test {@link Writer#write(String)}. */
public void testWriteString() throws IOException {
- Writer writer = new StringBuilderWriter();
+ final Writer writer = new StringBuilderWriter();
writer.write("Foo");
assertEquals("Foo", writer.toString());
writer.write("Bar");
@@ -134,7 +134,7 @@ public class StringBuilderWriterTest ext
/** Test {@link Writer#write(String, int, int)}. */
public void testWriteStringPortion() throws IOException {
- Writer writer = new StringBuilderWriter();
+ final Writer writer = new StringBuilderWriter();
writer.write("FooBar", 3, 3);
assertEquals("Bar", writer.toString());
writer.write("FooBar", 0, 3);
Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/TaggedOutputStreamTest.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/com \
mons/io/output/TaggedOutputStreamTest.java?rev=1415850&r1=1415849&r2=1415850&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/TaggedOutputStreamTest.java \
(original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/TaggedOutputStreamTest.java \
Fri Nov 30 20:51:39 2012 @@ -31,8 +31,8 @@ public class TaggedOutputStreamTest exte
public void testNormalStream() {
try {
- ByteArrayOutputStream buffer = new ByteArrayOutputStream();
- OutputStream stream = new TaggedOutputStream(buffer);
+ final ByteArrayOutputStream buffer = new ByteArrayOutputStream();
+ final OutputStream stream = new TaggedOutputStream(buffer);
stream.write('a');
stream.write(new byte[] { 'b' });
stream.write(new byte[] { 'c' }, 0, 1);
@@ -42,26 +42,26 @@ public class TaggedOutputStreamTest exte
assertEquals('a', buffer.toByteArray()[0]);
assertEquals('b', buffer.toByteArray()[1]);
assertEquals('c', buffer.toByteArray()[2]);
- } catch (IOException e) {
+ } catch (final IOException e) {
fail("Unexpected exception thrown");
}
}
public void testBrokenStream() {
- IOException exception = new IOException("test exception");
- TaggedOutputStream stream =
+ final IOException exception = new IOException("test exception");
+ final TaggedOutputStream stream =
new TaggedOutputStream(new BrokenOutputStream(exception));
// Test the write() method
try {
stream.write('x');
fail("Expected exception not thrown.");
- } catch (IOException e) {
+ } catch (final IOException e) {
assertTrue(stream.isCauseOf(e));
try {
stream.throwIfCauseOf(e);
fail("Expected exception not thrown.");
- } catch (IOException e2) {
+ } catch (final IOException e2) {
assertEquals(exception, e2);
}
}
@@ -70,12 +70,12 @@ public class TaggedOutputStreamTest exte
try {
stream.flush();
fail("Expected exception not thrown.");
- } catch (IOException e) {
+ } catch (final IOException e) {
assertTrue(stream.isCauseOf(e));
try {
stream.throwIfCauseOf(e);
fail("Expected exception not thrown.");
- } catch (IOException e2) {
+ } catch (final IOException e2) {
assertEquals(exception, e2);
}
}
@@ -84,21 +84,21 @@ public class TaggedOutputStreamTest exte
try {
stream.close();
fail("Expected exception not thrown.");
- } catch (IOException e) {
+ } catch (final IOException e) {
assertTrue(stream.isCauseOf(e));
try {
stream.throwIfCauseOf(e);
fail("Expected exception not thrown.");
- } catch (IOException e2) {
+ } catch (final IOException e2) {
assertEquals(exception, e2);
}
}
}
public void testOtherException() {
- IOException exception = new IOException("test exception");
- OutputStream closed = new ClosedOutputStream();
- TaggedOutputStream stream = new TaggedOutputStream(closed);
+ final IOException exception = new IOException("test exception");
+ final OutputStream closed = new ClosedOutputStream();
+ final TaggedOutputStream stream = new TaggedOutputStream(closed);
assertFalse(stream.isCauseOf(exception));
assertFalse(stream.isCauseOf(
@@ -106,14 +106,14 @@ public class TaggedOutputStreamTest exte
try {
stream.throwIfCauseOf(exception);
- } catch (IOException e) {
+ } catch (final IOException e) {
fail("Unexpected exception thrown");
}
try {
stream.throwIfCauseOf(
new TaggedIOException(exception, UUID.randomUUID()));
- } catch (IOException e) {
+ } catch (final IOException e) {
fail("Unexpected exception thrown");
}
}
Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/TeeOutputStreamTest.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/com \
mons/io/output/TeeOutputStreamTest.java?rev=1415850&r1=1415849&r2=1415850&view=diff \
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/TeeOutputStreamTest.java \
(original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/TeeOutputStreamTest.java \
Fri Nov 30 20:51:39 2012 @@ -48,7 +48,7 @@ public class TeeOutputStreamTest extends
}
}
- public TeeOutputStreamTest(String name) {
+ public TeeOutputStreamTest(final String name) {
super(name);
}
@@ -57,13 +57,13 @@ public class TeeOutputStreamTest extends
* exception on {@link TeeOutputStream#close()}.
*/
public void testCloseBranchIOException() {
- ByteArrayOutputStream badOs = new ExceptionOnCloseByteArrayOutputStream();
- RecordCloseByteArrayOutputStream goodOs = new \
RecordCloseByteArrayOutputStream();
- TeeOutputStream tos = new TeeOutputStream(goodOs, badOs);
+ final ByteArrayOutputStream badOs = new \
ExceptionOnCloseByteArrayOutputStream(); + final \
RecordCloseByteArrayOutputStream goodOs = new RecordCloseByteArrayOutputStream(); + \
final TeeOutputStream tos = new TeeOutputStream(goodOs, badOs); try {
tos.close();
Assert.fail("Expected " + IOException.class.getName());
- } catch (IOException e) {
+ } catch (final IOException e) {
Assert.assertTrue(goodOs.closed);
}
}
@@ -73,27 +73,27 @@ public class TeeOutputStreamTest extends
* exception on {@link TeeOutputStream#close()}.
*/
public void testCloseMainIOException() {
- ByteArrayOutputStream badOs = new ExceptionOnCloseByteArrayOutputStream();
- RecordCloseByteArrayOutputStream goodOs = new \
RecordCloseByteArrayOutputStream();
- TeeOutputStream tos = new TeeOutputStream(badOs, goodOs);
+ final ByteArrayOutputStream badOs = new \
ExceptionOnCloseByteArrayOutputStream(); + final \
RecordCloseByteArrayOutputStream goodOs = new RecordCloseByteArrayOutputStream(); + \
final TeeOutputStream tos = new TeeOutputStream(badOs, goodOs); try {
tos.close();
Assert.fail("Expected " + IOException.class.getName());
- } catch (IOException e) {
+ } catch (final IOException e) {
Assert.assertTrue(goodOs.closed);
}
}
public void testTee() throws IOException {
- ByteArrayOutputStream baos1 = new ByteArrayOutputStream();
- ByteArrayOutputStream baos2 = new ByteArrayOutputStream();
- TeeOutputStream tos = new TeeOutputStream(baos1, baos2);
+ final ByteArrayOutputStream baos1 = new ByteArrayOutputStream();
+ final ByteArrayOutputStream baos2 = new ByteArrayOutputStream();
+ final TeeOutputStream tos = new TeeOutputStream(baos1, baos2);
for (int i = 0; i < 20; i++) {
tos.write(i);
}
assertByteArrayEquals("TeeOutputStream.write(int)", baos1.toByteArray(), \
baos2.toByteArray());
- byte[] array = new byte[10];
+ final byte[] array = new byte[10];
for (int i = 20; i < 30; i++) {
array[i - 20] = (byte) i;
}
@@ -109,7 +109,7 @@ public class TeeOutputStreamTest extends
tos.close();
}
- private void assertByteArrayEquals(String msg, byte[] array1, byte[] array2) {
+ private void assertByteArrayEquals(final String msg, final byte[] array1, final \
byte[] array2) {
assertEquals(msg + ": array size mismatch", array1.length, array2.length);
for (int i = 0; i < array1.length; i++) {
assertEquals(msg + ": array[ " + i + "] mismatch", array1[i], \
array2[i]);
Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/WriterOutputStreamTest.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/com \
mons/io/output/WriterOutputStreamTest.java?rev=1415850&r1=1415849&r2=1415850&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/WriterOutputStreamTest.java \
(original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/output/WriterOutputStreamTest.java \
Fri Nov 30 20:51:39 2012 @@ -27,33 +27,33 @@ public class WriterOutputStreamTest exte
private static final String LARGE_TEST_STRING;
static {
- StringBuilder buffer = new StringBuilder();
+ final StringBuilder buffer = new StringBuilder();
for (int i=0; i<100; i++) {
buffer.append(TEST_STRING);
}
LARGE_TEST_STRING = buffer.toString();
}
- private Random random = new Random();
+ private final Random random = new Random();
- private void testWithSingleByteWrite(String testString, String charsetName) \
throws IOException {
- byte[] bytes = testString.getBytes(charsetName);
- StringWriter writer = new StringWriter();
- WriterOutputStream out = new WriterOutputStream(writer, charsetName);
- for (byte b : bytes) {
+ private void testWithSingleByteWrite(final String testString, final String \
charsetName) throws IOException { + final byte[] bytes = \
testString.getBytes(charsetName); + final StringWriter writer = new \
StringWriter(); + final WriterOutputStream out = new \
WriterOutputStream(writer, charsetName); + for (final byte b : bytes) {
out.write(b);
}
out.close();
assertEquals(testString, writer.toString());
}
- private void testWithBufferedWrite(String testString, String charsetName) throws \
IOException {
- byte[] expected = testString.getBytes(charsetName);
- StringWriter writer = new StringWriter();
- WriterOutputStream out = new WriterOutputStream(writer, charsetName);
+ private void testWithBufferedWrite(final String testString, final String \
charsetName) throws IOException { + final byte[] expected = \
testString.getBytes(charsetName); + final StringWriter writer = new \
StringWriter(); + final WriterOutputStream out = new \
WriterOutputStream(writer, charsetName); int offset = 0;
while (offset < expected.length) {
- int length = Math.min(random.nextInt(128), expected.length-offset);
+ final int length = Math.min(random.nextInt(128), \
expected.length-offset); out.write(expected, offset, length);
offset += length;
}
@@ -103,8 +103,8 @@ public class WriterOutputStreamTest exte
public void testFlush() throws IOException {
- StringWriter writer = new StringWriter();
- WriterOutputStream out = new WriterOutputStream(writer, "us-ascii", 1024, \
false); + final StringWriter writer = new StringWriter();
+ final WriterOutputStream out = new WriterOutputStream(writer, "us-ascii", \
1024, false); out.write("abc".getBytes("us-ascii"));
assertEquals(0, writer.getBuffer().length());
out.flush();
@@ -112,8 +112,8 @@ public class WriterOutputStreamTest exte
}
public void testWriteImmediately() throws IOException {
- StringWriter writer = new StringWriter();
- WriterOutputStream out = new WriterOutputStream(writer, "us-ascii", 1024, \
true); + final StringWriter writer = new StringWriter();
+ final WriterOutputStream out = new WriterOutputStream(writer, "us-ascii", \
1024, true); out.write("abc".getBytes("us-ascii"));
assertEquals("abc", writer.toString());
}
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/com \
mons/io/output/XmlStreamWriterTest.java?rev=1415850&r1=1415849&r2=1415850&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 \
Fri Nov 30 20:51:39 2012 @@ -38,35 +38,35 @@ public class XmlStreamWriterTest extends
private static final String TEXT_UNICODE = TEXT_LATIN1 + ", " + TEXT_LATIN7
+ ", " + TEXT_LATIN15 + ", " + TEXT_EUC_JP;
- private static String createXmlContent(String text, String encoding) {
+ private static String createXmlContent(final String text, final String encoding) \
{ String xmlDecl = "<?xml version=\"1.0\"?>";
if (encoding != null) {
xmlDecl = "<?xml version=\"1.0\" encoding=\"" + encoding + "\"?>";
}
- String xml = xmlDecl + "\n<text>" + text + "</text>";
+ final String xml = xmlDecl + "\n<text>" + text + "</text>";
return xml;
}
- private static void checkXmlContent(String xml, String encoding, String \
defaultEncoding) + private static void checkXmlContent(final String xml, final \
String encoding, final String defaultEncoding) throws IOException {
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- XmlStreamWriter writer = new XmlStreamWriter(out, defaultEncoding);
+ final ByteArrayOutputStream out = new ByteArrayOutputStream();
+ final XmlStreamWriter writer = new XmlStreamWriter(out, defaultEncoding);
writer.write(xml);
writer.close();
- byte[] xmlContent = out.toByteArray();
+ final byte[] xmlContent = out.toByteArray();
assertEquals(encoding, writer.getEncoding());
assertTrue(Arrays.equals(xml.getBytes(encoding), xmlContent));
}
- private static void checkXmlWriter(String text, String encoding)
+ private static void checkXmlWriter(final String text, final String encoding)
throws IOException {
checkXmlWriter(text, encoding, null);
}
- private static void checkXmlWriter(String text, String encoding, String \
defaultEncoding) + private static void checkXmlWriter(final String text, final \
String encoding, final String defaultEncoding) throws IOException {
- String xml = createXmlContent(text, encoding);
+ final String xml = createXmlContent(text, encoding);
String effectiveEncoding = encoding;
if (effectiveEncoding == null) {
effectiveEncoding = defaultEncoding == null ? "UTF-8" : defaultEncoding;
@@ -75,13 +75,13 @@ public class XmlStreamWriterTest extends
}
public void testNoXmlHeader() throws IOException {
- String xml = "<text>text with no XML header</text>";
+ final String xml = "<text>text with no XML header</text>";
checkXmlContent(xml, "UTF-8", null);
}
public void testEmpty() throws IOException {
- ByteArrayOutputStream out = new ByteArrayOutputStream();
- XmlStreamWriter writer = new XmlStreamWriter(out);
+ final ByteArrayOutputStream out = new ByteArrayOutputStream();
+ final XmlStreamWriter writer = new XmlStreamWriter(out);
writer.flush();
writer.write("");
writer.flush();
Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/testtools/FileBasedTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/com \
mons/io/testtools/FileBasedTestCase.java?rev=1415850&r1=1415849&r2=1415850&view=diff \
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/testtools/FileBasedTestCase.java \
(original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/testtools/FileBasedTestCase.java \
Fri Nov 30 20:51:39 2012 @@ -42,7 +42,7 @@ public abstract class FileBasedTestCase
private static volatile File testDir;
- public FileBasedTestCase(String name) {
+ public FileBasedTestCase(final String name) {
super(name);
}
@@ -54,13 +54,13 @@ public abstract class FileBasedTestCase
return testDir;
}
- protected void createFile(File file, long size)
+ protected void createFile(final File file, final long size)
throws IOException {
if (!file.getParentFile().exists()) {
throw new IOException("Cannot create file " + file
+ " as the parent directory does not exist");
}
- BufferedOutputStream output =
+ final BufferedOutputStream output =
new BufferedOutputStream(new java.io.FileOutputStream(file));
try {
generateTestData(output, size);
@@ -69,17 +69,17 @@ public abstract class FileBasedTestCase
}
}
- protected byte[] generateTestData(long size) {
+ protected byte[] generateTestData(final long size) {
try {
- ByteArrayOutputStream baout = new ByteArrayOutputStream();
+ final ByteArrayOutputStream baout = new ByteArrayOutputStream();
generateTestData(baout, size);
return baout.toByteArray();
- } catch (IOException ioe) {
+ } catch (final IOException ioe) {
throw new RuntimeException("This should never happen: " + \
ioe.getMessage()); }
}
- protected void generateTestData(OutputStream out, long size)
+ protected void generateTestData(final OutputStream out, final long size)
throws IOException {
for (int i = 0; i < size; i++) {
//output.write((byte)'X');
@@ -89,13 +89,13 @@ public abstract class FileBasedTestCase
}
}
- protected void createLineBasedFile(File file, String[] data) throws IOException \
{ + protected void createLineBasedFile(final File file, final String[] data) \
throws IOException {
if (file.getParentFile() != null && !file.getParentFile().exists()) {
throw new IOException("Cannot create file " + file + " as the parent \
directory does not exist"); }
- PrintWriter output = new PrintWriter(new OutputStreamWriter(new \
FileOutputStream(file), "UTF-8")); + final PrintWriter output = new \
PrintWriter(new OutputStreamWriter(new FileOutputStream(file), "UTF-8")); try {
- for (String element : data) {
+ for (final String element : data) {
output.println(element);
}
} finally {
@@ -103,8 +103,8 @@ public abstract class FileBasedTestCase
}
}
- protected File newFile(String filename) throws IOException {
- File destination = new File( getTestDirectory(), filename );
+ protected File newFile(final String filename) throws IOException {
+ final File destination = new File( getTestDirectory(), filename );
/*
assertTrue( filename + "Test output data file shouldn't previously exist",
!destination.exists() );
@@ -115,14 +115,14 @@ public abstract class FileBasedTestCase
return destination;
}
- protected void checkFile( File file, File referenceFile )
+ protected void checkFile( final File file, final File referenceFile )
throws Exception {
assertTrue( "Check existence of output file", file.exists() );
assertEqualContent( referenceFile, file );
}
/** Assert that the content of two files is the same. */
- private void assertEqualContent( File f0, File f1 )
+ private void assertEqualContent( final File f0, final File f1 )
throws IOException
{
/* This doesn't work because the filesize isn't updated until the file
@@ -131,12 +131,12 @@ public abstract class FileBasedTestCase
" have differing file sizes (" + f0.length() +
" vs " + f1.length() + ")", ( f0.length() == f1.length() ) );
*/
- InputStream is0 = new java.io.FileInputStream( f0 );
+ final InputStream is0 = new java.io.FileInputStream( f0 );
try {
- InputStream is1 = new java.io.FileInputStream( f1 );
+ final InputStream is1 = new java.io.FileInputStream( f1 );
try {
- byte[] buf0 = new byte[ 1024 ];
- byte[] buf1 = new byte[ 1024 ];
+ final byte[] buf0 = new byte[ 1024 ];
+ final byte[] buf1 = new byte[ 1024 ];
int n0 = 0;
int n1 = 0;
@@ -160,10 +160,10 @@ public abstract class FileBasedTestCase
}
/** Assert that the content of a file is equal to that in a byte[]. */
- protected void assertEqualContent(byte[] b0, File file) throws IOException {
- InputStream is = new java.io.FileInputStream(file);
+ protected void assertEqualContent(final byte[] b0, final File file) throws \
IOException { + final InputStream is = new java.io.FileInputStream(file);
int count = 0, numRead = 0;
- byte[] b1 = new byte[b0.length];
+ final byte[] b1 = new byte[b0.length];
try {
while (count < b0.length && numRead >= 0) {
numRead = is.read(b1, count, b0.length);
@@ -179,10 +179,10 @@ public abstract class FileBasedTestCase
}
/** Assert that the content of a file is equal to that in a char[]. */
- protected void assertEqualContent(char[] c0, File file) throws IOException {
- Reader ir = new java.io.FileReader(file);
+ protected void assertEqualContent(final char[] c0, final File file) throws \
IOException { + final Reader ir = new java.io.FileReader(file);
int count = 0, numRead = 0;
- char[] c1 = new char[c0.length];
+ final char[] c1 = new char[c0.length];
try {
while (count < c0.length && numRead >= 0) {
numRead = ir.read(c1, count, c0.length);
@@ -197,10 +197,10 @@ public abstract class FileBasedTestCase
}
}
- protected void checkWrite(OutputStream output) throws Exception {
+ protected void checkWrite(final OutputStream output) throws Exception {
try {
new java.io.PrintStream(output).write(0);
- } catch (Throwable t) {
+ } catch (final Throwable t) {
throw new AssertionFailedError(
"The copy() method closed the stream "
+ "when it shouldn't have. "
@@ -208,10 +208,10 @@ public abstract class FileBasedTestCase
}
}
- protected void checkWrite(Writer output) throws Exception {
+ protected void checkWrite(final Writer output) throws Exception {
try {
new java.io.PrintWriter(output).write('a');
- } catch (Throwable t) {
+ } catch (final Throwable t) {
throw new AssertionFailedError(
"The copy() method closed the stream "
+ "when it shouldn't have. "
@@ -219,7 +219,7 @@ public abstract class FileBasedTestCase
}
}
- protected void deleteFile( File file )
+ protected void deleteFile( final File file )
throws Exception {
if (file.exists()) {
assertTrue("Couldn't delete file: " + file, file.delete());
Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/testtools/YellOnCloseInputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/com \
mons/io/testtools/YellOnCloseInputStream.java?rev=1415850&r1=1415849&r2=1415850&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/testtools/YellOnCloseInputStream.java \
(original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/testtools/YellOnCloseInputStream.java \
Fri Nov 30 20:51:39 2012 @@ -31,7 +31,7 @@ public class YellOnCloseInputStream exte
/**
* @param proxy InputStream to delegate to.
*/
- public YellOnCloseInputStream(InputStream proxy) {
+ public YellOnCloseInputStream(final InputStream proxy) {
super(proxy);
}
Modified: commons/proper/io/trunk/src/test/java/org/apache/commons/io/testtools/YellOnFlushAndCloseOutputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/test/java/org/apache/com \
mons/io/testtools/YellOnFlushAndCloseOutputStream.java?rev=1415850&r1=1415849&r2=1415850&view=diff
==============================================================================
--- commons/proper/io/trunk/src/test/java/org/apache/commons/io/testtools/YellOnFlushAndCloseOutputStream.java \
(original)
+++ commons/proper/io/trunk/src/test/java/org/apache/commons/io/testtools/YellOnFlushAndCloseOutputStream.java \
Fri Nov 30 20:51:39 2012 @@ -36,7 +36,7 @@ public class YellOnFlushAndCloseOutputSt
* @param yellForFlush True if flush() is forbidden
* @param yellForClose True if close() is forbidden
*/
- public YellOnFlushAndCloseOutputStream(OutputStream proxy, boolean yellForFlush, \
boolean yellForClose) { + public YellOnFlushAndCloseOutputStream(final \
OutputStream proxy, final boolean yellForFlush, final boolean yellForClose) { \
super(proxy); this.yellForFlush = yellForFlush;
this.yellForClose = yellForClose;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic