Use final. Remove trailing whitepace.
MODIFY
src/main/java/org/apache/commons/io/input/BufferedFileChannelInputStream.java
src/main/java/org/apache/commons/io/input/BufferedFileChannelInputStream.java
@@ -58,7 +58,7 @@ private static Class getDirectBufferClass() {
return res;
}
- private static boolean isDirectBuffer(Object object) {
+ private static boolean isDirectBuffer(final Object object) {
return DIRECT_BUFFER_CLASS != null && DIRECT_BUFFER_CLASS.isInstance(object);
}

MODIFY
src/main/java/org/apache/commons/io/input/ObservableInputStream.java
src/main/java/org/apache/commons/io/input/ObservableInputStream.java
@@ -241,7 +241,7 @@ protected void noteFinished() throws IOException {
}
}
- private void notify(final byte[] buffer, final int offset, int result, IOException ioe) throws IOException {
+ private void notify(final byte[] buffer, final int offset, final int result, final IOException ioe) throws IOException {
if (ioe != null) {
noteError(ioe);
throw ioe;

MODIFY
src/main/java/org/apache/commons/io/output/FilterCollectionWriter.java
src/main/java/org/apache/commons/io/output/FilterCollectionWriter.java
@@ -81,7 +81,7 @@ protected FilterCollectionWriter(final Writer... writers) {
* @param e The cause.
* @return the given list or a new list on null input.
*/
- private List<Exception> add(List<Exception> causeList, int i, final IOException e) {
+ private List<Exception> add(List<Exception> causeList, final int i, final IOException e) {
if (causeList == null) {
causeList = new ArrayList<>();
}
@@ -201,7 +201,7 @@ public void flush() throws IOException {
* @param causeList the list to test.
* @return true if empty or null.
*/
- private boolean notEmpty(List<Exception> causeList) {
+ private boolean notEmpty(final List<Exception> causeList) {
return causeList != null && !causeList.isEmpty();
}

MODIFY
src/test/java/org/apache/commons/io/IOUtilsCopyTestCase.java
src/test/java/org/apache/commons/io/IOUtilsCopyTestCase.java
@@ -440,10 +440,10 @@ public void testCopy_readerToWriter_nullOut() {
@Test
public void testCopy_URLToFile() throws Exception {
final String name = "/org/apache/commons/io/abitmorethan16k.txt";
- URL in = getClass().getResource(name);
+ final URL in = getClass().getResource(name);
assertNotNull(in, name);
- Path path = Files.createTempFile("testCopy_URLToFile", ".txt");
+ final Path path = Files.createTempFile("testCopy_URLToFile", ".txt");
try {
IOUtils.copy(in, path.toFile());
@@ -456,7 +456,7 @@ public void testCopy_URLToFile() throws Exception {
@Test
public void testCopy_URLToOutputStream() throws Exception {
final String name = "/org/apache/commons/io/abitmorethan16k.txt";
- URL in = getClass().getResource(name);
+ final URL in = getClass().getResource(name);
assertNotNull(in, name);
final ByteArrayOutputStream baout = new ByteArrayOutputStream();

MODIFY
src/test/java/org/apache/commons/io/input/ObservableInputStreamTest.java
src/test/java/org/apache/commons/io/input/ObservableInputStreamTest.java
@@ -63,7 +63,7 @@ public void data(final byte[] buffer, final int offset, final int length) throws
}
@Override
- public void data(int value) throws IOException {
+ public void data(final int value) throws IOException {
total++;
}
@@ -90,12 +90,12 @@ public void data(final byte[] buffer, final int offset, final int length) throws
}
@Override
- public void data(int value) throws IOException {
+ public void data(final int value) throws IOException {
dataCount++;
}
@Override
- public void error(IOException exception) throws IOException {
+ public void error(final IOException exception) throws IOException {
errorCount++;
}

Use final. Remove trailing whitepace.