AmarGhugare opened a new pull request, #931:
URL: https://github.com/apache/commons-io/pull/931

   `AbstractCharacterFilterReader` can return zero from a positive-length read 
when an underlying chunk contains only discarded characters. Filtering `x` from 
`xxa` with a two-character buffer returns `0` instead of reading `a`. Its 
inherited `skip()` also bypasses filtering: filtering `x` from `xaxb`, then 
skipping one character and reading, returns `a` instead of `b`.
   
   Continue bulk reads until a retained character or EOF is found, and use 
`IOUtils.skip(this, n)` to count retained characters. Preserve zero-length 
requests and the delegate's closed-state check for zero skips. This fixes 
existing operations without adding a new API.
   
   Add 28 regression cases across `CharacterFilterReader` and 
`CharacterSetFilterReader`, covering fully filtered chunks, EOF, short reads, 
CharBuffer, offsets, invalid arguments, skip counts, and closed readers. 
Sixteen cases fail on the original source and released 2.22.0 JAR; all 28 pass 
after the fix.
   
   ## Validation
   
   JDK 17, Maven 3.10.0, targeting Java 8:
   
   - All 57 relevant tests passed under Maven: 28 new cases and 29 existing 
concrete-reader/predicate tests.
   - Ran the unfiltered default `mvn -B -ntp` build: 7,447 tests, zero 
assertion failures, seven errors, 64 skips. The seven errors are Windows 
symlink-privilege errors in `PathUtilsCopyTest` and `FileUtilsTest`. The same 
failing cases were previously reproduced with unchanged upstream production 
source. The full default Windows build is not green locally.
   - Coverage, license, API compatibility, Checkstyle, SpotBugs, PMD, and 
Javadoc checks passed. Completed the remaining checks without repeating tests:
   
   ```text
   mvn -B -ntp -DskipTests -DskipITs verify apache-rat:check japicmp:cmp 
checkstyle:check spotbugs:check pmd:check javadoc:javadoc
   ```
   
   A Jira ticket has not yet been filed for these defects.
   
   ## Checklist
   
   - [x] Read the contribution guidelines.
   - [x] Added regression tests that fail before the runtime fix.
   - [x] Passed coverage, license, compatibility, style, static-analysis, and 
Javadoc checks.
   - [ ] Successful unfiltered default Maven build on Windows; baseline 
privilege errors are described above.
   - [x] Explained the change and kept the commit focused.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to