Skip to content

Commit

Permalink
Tweak org.apache.commons.io.input.CircularInputStream.
Browse files Browse the repository at this point in the history
[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.
  • Loading branch information
garydgregory committed Jul 1, 2020
1 parent 97ae01c commit 0de91c0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
8 changes: 3 additions & 5 deletions checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
3 changes: 3 additions & 0 deletions src/changes/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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.">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ private static byte[] validate(final byte[] repeatContent) {
}
return repeatContent;
}

private long byteCount;
private int position = -1;
private final byte[] repeatedContent;
Expand All @@ -71,9 +72,6 @@ public CircularInputStream(final byte[] repeatContent, final long targetByteCoun

@Override
public int read() {
if (repeatedContent.length == 0) {
return IOUtils.EOF;
}
if (targetByteCount >= 0) {
if (byteCount == targetByteCount) {
return IOUtils.EOF;
Expand Down

0 comments on commit 0de91c0

Please sign in to comment.