Add classes Added TaggedReader, ClosedReader and BrokenReader.
Javadoc: Close HTML tags.
Format: Line width 120.
MODIFY
src/main/java/org/apache/commons/io/input/BrokenReader.java
src/main/java/org/apache/commons/io/input/BrokenReader.java
* <p>
* This class is mostly useful for testing error handling in code that uses a
* reader.
+ * </p>
*
* @since 2.7
*/

MODIFY
src/main/java/org/apache/commons/io/input/ClosedReader.java
src/main/java/org/apache/commons/io/input/ClosedReader.java
import java.io.Reader;
/**
- * Closed reader. This reader returns EOF to all attempts to read
- * something from it.
+ * Closed reader. This reader returns EOF to all attempts to read something from it.
* <p>
- * Typically uses of this class include testing for corner cases in methods
- * that accept readers and acting as a sentinel value instead of a
- * {@code null} reader.
+ * Typically uses of this class include testing for corner cases in methods that accept readers and acting as a sentinel
+ * value instead of a {@code null} reader.
* </p>
*
* @since 2.7

MODIFY
src/main/java/org/apache/commons/io/input/TaggedReader.java
src/main/java/org/apache/commons/io/input/TaggedReader.java
import org.apache.commons.io.TaggedIOException;
/**
- * A reader decorator that tags potential exceptions so that the
- * reader that caused the exception can easily be identified. This is
- * done by using the {@link TaggedIOException} class to wrap all thrown
- * {@link IOException}s. See below for an example of using this class.
+ * A reader decorator that tags potential exceptions so that the reader that caused the exception can easily be
+ * identified. This is done by using the {@link TaggedIOException} class to wrap all thrown {@link IOException}s. See
+ * below for an example of using this class.
+ *
* <pre>
* TaggedReader reader = new TaggedReader(...);
* try {
* }
* </pre>
* <p>
- * Alternatively, the {@link #throwIfCauseOf(Throwable)} method can be
- * used to let higher levels of code handle the exception caused by this
- * reader while other processing errors are being taken care of at this
- * lower level.
+ * Alternatively, the {@link #throwIfCauseOf(Throwable)} method can be used to let higher levels of code handle the
+ * exception caused by this reader while other processing errors are being taken care of at this lower level.
+ * </p>
+ *
* <pre>
* TaggedReader reader = new TaggedReader(...);
* try {
@@ -81,19 +81,16 @@ public TaggedReader(final Reader proxy) {
* Tests if the given exception was caused by this reader.
*
* @param exception an exception
- * @return {@code true} if the exception was thrown by this reader,
- * {@code false} otherwise
+ * @return {@code true} if the exception was thrown by this reader, {@code false} otherwise
*/
public boolean isCauseOf(final Throwable exception) {
return TaggedIOException.isTaggedWith(exception, tag);
}
/**
- * Re-throws the original exception thrown by this reader. This method
- * first checks whether the given exception is a {@link TaggedIOException}
- * wrapper created by this decorator, and then unwraps and throws the
- * original wrapped exception. Returns normally if the exception was
- * not thrown by this reader.
+ * Re-throws the original exception thrown by this reader. This method first checks whether the given exception is a
+ * {@link TaggedIOException} wrapper created by this decorator, and then unwraps and throws the original wrapped
+ * exception. Returns normally if the exception was not thrown by this reader.
*
* @param throwable an exception
* @throws IOException original exception, if any, thrown by this reader

MODIFY
src/test/java/org/apache/commons/io/input/TaggedReaderTest.java
src/test/java/org/apache/commons/io/input/TaggedReaderTest.java
@@ -61,8 +61,7 @@ public void testNormalReader() throws IOException {
@Test
public void testBrokenReader() {
final IOException exception = new IOException("test exception");
- final TaggedReader reader =
- new TaggedReader(new BrokenReader(exception));
+ final TaggedReader reader = new TaggedReader(new BrokenReader(exception));
// Test the ready() method
try {
@@ -114,13 +113,11 @@ public void testOtherException() throws Exception {
final TaggedReader reader = new TaggedReader(closed);
assertFalse(reader.isCauseOf(exception));
- assertFalse(reader.isCauseOf(
- new TaggedIOException(exception, UUID.randomUUID())));
+ assertFalse(reader.isCauseOf(new TaggedIOException(exception, UUID.randomUUID())));
reader.throwIfCauseOf(exception);
- reader.throwIfCauseOf(
- new TaggedIOException(exception, UUID.randomUUID()));
+ reader.throwIfCauseOf(new TaggedIOException(exception, UUID.randomUUID()));
reader.close();
}

[IO-617] Add classes Added TaggedReader, ClosedReader and BrokenReader.
#85.

- Javadoc: Close HTML tags.
- Format: Line width 120.