You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "kzhunmax (via GitHub)" <gi...@apache.org> on 2026/07/27 20:54:55 UTC
[PR] [LANG-1833] Handle ParsePosition index beyond source string length cleanly [commons-lang]
kzhunmax opened a new pull request, #1757:
URL: https://github.com/apache/commons-lang/pull/1757
Regression test approved that this was a bug:
```
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running org.apache.commons.lang3.time.FastDateParserTest
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.182 s <<< FAILURE! -- in org.apache.commons.lang3.time.FastDateParserTest
[ERROR] org.apache.commons.lang3.time.FastDateParserTest.testParsePositionBeyondInputLength -- Time elapsed: 0.100 s <<< ERROR!
java.lang.StringIndexOutOfBoundsException: Range [10, 3) out of bounds for length 3
at java.base/jdk.internal.util.Preconditions$1.apply(Preconditions.java:55)
at java.base/jdk.internal.util.Preconditions$1.apply(Preconditions.java:52)
at java.base/jdk.internal.util.Preconditions$4.apply(Preconditions.java:213)
at java.base/jdk.internal.util.Preconditions$4.apply(Preconditions.java:210)
at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:98)
at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckFromToIndex(Preconditions.java:112)
at java.base/jdk.internal.util.Preconditions.checkFromToIndex(Preconditions.java:349)
at java.base/java.lang.String.checkBoundsBeginEnd(String.java:4937)
at java.base/java.lang.String.substring(String.java:2899)
at java.base/java.lang.String.substring(String.java:2872)
at org.apache.commons.lang3.time.FastDateParser$PatternStrategy.parse(FastDateParser.java:356)
at org.apache.commons.lang3.time.FastDateParser.parse(FastDateParser.java:1069)
at org.apache.commons.lang3.time.FastDateParser.parse(FastDateParser.java:1049)
at org.apache.commons.lang3.time.FastDateParserTest.testParsePositionBeyondInputLength(FastDateParserTest.java:574)
at java.base/java.lang.reflect.Method.invoke(Method.java:565)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1604)
[INFO]
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR] FastDateParserTest.testParsePositionBeyondInputLength:574 ยป StringIndexOutOfBounds Range [10, 3) out of bounds for length 3
[INFO]
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 21.275 s
[INFO] Finished at: 2026-07-27T21:14:27+02:00
[INFO] ------------------------------------------------------------------------
```
Related: LANG-1833
--
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: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [LANG-1833] Handle ParsePosition index beyond source string length cleanly [commons-lang]
Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory merged PR #1757:
URL: https://github.com/apache/commons-lang/pull/1757
--
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: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [LANG-1833] Handle ParsePosition index beyond source string length cleanly [commons-lang]
Posted by "kzhunmax (via GitHub)" <gi...@apache.org>.
kzhunmax commented on PR #1757:
URL: https://github.com/apache/commons-lang/pull/1757#issuecomment-5097874897
@garydgregory No other live call site has the same bug as LANG-1833, verified :)
--
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: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [LANG-1833] Handle ParsePosition index beyond source string length cleanly [commons-lang]
Posted by "kzhunmax (via GitHub)" <gi...@apache.org>.
kzhunmax commented on PR #1757:
URL: https://github.com/apache/commons-lang/pull/1757#issuecomment-5097160531
Jira ticket is [LANG-1833](https://issues.apache.org/jira/browse/LANG-1833)
--
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: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [LANG-1833] Handle ParsePosition index beyond source string length cleanly [commons-lang]
Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory commented on PR #1757:
URL: https://github.com/apache/commons-lang/pull/1757#issuecomment-5097353003
@kzhunmax
Merged ๐ Please review the other call sites of `ParsePosition` in the library for similar problems if you can.
--
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: issues-unsubscribe@commons.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org