Skip to content

Commit cdcf55b

Browse files
committed
Add Checkstyle RedundantModifier
1 parent a870d4f commit cdcf55b

49 files changed

Lines changed: 177 additions & 176 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/conf/checkstyle.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ limitations under the License.
6161
<module name="NeedBraces" />
6262
<module name="ParenPad" />
6363
<module name="RedundantImport" />
64+
<module name="RedundantModifier" />
6465
<!-- No Trailing whitespace -->
6566
<module name="Regexp">
6667
<property name="format" value="[ \t]+$" />

src/main/java/org/apache/commons/io/comparator/ReverseFileComparator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ final class ReverseFileComparator extends AbstractFileComparator implements Seri
4040
*
4141
* @param delegate The comparator to delegate to.
4242
*/
43-
public ReverseFileComparator(final Comparator<File> delegate) {
43+
ReverseFileComparator(final Comparator<File> delegate) {
4444
this.delegate = Objects.requireNonNull(delegate, "delegate");
4545
}
4646

src/main/java/org/apache/commons/io/function/IOFunction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ default <V> IOFunction<T, V> andThen(final IOFunction<? super R, ? extends V> af
114114
* @return the function result
115115
* @throws IOException if an I/O error occurs.
116116
*/
117-
R apply(final T t) throws IOException;
117+
R apply(T t) throws IOException;
118118

119119
/**
120120
* Creates a {@link Function} for this instance that throws {@link UncheckedIOException} instead of {@link IOException}.

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ public interface RandomAccessResourceBridge extends Closeable {
370370
* @throws IOException If the first byte cannot be read for any reason other than end of tailable, or if the random
371371
* access tailable has been closed, or if some other I/O error occurs.
372372
*/
373-
int read(final byte[] b) throws IOException;
373+
int read(byte[] b) throws IOException;
374374

375375
/**
376376
* Sets the file-pointer offset, measured from the beginning of this tailable, at which the next read or write occurs.
@@ -382,7 +382,7 @@ public interface RandomAccessResourceBridge extends Closeable {
382382
* pointer.
383383
* @throws IOException if {@code pos} is less than {@code 0} or if an I/O error occurs.
384384
*/
385-
void seek(final long pos) throws IOException;
385+
void seek(long pos) throws IOException;
386386
}
387387

388388
/**
@@ -399,7 +399,7 @@ public interface Tailable {
399399
* @return a random access file stream to read.
400400
* @throws FileNotFoundException if the tailable object does not exist.
401401
*/
402-
RandomAccessResourceBridge getRandomAccess(final String mode) throws FileNotFoundException;
402+
RandomAccessResourceBridge getRandomAccess(String mode) throws FileNotFoundException;
403403

404404
/**
405405
* Tests if this tailable is newer than the specified {@link FileTime}.
@@ -408,7 +408,7 @@ public interface Tailable {
408408
* @return true if the {@link File} exists and has been modified after the given {@link FileTime}.
409409
* @throws IOException if an I/O error occurs.
410410
*/
411-
boolean isNewer(final FileTime fileTime) throws IOException;
411+
boolean isNewer(FileTime fileTime) throws IOException;
412412

413413
/**
414414
* Gets the last modification {@link FileTime}.

src/main/java/org/apache/commons/io/monitor/FileAlterationListener.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,54 +33,54 @@ public interface FileAlterationListener {
3333
*
3434
* @param directory The directory changed
3535
*/
36-
void onDirectoryChange(final File directory);
36+
void onDirectoryChange(File directory);
3737

3838
/**
3939
* Directory created Event.
4040
*
4141
* @param directory The directory created
4242
*/
43-
void onDirectoryCreate(final File directory);
43+
void onDirectoryCreate(File directory);
4444

4545
/**
4646
* Directory deleted Event.
4747
*
4848
* @param directory The directory deleted
4949
*/
50-
void onDirectoryDelete(final File directory);
50+
void onDirectoryDelete(File directory);
5151

5252
/**
5353
* File changed Event.
5454
*
5555
* @param file The file changed
5656
*/
57-
void onFileChange(final File file);
57+
void onFileChange(File file);
5858

5959
/**
6060
* File created Event.
6161
*
6262
* @param file The file created
6363
*/
64-
void onFileCreate(final File file);
64+
void onFileCreate(File file);
6565

6666
/**
6767
* File deleted Event.
6868
*
6969
* @param file The file deleted
7070
*/
71-
void onFileDelete(final File file);
71+
void onFileDelete(File file);
7272

7373
/**
7474
* File system observer started checking event.
7575
*
7676
* @param observer The file system observer
7777
*/
78-
void onStart(final FileAlterationObserver observer);
78+
void onStart(FileAlterationObserver observer);
7979

8080
/**
8181
* File system observer finished checking event.
8282
*
8383
* @param observer The file system observer
8484
*/
85-
void onStop(final FileAlterationObserver observer);
85+
void onStop(FileAlterationObserver observer);
8686
}

src/main/java/org/apache/commons/io/monitor/SerializableFileTime.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ final class SerializableFileTime implements Serializable {
4343

4444
private FileTime fileTime;
4545

46-
public SerializableFileTime(final FileTime fileTime) {
46+
SerializableFileTime(final FileTime fileTime) {
4747
this.fileTime = Objects.requireNonNull(fileTime);
4848
}
4949

src/main/java/org/apache/commons/io/output/AbstractByteArrayOutputStream.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ protected interface InputStreamConstructor<T extends InputStream> {
7777
* @param length the length of the buffer
7878
* @return the InputStream subclass.
7979
*/
80-
T construct(final byte[] buffer, final int offset, final int length);
80+
T construct(byte[] buffer, int offset, int length);
8181
}
8282

8383
static final int DEFAULT_SIZE = 1024;
@@ -330,7 +330,7 @@ public void write(final byte b[]) {
330330
}
331331

332332
@Override
333-
public abstract void write(final byte[] b, final int off, final int len);
333+
public abstract void write(byte[] b, int off, int len);
334334

335335
/**
336336
* Writes the bytes for given CharSequence encoded using a Charset.
@@ -356,10 +356,10 @@ public T write(final CharSequence data, final Charset charset) {
356356
* @throws IOException if an I/O error occurs while reading the input stream
357357
* @since 1.4
358358
*/
359-
public abstract int write(final InputStream in) throws IOException;
359+
public abstract int write(InputStream in) throws IOException;
360360

361361
@Override
362-
public abstract void write(final int b);
362+
public abstract void write(int b);
363363

364364
/**
365365
* Writes the bytes to the byte array.
@@ -433,7 +433,7 @@ protected void writeImpl(final int b) {
433433
* @throws IOException if an I/O error occurs, such as if the stream is closed
434434
* @see java.io.ByteArrayOutputStream#writeTo(OutputStream)
435435
*/
436-
public abstract void writeTo(final OutputStream out) throws IOException;
436+
public abstract void writeTo(OutputStream out) throws IOException;
437437

438438
/**
439439
* Writes the entire contents of this byte stream to the

src/main/java/org/apache/commons/io/serialization/FullClassNameMatcher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ final class FullClassNameMatcher implements ClassNameMatcher {
3838
*
3939
* @param classes a list of class names
4040
*/
41-
public FullClassNameMatcher(final String... classes) {
41+
FullClassNameMatcher(final String... classes) {
4242
classesSet = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(classes)));
4343
}
4444

src/main/java/org/apache/commons/io/serialization/RegexpClassNameMatcher.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ final class RegexpClassNameMatcher implements ClassNameMatcher {
3737
* @param pattern a pattern for evaluating acceptable class names
3838
* @throws NullPointerException if {@code pattern} is null
3939
*/
40-
public RegexpClassNameMatcher(final Pattern pattern) {
40+
RegexpClassNameMatcher(final Pattern pattern) {
4141
this.pattern = Objects.requireNonNull(pattern, "pattern");
4242
}
4343

@@ -46,7 +46,7 @@ public RegexpClassNameMatcher(final Pattern pattern) {
4646
*
4747
* @param regex a regular expression for evaluating acceptable class names
4848
*/
49-
public RegexpClassNameMatcher(final String regex) {
49+
RegexpClassNameMatcher(final String regex) {
5050
this(Pattern.compile(regex));
5151
}
5252

src/main/java/org/apache/commons/io/serialization/WildcardClassNameMatcher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ final class WildcardClassNameMatcher implements ClassNameMatcher {
3636
*
3737
* @param pattern a {@link FilenameUtils#wildcardMatch} pattern.
3838
*/
39-
public WildcardClassNameMatcher(final String pattern) {
39+
WildcardClassNameMatcher(final String pattern) {
4040
this.pattern = pattern;
4141
}
4242

0 commit comments

Comments
 (0)