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 0de91c0 Tweak org.apache.commons.io.input.CircularInputStream.
0de91c0 is described below
commit 0de91c048fb575b9e7906e966a4428574fd03695
Author: Gary Gregory <[email protected]>
AuthorDate: Wed Jul 1 10:49:47 2020 -0400
Tweak org.apache.commons.io.input.CircularInputStream.
[IO-674] InfiniteCircularInputStream is not infinite if its input buffer
contains -1.
[IO-675] InfiniteCircularInputStream throws a divide-by-zero exception
when reading if its input buffer is size 0.
Update version from 2.7.1-SNAPSHOT to 2.8-SNAPSHOT since we are adding a
new public class.
maven-checkstyle-plugin 3.1.0 -> 3.1.1.
---
checkstyle.xml | 8 +++-----
pom.xml | 2 +-
src/changes/changes.xml | 3 +++
.../java/org/apache/commons/io/input/CircularInputStream.java | 4 +---
4 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/checkstyle.xml b/checkstyle.xml
index e68f926..ee9c952 100644
--- a/checkstyle.xml
+++ b/checkstyle.xml
@@ -30,17 +30,15 @@ limitations under the License.
<module name="FileTabCharacter">
<property name="fileExtensions" value="java,xml"/>
</module>
+ <module name="LineLength">
+ <property name="max" value="160"/>
+ </module>
<module name="TreeWalker">
<module name="AvoidStarImport"/>
<module name="RedundantImport"/>
<module name="UnusedImports"/>
<module name="NeedBraces"/>
- <module name="LineLength">
- <property name="max" value="160"/>
- </module>
<module name="JavadocMethod">
- <property name="allowUndeclaredRTE" value="true"/>
- <property name="allowThrowsTagsForSubclasses" value="true"/>
</module>
</module>
</module>
diff --git a/pom.xml b/pom.xml
index a936fa4..139501c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -290,7 +290,7 @@ file comparators, endian transformation classes, and much
more.
</commons.osgi.export>
<commons.scmPubUrl>https://svn.apache.org/repos/infra/websites/production/commons/content/proper/commons-io/</commons.scmPubUrl>
<commons.scmPubCheckoutDirectory>site-content</commons.scmPubCheckoutDirectory>
- <checkstyle.plugin.version>3.1.0</checkstyle.plugin.version>
+ <checkstyle.plugin.version>3.1.1</checkstyle.plugin.version>
<commons.jacoco.version>0.8.5</commons.jacoco.version>
<commons.surefire.version>2.22.2</commons.surefire.version>
<commons.japicmp.version>0.14.3</commons.japicmp.version>
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 09f345f..28960f9 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -65,6 +65,9 @@ The <action> type attribute can be add,update,fix,remove.
<action issue="IO-675" dev="ggregory" type="fix" due-to="Gary Gregory">
InfiniteCircularInputStream throws a divide-by-zero exception when
reading if its input buffer is size 0.
</action>
+ <action dev="ggregory" type="fix" due-to="Gary Gregory">
+ maven-checkstyle-plugin 3.1.0 -> 3.1.1.
+ </action>
</release>
<!-- The release date is the date RC is cut -->
<release version="2.7" date="2020-05-24" description="Java 8 required.">
diff --git a/src/main/java/org/apache/commons/io/input/CircularInputStream.java
b/src/main/java/org/apache/commons/io/input/CircularInputStream.java
index 5166b38..d755dee 100644
--- a/src/main/java/org/apache/commons/io/input/CircularInputStream.java
+++ b/src/main/java/org/apache/commons/io/input/CircularInputStream.java
@@ -50,6 +50,7 @@ public class CircularInputStream extends InputStream {
}
return repeatContent;
}
+
private long byteCount;
private int position = -1;
private final byte[] repeatedContent;
@@ -71,9 +72,6 @@ public class CircularInputStream extends InputStream {
@Override
public int read() {
- if (repeatedContent.length == 0) {
- return IOUtils.EOF;
- }
if (targetByteCount >= 0) {
if (byteCount == targetByteCount) {
return IOUtils.EOF;