Skip to content

Commit cd5a7d7

Browse files
author
Gary Gregory
committed
Use final.
1 parent 393a804 commit cd5a7d7

7 files changed

Lines changed: 10 additions & 10 deletions

File tree

src/main/java/org/apache/commons/io/FileUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2132,7 +2132,7 @@ public static Collection<File> listFiles(
21322132
try {
21332133
final AccumulatorPathVisitor visitor = listAccumulate(directory, fileFilter, dirFilter);
21342134
return visitor.getFileList().stream().map(Path::toFile).collect(Collectors.toList());
2135-
} catch (IOException e) {
2135+
} catch (final IOException e) {
21362136
throw new IllegalArgumentException(e);
21372137
}
21382138
}
@@ -2180,7 +2180,7 @@ public static Collection<File> listFilesAndDirs(
21802180
final List<Path> list = visitor.getFileList();
21812181
list.addAll(visitor.getDirList());
21822182
return list.stream().map(Path::toFile).collect(Collectors.toList());
2183-
} catch (IOException e) {
2183+
} catch (final IOException e) {
21842184
throw new IllegalStateException(e);
21852185
}
21862186
}

src/main/java/org/apache/commons/io/file/PathUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ public static PathCounters countDirectory(final Path directory) throws IOExcepti
293293
* @throws IOException if an I/O error occurs
294294
* @since 2.9.0
295295
*/
296-
public static Path createParentDirectories(final Path path, FileAttribute<?>... attrs) throws IOException {
296+
public static Path createParentDirectories(final Path path, final FileAttribute<?>... attrs) throws IOException {
297297
final Path parent = path.getParent();
298298
if (parent == null) {
299299
return null;

src/main/java/org/apache/commons/io/filefilter/AndFileFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ private AndFileFilter(final ArrayList<IOFileFilter> initialList) {
6868
*
6969
* @param initialCapacity the initial capacity.
7070
*/
71-
private AndFileFilter(int initialCapacity) {
71+
private AndFileFilter(final int initialCapacity) {
7272
this(new ArrayList<>(initialCapacity));
7373
}
7474

src/main/java/org/apache/commons/io/filefilter/FalseFileFilter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,13 @@ public String toString() {
100100
}
101101

102102
@Override
103-
public IOFileFilter and(IOFileFilter fileFilter) {
103+
public IOFileFilter and(final IOFileFilter fileFilter) {
104104
// FALSE AND expression <=> FALSE
105105
return INSTANCE;
106106
}
107107

108108
@Override
109-
public IOFileFilter or(IOFileFilter fileFilter) {
109+
public IOFileFilter or(final IOFileFilter fileFilter) {
110110
// FALSE OR expression <=> expression
111111
return fileFilter;
112112
}

src/main/java/org/apache/commons/io/filefilter/PathVisitorFileFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public boolean accept(final File dir, final String name) {
7171
public FileVisitResult accept(final Path path, final BasicFileAttributes attributes) {
7272
try {
7373
return Files.isDirectory(path) ? pathVisitor.postVisitDirectory(path, null) : visitFile(path, attributes);
74-
} catch (IOException e) {
74+
} catch (final IOException e) {
7575
return handle(e);
7676
}
7777
}

src/main/java/org/apache/commons/io/input/BufferedFileChannelInputStream.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ private void clean(final DirectBuffer buffer) {
154154
final Method cleanMethod = clsCleaner.getMethod("clean");
155155
cleanMethod.invoke(cleaner);
156156
}
157-
} catch (ReflectiveOperationException e) {
157+
} catch (final ReflectiveOperationException e) {
158158
throw new IllegalStateException(e);
159159
}
160160
} else {
@@ -165,7 +165,7 @@ private void clean(final DirectBuffer buffer) {
165165
final Field unsafeField = clsUnsafe.getDeclaredField("theUnsafe");
166166
unsafeField.setAccessible(true);
167167
cleanerMethod.invoke(unsafeField.get(null), buffer);
168-
} catch (ReflectiveOperationException e) {
168+
} catch (final ReflectiveOperationException e) {
169169
throw new IllegalStateException(e);
170170
}
171171
}

src/test/java/org/apache/commons/io/input/CharSequenceInputStreamTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ private void testAvailableRead(final String csName) throws Exception {
376376
int available = checkAvail(r, input.length());
377377
assertEquals(available - 1, r.skip(available - 1)); // skip all but one
378378
available = checkAvail(r, 1);
379-
byte[] buff = new byte[available];
379+
final byte[] buff = new byte[available];
380380
assertEquals(available, r.read(buff, 0, available));
381381
}
382382
}

0 commit comments

Comments
 (0)