garydgregory commented on PR #938: URL: https://github.com/apache/commons-io/pull/938#issuecomment-6979097621
@AnaaCodes Thanks for the contribution. The difference between `read()` and `skip()` is understandable motivation, but this change needs more justification and coverage: It reverses an earlier design decision. In [PR #860’s review](https://github.com/apache/commons-io/pull/860#discussion_r3435099341) we explicitly decided that `skip()` should respect the overall character bound without treating the mark’s read-ahead limit as another hard bound. This PR reintroduces that restriction without explaining why that decision should change. It stops too early for marks at nonzero positions. With an overall bound of 10, `read(); read(); mark(2); skip(2)` now returns `0`. This happens because existing `mark()` accounting subtracts characters consumed before the mark. The PR extends that existing accounting defect to `skip()`. The added test misses these cases. It only marks at position zero. Also, `StringReader` ignores the read-ahead limit, so its successful `reset()` does not demonstrate preservation of a limited mark. Coverage should include nonzero marks, mixed reads and skips, repeated skips, and the overall bound. The mark-accounting defect can be fixed separately while preserving the established skipping behavior. Changing that behavior would need an agreed contract, corresponding Javadoc, and broader regression coverage. You are credited in `changes.xml`. Closing. -- 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]
