Javadoc.
Sort members.
MODIFY
src/test/java/org/apache/commons/io/input/ProxyReaderTest.java
src/test/java/org/apache/commons/io/input/ProxyReaderTest.java
import org.junit.jupiter.api.Test;
/**
- * Test {@link ProxyReader}.
+ * Tests {@link ProxyReader}.
*/
public class ProxyReaderTest {
- @Test
- public void testNullCharArray() throws Exception {
- try (final ProxyReader proxy = new ProxyReaderImpl(new CustomNullReader(0))) {
- proxy.read((char[]) null);
- proxy.read(null, 0, 0);
+ /** Custom NullReader implementation. */
+ private static class CustomNullReader extends NullReader {
+ CustomNullReader(final int len) {
+ super(len);
}
+
+ @Override
+ public int read(final char[] chars) throws IOException {
+ return chars == null ? 0 : super.read(chars);
}
- @Test
- public void testNullCharBuffer() throws Exception {
- try (final ProxyReader proxy = new ProxyReaderImpl(new CustomNullReader(0))) {
- proxy.read((CharBuffer) null);
+ @Override
+ public int read(final CharBuffer target) throws IOException {
+ return target == null ? 0 : super.read(target);
}
}
- /** ProxyReader implementation */
+ /** ProxyReader implementation. */
private static class ProxyReaderImpl extends ProxyReader {
ProxyReaderImpl(final Reader proxy) {
super(proxy);
}
}
- /** Custom NullReader implementation */
- private static class CustomNullReader extends NullReader {
- CustomNullReader(final int len) {
- super(len);
+ @Test
+ public void testNullCharArray() throws Exception {
+ try (final ProxyReader proxy = new ProxyReaderImpl(new CustomNullReader(0))) {
+ proxy.read((char[]) null);
+ proxy.read(null, 0, 0);
}
-
- @Override
- public int read(final char[] chars) throws IOException {
- return chars == null ? 0 : super.read(chars);
}
- @Override
- public int read(final CharBuffer target) throws IOException {
- return target == null ? 0 : super.read(target);
+ @Test
+ public void testNullCharBuffer() throws Exception {
+ try (final ProxyReader proxy = new ProxyReaderImpl(new CustomNullReader(0))) {
+ proxy.read((CharBuffer) null);
}
}
}

Javadoc.

Sort members.