You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2023/10/27 21:51:01 UTC
(commons-io) 02/02: Camel case parameter name
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
commit 77c6f91a7d6ddaf4fd4136782f58c36de9065361
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Fri Oct 27 17:50:54 2023 -0400
Camel case parameter name
---
.../org/apache/commons/io/input/BOMInputStream.java | 6 +++---
.../apache/commons/io/input/BoundedInputStream.java | 6 +++---
.../commons/io/input/CharSequenceInputStream.java | 4 ++--
.../apache/commons/io/input/MarkShieldInputStream.java | 2 +-
.../java/org/apache/commons/io/input/NullReader.java | 12 ++++++------
.../org/apache/commons/io/input/ProxyInputStream.java | 6 +++---
.../commons/io/input/UnixLineEndingInputStream.java | 2 +-
.../io/input/UnsynchronizedBufferedInputStream.java | 18 +++++++++---------
.../io/input/UnsynchronizedByteArrayInputStream.java | 2 +-
.../io/input/UnsynchronizedFilterInputStream.java | 12 ++++++------
.../commons/io/input/WindowsLineEndingInputStream.java | 2 +-
.../commons/io/input/MarkShieldInputStreamTest.java | 12 ++++++------
.../apache/commons/io/input/NullInputStreamTest.java | 8 ++++----
.../org/apache/commons/io/input/NullReaderTest.java | 8 ++++----
14 files changed, 50 insertions(+), 50 deletions(-)
diff --git a/src/main/java/org/apache/commons/io/input/BOMInputStream.java b/src/main/java/org/apache/commons/io/input/BOMInputStream.java
index 425af99c..e6b30a92 100644
--- a/src/main/java/org/apache/commons/io/input/BOMInputStream.java
+++ b/src/main/java/org/apache/commons/io/input/BOMInputStream.java
@@ -367,14 +367,14 @@ public class BOMInputStream extends ProxyInputStream {
/**
* Invokes the delegate's {@code mark(int)} method.
*
- * @param readlimit
+ * @param readLimit
* read ahead limit
*/
@Override
- public synchronized void mark(final int readlimit) {
+ public synchronized void mark(final int readLimit) {
markFbIndex = fbIndex;
markedAtStart = firstBytes == null;
- in.mark(readlimit);
+ in.mark(readLimit);
}
/**
diff --git a/src/main/java/org/apache/commons/io/input/BoundedInputStream.java b/src/main/java/org/apache/commons/io/input/BoundedInputStream.java
index 902e6a55..75c14c0e 100644
--- a/src/main/java/org/apache/commons/io/input/BoundedInputStream.java
+++ b/src/main/java/org/apache/commons/io/input/BoundedInputStream.java
@@ -134,11 +134,11 @@ public class BoundedInputStream extends FilterInputStream {
/**
* Invokes the delegate's {@code mark(int)} method.
*
- * @param readlimit read ahead limit
+ * @param readLimit read ahead limit
*/
@Override
- public synchronized void mark(final int readlimit) {
- in.mark(readlimit);
+ public synchronized void mark(final int readLimit) {
+ in.mark(readLimit);
mark = count;
}
diff --git a/src/main/java/org/apache/commons/io/input/CharSequenceInputStream.java b/src/main/java/org/apache/commons/io/input/CharSequenceInputStream.java
index a87d08c1..303e0357 100644
--- a/src/main/java/org/apache/commons/io/input/CharSequenceInputStream.java
+++ b/src/main/java/org/apache/commons/io/input/CharSequenceInputStream.java
@@ -254,10 +254,10 @@ public class CharSequenceInputStream extends InputStream {
/**
* {@inheritDoc}
- * @param readlimit max read limit (ignored).
+ * @param readLimit max read limit (ignored).
*/
@Override
- public synchronized void mark(final int readlimit) {
+ public synchronized void mark(final int readLimit) {
this.cBufMark = this.cBuf.position();
this.bBufMark = this.bBuf.position();
this.cBuf.mark();
diff --git a/src/main/java/org/apache/commons/io/input/MarkShieldInputStream.java b/src/main/java/org/apache/commons/io/input/MarkShieldInputStream.java
index 97653fc1..50079f8e 100644
--- a/src/main/java/org/apache/commons/io/input/MarkShieldInputStream.java
+++ b/src/main/java/org/apache/commons/io/input/MarkShieldInputStream.java
@@ -47,7 +47,7 @@ public class MarkShieldInputStream extends ProxyInputStream {
@SuppressWarnings("sync-override")
@Override
- public void mark(final int readlimit) {
+ public void mark(final int readLimit) {
// no-op
}
diff --git a/src/main/java/org/apache/commons/io/input/NullReader.java b/src/main/java/org/apache/commons/io/input/NullReader.java
index 69d11c07..0daeff65 100644
--- a/src/main/java/org/apache/commons/io/input/NullReader.java
+++ b/src/main/java/org/apache/commons/io/input/NullReader.java
@@ -76,7 +76,7 @@ public class NullReader extends Reader {
private final long size;
private long position;
private long mark = -1;
- private long readlimit;
+ private long readLimit;
private boolean eof;
private final boolean throwEofException;
private final boolean markSupported;
@@ -168,17 +168,17 @@ public class NullReader extends Reader {
/**
* Marks the current position.
*
- * @param readlimit The number of characters before this marked position
+ * @param readLimit The number of characters before this marked position
* is invalid.
* @throws UnsupportedOperationException if mark is not supported.
*/
@Override
- public synchronized void mark(final int readlimit) {
+ public synchronized void mark(final int readLimit) {
if (!markSupported) {
throw UnsupportedOperationExceptions.mark();
}
mark = position;
- this.readlimit = readlimit;
+ this.readLimit = readLimit;
}
/**
@@ -304,10 +304,10 @@ public class NullReader extends Reader {
if (mark < 0) {
throw new IOException("No position has been marked");
}
- if (position > mark + readlimit) {
+ if (position > mark + readLimit) {
throw new IOException("Marked position [" + mark +
"] is no longer valid - passed the read limit [" +
- readlimit + "]");
+ readLimit + "]");
}
position = mark;
eof = false;
diff --git a/src/main/java/org/apache/commons/io/input/ProxyInputStream.java b/src/main/java/org/apache/commons/io/input/ProxyInputStream.java
index 4344cba3..cf6cee5e 100644
--- a/src/main/java/org/apache/commons/io/input/ProxyInputStream.java
+++ b/src/main/java/org/apache/commons/io/input/ProxyInputStream.java
@@ -137,11 +137,11 @@ public abstract class ProxyInputStream extends FilterInputStream {
/**
* Invokes the delegate's {@code mark(int)} method.
- * @param readlimit read ahead limit
+ * @param readLimit read ahead limit
*/
@Override
- public synchronized void mark(final int readlimit) {
- in.mark(readlimit);
+ public synchronized void mark(final int readLimit) {
+ in.mark(readLimit);
}
/**
diff --git a/src/main/java/org/apache/commons/io/input/UnixLineEndingInputStream.java b/src/main/java/org/apache/commons/io/input/UnixLineEndingInputStream.java
index 7b0ebb22..c19ac652 100644
--- a/src/main/java/org/apache/commons/io/input/UnixLineEndingInputStream.java
+++ b/src/main/java/org/apache/commons/io/input/UnixLineEndingInputStream.java
@@ -82,7 +82,7 @@ public class UnixLineEndingInputStream extends InputStream {
* {@inheritDoc}
*/
@Override
- public synchronized void mark(final int readlimit) {
+ public synchronized void mark(final int readLimit) {
throw UnsupportedOperationExceptions.mark();
}
diff --git a/src/main/java/org/apache/commons/io/input/UnsynchronizedBufferedInputStream.java b/src/main/java/org/apache/commons/io/input/UnsynchronizedBufferedInputStream.java
index b33a1187..dfa58423 100644
--- a/src/main/java/org/apache/commons/io/input/UnsynchronizedBufferedInputStream.java
+++ b/src/main/java/org/apache/commons/io/input/UnsynchronizedBufferedInputStream.java
@@ -173,7 +173,7 @@ public final class UnsynchronizedBufferedInputStream extends UnsynchronizedFilte
private int fillBuffer(final InputStream localIn, byte[] localBuf) throws IOException {
if (markPos == IOUtils.EOF || pos - markPos >= markLimit) {
- /* Mark position not set or exceeded readlimit */
+ /* Mark position not set or exceeded readLimit */
final int result = localIn.read(localBuf);
if (result > 0) {
markPos = IOUtils.EOF;
@@ -183,7 +183,7 @@ public final class UnsynchronizedBufferedInputStream extends UnsynchronizedFilte
return result;
}
if (markPos == 0 && markLimit > localBuf.length) {
- /* Increase buffer size to accommodate the readlimit */
+ /* Increase buffer size to accommodate the readLimit */
int newLength = localBuf.length * 2;
if (newLength > markLimit) {
newLength = markLimit;
@@ -209,16 +209,16 @@ public final class UnsynchronizedBufferedInputStream extends UnsynchronizedFilte
}
/**
- * Sets a mark position in this stream. The parameter {@code readlimit} indicates how many bytes can be read before a mark is invalidated. Calling
- * {@code reset()} will reposition the stream back to the marked position if {@code readlimit} has not been surpassed. The underlying buffer may be
- * increased in size to allow {@code readlimit} number of bytes to be supported.
+ * Sets a mark position in this stream. The parameter {@code readLimit} indicates how many bytes can be read before a mark is invalidated. Calling
+ * {@code reset()} will reposition the stream back to the marked position if {@code readLimit} has not been surpassed. The underlying buffer may be
+ * increased in size to allow {@code readLimit} number of bytes to be supported.
*
- * @param readlimit the number of bytes that can be read before the mark is invalidated.
+ * @param readLimit the number of bytes that can be read before the mark is invalidated.
* @see #reset()
*/
@Override
- public void mark(final int readlimit) {
- markLimit = readlimit;
+ public void mark(final int readLimit) {
+ markLimit = readLimit;
markPos = pos;
}
@@ -358,7 +358,7 @@ public final class UnsynchronizedBufferedInputStream extends UnsynchronizedFilte
/**
* Resets this stream to the last marked location.
*
- * @throws IOException if this stream is closed, no mark has been set or the mark is no longer valid because more than {@code readlimit} bytes have been
+ * @throws IOException if this stream is closed, no mark has been set or the mark is no longer valid because more than {@code readLimit} bytes have been
* read since setting the mark.
* @see #mark(int)
*/
diff --git a/src/main/java/org/apache/commons/io/input/UnsynchronizedByteArrayInputStream.java b/src/main/java/org/apache/commons/io/input/UnsynchronizedByteArrayInputStream.java
index f10c1120..f3bead5e 100644
--- a/src/main/java/org/apache/commons/io/input/UnsynchronizedByteArrayInputStream.java
+++ b/src/main/java/org/apache/commons/io/input/UnsynchronizedByteArrayInputStream.java
@@ -238,7 +238,7 @@ public class UnsynchronizedByteArrayInputStream extends InputStream {
@SuppressWarnings("sync-override")
@Override
- public void mark(final int readlimit) {
+ public void mark(final int readLimit) {
this.markedOffset = this.offset;
}
diff --git a/src/main/java/org/apache/commons/io/input/UnsynchronizedFilterInputStream.java b/src/main/java/org/apache/commons/io/input/UnsynchronizedFilterInputStream.java
index 0465cd6b..d5ae16a1 100644
--- a/src/main/java/org/apache/commons/io/input/UnsynchronizedFilterInputStream.java
+++ b/src/main/java/org/apache/commons/io/input/UnsynchronizedFilterInputStream.java
@@ -131,19 +131,19 @@ public class UnsynchronizedFilterInputStream extends InputStream {
}
/**
- * Sets a mark position in this stream. The parameter {@code readlimit} indicates how many bytes can be read before the mark is invalidated. Sending
- * {@code reset()} will reposition this stream back to the marked position, provided that {@code readlimit} has not been surpassed.
+ * Sets a mark position in this stream. The parameter {@code readLimit} indicates how many bytes can be read before the mark is invalidated. Sending
+ * {@code reset()} will reposition this stream back to the marked position, provided that {@code readLimit} has not been surpassed.
* <p>
* This implementation sets a mark in the filtered stream.
*
- * @param readlimit the number of bytes that can be read from this stream before the mark is invalidated.
+ * @param readLimit the number of bytes that can be read from this stream before the mark is invalidated.
* @see #markSupported()
* @see #reset()
*/
@SuppressWarnings("sync-override") // by design.
@Override
- public void mark(final int readlimit) {
- inputStream.mark(readlimit);
+ public void mark(final int readLimit) {
+ inputStream.mark(readLimit);
}
/**
@@ -204,7 +204,7 @@ public class UnsynchronizedFilterInputStream extends InputStream {
/**
* Resets this stream to the last marked location. This implementation resets the target stream.
*
- * @throws IOException if this stream is already closed, no mark has been set or the mark is no longer valid because more than {@code readlimit} bytes have
+ * @throws IOException if this stream is already closed, no mark has been set or the mark is no longer valid because more than {@code readLimit} bytes have
* been read since setting the mark.
* @see #mark(int)
* @see #markSupported()
diff --git a/src/main/java/org/apache/commons/io/input/WindowsLineEndingInputStream.java b/src/main/java/org/apache/commons/io/input/WindowsLineEndingInputStream.java
index e5ba818d..6be7e73a 100644
--- a/src/main/java/org/apache/commons/io/input/WindowsLineEndingInputStream.java
+++ b/src/main/java/org/apache/commons/io/input/WindowsLineEndingInputStream.java
@@ -89,7 +89,7 @@ public class WindowsLineEndingInputStream extends InputStream {
* {@inheritDoc}
*/
@Override
- public synchronized void mark(final int readlimit) {
+ public synchronized void mark(final int readLimit) {
throw UnsupportedOperationExceptions.mark();
}
diff --git a/src/test/java/org/apache/commons/io/input/MarkShieldInputStreamTest.java b/src/test/java/org/apache/commons/io/input/MarkShieldInputStreamTest.java
index ba0944ef..e82c3341 100644
--- a/src/test/java/org/apache/commons/io/input/MarkShieldInputStreamTest.java
+++ b/src/test/java/org/apache/commons/io/input/MarkShieldInputStreamTest.java
@@ -30,7 +30,7 @@ public class MarkShieldInputStreamTest {
private static final class MarkTestableInputStream extends ProxyInputStream {
int markcount;
- int readlimit;
+ int readLimit;
public MarkTestableInputStream(final InputStream in) {
super(in);
@@ -38,13 +38,13 @@ public class MarkShieldInputStreamTest {
@SuppressWarnings("sync-override")
@Override
- public void mark(final int readlimit) {
+ public void mark(final int readLimit) {
// record that `mark` was called
this.markcount++;
- this.readlimit = readlimit;
+ this.readLimit = readLimit;
// invoke on super
- super.mark(readlimit);
+ super.mark(readLimit);
}
}
@@ -56,7 +56,7 @@ public class MarkShieldInputStreamTest {
msis.mark(1024);
assertEquals(0, in.markcount);
- assertEquals(0, in.readlimit);
+ assertEquals(0, in.readLimit);
}
}
@@ -68,7 +68,7 @@ public class MarkShieldInputStreamTest {
msis.mark(1024);
assertEquals(0, in.markcount);
- assertEquals(0, in.readlimit);
+ assertEquals(0, in.readLimit);
}
}
diff --git a/src/test/java/org/apache/commons/io/input/NullInputStreamTest.java b/src/test/java/org/apache/commons/io/input/NullInputStreamTest.java
index 9e562ba7..da6460ea 100644
--- a/src/test/java/org/apache/commons/io/input/NullInputStreamTest.java
+++ b/src/test/java/org/apache/commons/io/input/NullInputStreamTest.java
@@ -71,7 +71,7 @@ public class NullInputStreamTest {
@Test
public void testMarkAndReset() throws Exception {
int position = 0;
- final int readlimit = 10;
+ final int readLimit = 10;
try (InputStream input = new TestNullInputStream(100, true, false)) {
assertTrue(input.markSupported(), "Mark Should be Supported");
@@ -85,7 +85,7 @@ public class NullInputStreamTest {
}
// Mark
- input.mark(readlimit);
+ input.mark(readLimit);
// Read further
for (int i = 0; i < 3; i++) {
@@ -96,13 +96,13 @@ public class NullInputStreamTest {
input.reset();
// Read From marked position
- for (int i = 0; i < readlimit + 1; i++) {
+ for (int i = 0; i < readLimit + 1; i++) {
assertEquals(position + i, input.read(), "Read After Reset [" + i + "]");
}
// Reset after read limit passed
final IOException resetException = assertThrows(IOException.class, input::reset, "Read limit exceeded, expected IOException");
- assertEquals("Marked position [" + position + "] is no longer valid - passed the read limit [" + readlimit + "]", resetException.getMessage(),
+ assertEquals("Marked position [" + position + "] is no longer valid - passed the read limit [" + readLimit + "]", resetException.getMessage(),
"Read limit IOException message");
}
}
diff --git a/src/test/java/org/apache/commons/io/input/NullReaderTest.java b/src/test/java/org/apache/commons/io/input/NullReaderTest.java
index 43958007..08a80325 100644
--- a/src/test/java/org/apache/commons/io/input/NullReaderTest.java
+++ b/src/test/java/org/apache/commons/io/input/NullReaderTest.java
@@ -72,7 +72,7 @@ public class NullReaderTest {
@Test
public void testMarkAndReset() throws Exception {
int position = 0;
- final int readlimit = 10;
+ final int readLimit = 10;
try (Reader reader = new TestNullReader(100, true, false)) {
assertTrue(reader.markSupported(), "Mark Should be Supported");
@@ -86,7 +86,7 @@ public class NullReaderTest {
}
// Mark
- reader.mark(readlimit);
+ reader.mark(readLimit);
// Read further
for (int i = 0; i < 3; i++) {
@@ -97,13 +97,13 @@ public class NullReaderTest {
reader.reset();
// Read From marked position
- for (int i = 0; i < readlimit + 1; i++) {
+ for (int i = 0; i < readLimit + 1; i++) {
assertEquals(position + i, reader.read(), "Read After Reset [" + i + "]");
}
// Reset after read limit passed
final IOException e = assertThrows(IOException.class, reader::reset);
- assertEquals("Marked position [" + position + "] is no longer valid - passed the read limit [" + readlimit + "]", e.getMessage(),
+ assertEquals("Marked position [" + position + "] is no longer valid - passed the read limit [" + readLimit + "]", e.getMessage(),
"Read limit IOException message");
}
}