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 64f321bd Let subclasses of CountingInputStream.afterRead(int) throw
IOException
64f321bd is described below
commit 64f321bdcd7c3294247cba29143658162cdf3024
Author: Gary Gregory <[email protected]>
AuthorDate: Thu Dec 28 12:26:10 2023 -0500
Let subclasses of CountingInputStream.afterRead(int) throw IOException
---
src/changes/changes.xml | 1 +
src/main/java/org/apache/commons/io/input/CountingInputStream.java | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 2cf58617..21dfffab 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -84,6 +84,7 @@ The <action> type attribute can be add,update,fix,remove.
<action dev="ggregory" type="fix" issue="IO-818" due-to="Gary
Gregory">NullInputStream breaks InputStream's read method contract.</action>
<action dev="ggregory" type="fix" due-to="Elliotte Rusty
Harold">Javadoc shouldn't reference 1.x behavior #539.</action>
<action dev="ggregory" type="fix" issue="IO-829" due-to="Elliotte Rusty
Harold, Gary Gregory">Don't decode and reencode characters in a potentially
different charset in
AbstractOrigin.CharSequenceOrigin.getReader(Charset).</action>
+ <action dev="ggregory" type="fix" due-to="Gary Gregory">Let subclasses
of CountingInputStream.afterRead(int) throw IOException.</action>
<!-- Add -->
<action dev="ggregory" type="add" due-to="Gary
Gregory">Add and use PathUtils.getFileName(Path, Function<Path,
R>).</action>
<action dev="ggregory" type="add" due-to="Gary
Gregory">Add and use PathUtils.getFileNameString().</action>
diff --git a/src/main/java/org/apache/commons/io/input/CountingInputStream.java
b/src/main/java/org/apache/commons/io/input/CountingInputStream.java
index a3c11aa8..4c3eccd3 100644
--- a/src/main/java/org/apache/commons/io/input/CountingInputStream.java
+++ b/src/main/java/org/apache/commons/io/input/CountingInputStream.java
@@ -47,10 +47,11 @@ public class CountingInputStream extends ProxyInputStream {
* Adds the number of read bytes to the count.
*
* @param n number of bytes read, or -1 if no more bytes are available
+ * @throws IOException Not thrown here but subclasses may throw.
* @since 2.0
*/
@Override
- protected synchronized void afterRead(final int n) {
+ protected synchronized void afterRead(final int n) throws IOException {
if (n != EOF) {
count += n;
}