Skip to content

Commit a14aa92

Browse files
author
Gary Gregory
committed
Comment empty block. Formatting.
1 parent 290ced5 commit a14aa92

8 files changed

Lines changed: 40 additions & 22 deletions

File tree

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

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,10 @@
2222
import java.io.InputStream;
2323

2424
/**
25-
* Data written to this stream is forwarded to a stream that has been associated
26-
* with this thread.
25+
* Data written to this stream is forwarded to a stream that has been associated with this thread.
2726
*
2827
*/
29-
public class DemuxInputStream
30-
extends InputStream
31-
{
28+
public class DemuxInputStream extends InputStream {
3229
private final InheritableThreadLocal<InputStream> m_streams = new InheritableThreadLocal<>();
3330

3431
/**
@@ -37,10 +34,9 @@ public class DemuxInputStream
3734
* @param input the stream to bind
3835
* @return the InputStream that was previously active
3936
*/
40-
public InputStream bindStream( final InputStream input )
41-
{
37+
public InputStream bindStream(final InputStream input) {
4238
final InputStream oldValue = m_streams.get();
43-
m_streams.set( input );
39+
m_streams.set(input);
4440
return oldValue;
4541
}
4642

@@ -50,12 +46,9 @@ public InputStream bindStream( final InputStream input )
5046
* @throws IOException if an error occurs
5147
*/
5248
@Override
53-
public void close()
54-
throws IOException
55-
{
49+
public void close() throws IOException {
5650
final InputStream input = m_streams.get();
57-
if( null != input )
58-
{
51+
if (null != input) {
5952
input.close();
6053
}
6154
}
@@ -67,12 +60,9 @@ public void close()
6760
* @throws IOException if an error occurs
6861
*/
6962
@Override
70-
public int read()
71-
throws IOException
72-
{
63+
public int read() throws IOException {
7364
final InputStream input = m_streams.get();
74-
if( null != input )
75-
{
65+
if (null != input) {
7666
return input.read();
7767
}
7868
return EOF;

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ public static abstract class Observer {
4444
* because, in that case, {@link #finished()} will be invoked instead.
4545
* @throws IOException if an i/o-error occurs
4646
*/
47-
public void data(final int pByte) throws IOException {}
47+
public void data(final int pByte) throws IOException {
48+
// noop
49+
}
4850

4951
/** Called to indicate, that {@link InputStream#read(byte[])}, or
5052
* {@link InputStream#read(byte[], int, int)} have been called, and are about to
@@ -55,20 +57,26 @@ public void data(final int pByte) throws IOException {}
5557
* @param pLength The number of bytes, which have been stored in the byte array.
5658
* @throws IOException if an i/o-error occurs
5759
*/
58-
public void data(final byte[] pBuffer, final int pOffset, final int pLength) throws IOException {}
60+
public void data(final byte[] pBuffer, final int pOffset, final int pLength) throws IOException {
61+
// noop
62+
}
5963

6064
/** Called to indicate, that EOF has been seen on the underlying stream.
6165
* This method may be called multiple times, if the reader keeps invoking
6266
* either of the read methods, and they will consequently keep returning
6367
* EOF.
6468
* @throws IOException if an i/o-error occurs
6569
*/
66-
public void finished() throws IOException {}
70+
public void finished() throws IOException {
71+
// noop
72+
}
6773

6874
/** Called to indicate, that the {@link ObservableInputStream} has been closed.
6975
* @throws IOException if an i/o-error occurs
7076
*/
71-
public void closed() throws IOException {}
77+
public void closed() throws IOException {
78+
// noop
79+
}
7280

7381
/**
7482
* Called to indicate, that an error occurred on the underlying stream.

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ public boolean markSupported() {
222222
* @throws IOException if the pre-processing fails
223223
*/
224224
protected void beforeRead(final int n) throws IOException {
225+
// noop
225226
}
226227

227228
/**
@@ -242,6 +243,7 @@ protected void beforeRead(final int n) throws IOException {
242243
* @throws IOException if the post-processing fails
243244
*/
244245
protected void afterRead(final int n) throws IOException {
246+
// noop
245247
}
246248

247249
/**

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,15 @@ public class TailerListenerAdapter implements TailerListener {
3030
*/
3131
@Override
3232
public void init(final Tailer tailer) {
33+
// noop
3334
}
3435

3536
/**
3637
* This method is called if the tailed file is not found.
3738
*/
3839
@Override
3940
public void fileNotFound() {
41+
// noop
4042
}
4143

4244
/**
@@ -47,6 +49,7 @@ public void fileNotFound() {
4749
*/
4850
@Override
4951
public void fileRotated() {
52+
// noop
5053
}
5154

5255
/**
@@ -55,6 +58,7 @@ public void fileRotated() {
5558
*/
5659
@Override
5760
public void handle(final String line) {
61+
// noop
5862
}
5963

6064
/**
@@ -63,6 +67,7 @@ public void handle(final String line) {
6367
*/
6468
@Override
6569
public void handle(final Exception ex) {
70+
// noop
6671
}
6772

6873
/**
@@ -76,5 +81,6 @@ public void handle(final Exception ex) {
7681
* @since 2.5
7782
*/
7883
public void endOfFileReached() {
84+
// noop
7985
}
8086
}

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public class FileAlterationListenerAdaptor implements FileAlterationListener {
3434
*/
3535
@Override
3636
public void onStart(final FileAlterationObserver observer) {
37+
// noop
3738
}
3839

3940
/**
@@ -43,6 +44,7 @@ public void onStart(final FileAlterationObserver observer) {
4344
*/
4445
@Override
4546
public void onDirectoryCreate(final File directory) {
47+
// noop
4648
}
4749

4850
/**
@@ -52,6 +54,7 @@ public void onDirectoryCreate(final File directory) {
5254
*/
5355
@Override
5456
public void onDirectoryChange(final File directory) {
57+
// noop
5558
}
5659

5760
/**
@@ -61,6 +64,7 @@ public void onDirectoryChange(final File directory) {
6164
*/
6265
@Override
6366
public void onDirectoryDelete(final File directory) {
67+
// noop
6468
}
6569

6670
/**
@@ -70,6 +74,7 @@ public void onDirectoryDelete(final File directory) {
7074
*/
7175
@Override
7276
public void onFileCreate(final File file) {
77+
// noop
7378
}
7479

7580
/**
@@ -79,6 +84,7 @@ public void onFileCreate(final File file) {
7984
*/
8085
@Override
8186
public void onFileChange(final File file) {
87+
// noop
8288
}
8389

8490
/**
@@ -88,6 +94,7 @@ public void onFileChange(final File file) {
8894
*/
8995
@Override
9096
public void onFileDelete(final File file) {
97+
// noop
9198
}
9299

93100
/**
@@ -97,6 +104,7 @@ public void onFileDelete(final File file) {
97104
*/
98105
@Override
99106
public void onStop(final FileAlterationObserver observer) {
107+
// noop
100108
}
101109

102110
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ public void run() {
188188
try {
189189
Thread.sleep(interval);
190190
} catch (final InterruptedException ignored) {
191+
// ignore
191192
}
192193
}
193194
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ public void initialize() throws Exception {
285285
* @throws Exception if an error occurs
286286
*/
287287
public void destroy() throws Exception {
288+
// noop
288289
}
289290

290291
/**

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ public void close() throws IOException {
133133
* @throws IOException if the pre-processing fails
134134
*/
135135
protected void beforeWrite(final int n) throws IOException {
136+
// noop
136137
}
137138

138139
/**
@@ -150,6 +151,7 @@ protected void beforeWrite(final int n) throws IOException {
150151
* @throws IOException if the post-processing fails
151152
*/
152153
protected void afterWrite(final int n) throws IOException {
154+
// noop
153155
}
154156

155157
/**

0 commit comments

Comments
 (0)