This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-io.git
The following commit(s) were added to refs/heads/master by this push: new 53c170c Don't hard code values in Javadoc, use {@value reference}. 53c170c is described below commit 53c170c4923d2fffc3f536189ab6b3f43149f8d3 Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Sun May 24 13:20:19 2020 -0400 Don't hard code values in Javadoc, use {@value reference}. --- .../apache/commons/io/input/ReaderInputStream.java | 6 ++-- .../io/output/AbstractByteArrayOutputStream.java | 2 +- .../commons/io/output/ByteArrayOutputStream.java | 2 +- .../io/output/DeferredFileOutputStream.java | 8 ++--- .../UnsynchronizedByteArrayOutputStream.java | 4 +-- .../commons/io/output/WriterOutputStream.java | 34 +++++++++++----------- 6 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/main/java/org/apache/commons/io/input/ReaderInputStream.java b/src/main/java/org/apache/commons/io/input/ReaderInputStream.java index 13440ef..64a3aed 100644 --- a/src/main/java/org/apache/commons/io/input/ReaderInputStream.java +++ b/src/main/java/org/apache/commons/io/input/ReaderInputStream.java @@ -144,7 +144,7 @@ public class ReaderInputStream extends InputStream { /** * Construct a new {@link ReaderInputStream} with a default input buffer size of - * 1024 characters. + * {@value #DEFAULT_BUFFER_SIZE} characters. * * @param reader the target {@link Reader} * @param charset the charset encoding @@ -166,7 +166,7 @@ public class ReaderInputStream extends InputStream { /** * Construct a new {@link ReaderInputStream} with a default input buffer size of - * 1024 characters. + * {@value #DEFAULT_BUFFER_SIZE} characters. * * @param reader the target {@link Reader} * @param charsetName the name of the charset encoding @@ -177,7 +177,7 @@ public class ReaderInputStream extends InputStream { /** * Construct a new {@link ReaderInputStream} that uses the default character encoding - * with a default input buffer size of 1024 characters. + * with a default input buffer size of {@value #DEFAULT_BUFFER_SIZE} characters. * * @param reader the target {@link Reader} * @deprecated 2.5 use {@link #ReaderInputStream(Reader, Charset)} instead diff --git a/src/main/java/org/apache/commons/io/output/AbstractByteArrayOutputStream.java b/src/main/java/org/apache/commons/io/output/AbstractByteArrayOutputStream.java index d350149..3f88c85 100644 --- a/src/main/java/org/apache/commons/io/output/AbstractByteArrayOutputStream.java +++ b/src/main/java/org/apache/commons/io/output/AbstractByteArrayOutputStream.java @@ -45,7 +45,7 @@ import static org.apache.commons.io.IOUtils.EOF; * This is the base for an alternative implementation of the * {@link java.io.ByteArrayOutputStream} class. The original implementation * only allocates 32 bytes at the beginning. As this class is designed for - * heavy duty it starts at 1024 bytes. In contrast to the original it doesn't + * heavy duty it starts at {@value #DEFAULT_SIZE} bytes. In contrast to the original it doesn't * reallocate the whole memory block but allocates additional buffers. This * way no buffers need to be garbage collected and the contents don't have * to be copied to the new buffer. This class is designed to behave exactly diff --git a/src/main/java/org/apache/commons/io/output/ByteArrayOutputStream.java b/src/main/java/org/apache/commons/io/output/ByteArrayOutputStream.java index 89f0557..8c3ff8d 100644 --- a/src/main/java/org/apache/commons/io/output/ByteArrayOutputStream.java +++ b/src/main/java/org/apache/commons/io/output/ByteArrayOutputStream.java @@ -28,7 +28,7 @@ public class ByteArrayOutputStream extends AbstractByteArrayOutputStream { /** * Creates a new byte array output stream. The buffer capacity is - * initially 1024 bytes, though its size increases if necessary. + * initially {@value AbstractByteArrayOutputStream#DEFAULT_SIZE} bytes, though its size increases if necessary. */ public ByteArrayOutputStream() { this(DEFAULT_SIZE); diff --git a/src/main/java/org/apache/commons/io/output/DeferredFileOutputStream.java b/src/main/java/org/apache/commons/io/output/DeferredFileOutputStream.java index 51e3116..b60c715 100644 --- a/src/main/java/org/apache/commons/io/output/DeferredFileOutputStream.java +++ b/src/main/java/org/apache/commons/io/output/DeferredFileOutputStream.java @@ -88,11 +88,11 @@ public class DeferredFileOutputStream /** - * Constructs an instance of this class which will trigger an event at the - * specified threshold, and save data to a file beyond that point. - * The initial buffer size will default to 1024 bytes which is ByteArrayOutputStream's default buffer size. + * Constructs an instance of this class which will trigger an event at the specified threshold, and save data to a + * file beyond that point. The initial buffer size will default to + * {@value AbstractByteArrayOutputStream#DEFAULT_SIZE} bytes which is ByteArrayOutputStream's default buffer size. * - * @param threshold The number of bytes at which to trigger an event. + * @param threshold The number of bytes at which to trigger an event. * @param outputFile The file to which data is saved beyond the threshold. */ public DeferredFileOutputStream(final int threshold, final File outputFile) diff --git a/src/main/java/org/apache/commons/io/output/UnsynchronizedByteArrayOutputStream.java b/src/main/java/org/apache/commons/io/output/UnsynchronizedByteArrayOutputStream.java index b247e1e..7e135ee 100644 --- a/src/main/java/org/apache/commons/io/output/UnsynchronizedByteArrayOutputStream.java +++ b/src/main/java/org/apache/commons/io/output/UnsynchronizedByteArrayOutputStream.java @@ -32,8 +32,8 @@ import java.io.OutputStream; public final class UnsynchronizedByteArrayOutputStream extends AbstractByteArrayOutputStream { /** - * Creates a new byte array output stream. The buffer capacity is - * initially 1024 bytes, though its size increases if necessary. + * Creates a new byte array output stream. The buffer capacity is initially + * {@value AbstractByteArrayOutputStream#DEFAULT_SIZE} bytes, though its size increases if necessary. */ public UnsynchronizedByteArrayOutputStream() { this(DEFAULT_SIZE); diff --git a/src/main/java/org/apache/commons/io/output/WriterOutputStream.java b/src/main/java/org/apache/commons/io/output/WriterOutputStream.java index 0658edd..40c1ec6 100644 --- a/src/main/java/org/apache/commons/io/output/WriterOutputStream.java +++ b/src/main/java/org/apache/commons/io/output/WriterOutputStream.java @@ -71,7 +71,7 @@ import java.nio.charset.CodingErrorAction; * @since 2.0 */ public class WriterOutputStream extends OutputStream { - private static final int DEFAULT_BUFFER_SIZE = 1024; + private static final int BUFFER_SIZE = 1024; private final Writer writer; private final CharsetDecoder decoder; @@ -92,16 +92,16 @@ public class WriterOutputStream extends OutputStream { private final CharBuffer decoderOut; /** - * Constructs a new {@link WriterOutputStream} with a default output buffer size of - * 1024 characters. The output buffer will only be flushed when it overflows or when - * {@link #flush()} or {@link #close()} is called. + * Constructs a new {@link WriterOutputStream} with a default output buffer size of {@value #BUFFER_SIZE} + * characters. The output buffer will only be flushed when it overflows or when {@link #flush()} or {@link #close()} + * is called. * * @param writer the target {@link Writer} * @param decoder the charset decoder * @since 2.1 */ public WriterOutputStream(final Writer writer, final CharsetDecoder decoder) { - this(writer, decoder, DEFAULT_BUFFER_SIZE, false); + this(writer, decoder, BUFFER_SIZE, false); } /** @@ -150,15 +150,15 @@ public class WriterOutputStream extends OutputStream { } /** - * Constructs a new {@link WriterOutputStream} with a default output buffer size of - * 1024 characters. The output buffer will only be flushed when it overflows or when - * {@link #flush()} or {@link #close()} is called. + * Constructs a new {@link WriterOutputStream} with a default output buffer size of {@value #BUFFER_SIZE} + * characters. The output buffer will only be flushed when it overflows or when {@link #flush()} or {@link #close()} + * is called. * * @param writer the target {@link Writer} * @param charset the charset encoding */ public WriterOutputStream(final Writer writer, final Charset charset) { - this(writer, charset, DEFAULT_BUFFER_SIZE, false); + this(writer, charset, BUFFER_SIZE, false); } /** @@ -179,28 +179,28 @@ public class WriterOutputStream extends OutputStream { } /** - * Constructs a new {@link WriterOutputStream} with a default output buffer size of - * 1024 characters. The output buffer will only be flushed when it overflows or when - * {@link #flush()} or {@link #close()} is called. + * Constructs a new {@link WriterOutputStream} with a default output buffer size of {@value #BUFFER_SIZE} + * characters. The output buffer will only be flushed when it overflows or when {@link #flush()} or {@link #close()} + * is called. * * @param writer the target {@link Writer} * @param charsetName the name of the charset encoding */ public WriterOutputStream(final Writer writer, final String charsetName) { - this(writer, charsetName, DEFAULT_BUFFER_SIZE, false); + this(writer, charsetName, BUFFER_SIZE, false); } /** - * Constructs a new {@link WriterOutputStream} that uses the default character encoding - * and with a default output buffer size of 1024 characters. The output buffer will only - * be flushed when it overflows or when {@link #flush()} or {@link #close()} is called. + * Constructs a new {@link WriterOutputStream} that uses the default character encoding and with a default output + * buffer size of {@value #BUFFER_SIZE} characters. The output buffer will only be flushed when it overflows or when + * {@link #flush()} or {@link #close()} is called. * * @param writer the target {@link Writer} * @deprecated 2.5 use {@link #WriterOutputStream(Writer, Charset)} instead */ @Deprecated public WriterOutputStream(final Writer writer) { - this(writer, Charset.defaultCharset(), DEFAULT_BUFFER_SIZE, false); + this(writer, Charset.defaultCharset(), BUFFER_SIZE, false); } /**