Skip to content

Commit 0d9cd9f

Browse files
committed
Fix #173
1 parent bfdc285 commit 0d9cd9f

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

release-notes/CREDITS

+4
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,7 @@ Steve van Loben Sels
3535
Shay Banon
3636
* Reported #145: NPE at BytesToNameCanonicalizer
3737
(2.4.2)
38+
39+
Alex Soto: (lordofthejars@github)
40+
* Reported #173: An exception is thrown for a valid JsonPointer expression
41+

release-notes/VERSION

+3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ json-specificity (naming due to historical reasons).
1717

1818
#157: ArrayIndexOutOfBoundsException: 200 on numbers with more than 200 digits.
1919
(reported by Lars P, larsp@github)
20+
#173: An exception is thrown for a valid JsonPointer expression
21+
(reported by Alex S)
22+
2023
- Fix `JsonGenerator.setFeatureMask()` to better handle dynamic changes.
2124

2225
2.4.3 (02-Oct-2014)

src/main/java/com/fasterxml/jackson/core/JsonPointer.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ private final static int _parseIndex(String str) {
190190
return -1;
191191
}
192192
for (int i = 0; i < len; ++i) {
193-
char c = str.charAt(i++);
193+
char c = str.charAt(i);
194194
if (c > '9' || c < '0') {
195195
return -1;
196196
}

src/test/java/com/fasterxml/jackson/core/TestJsonPointer.java

+6
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ public void testSimplePath() throws Exception
3636
assertEquals(-1, ptr.getMatchingIndex());
3737
}
3838

39+
public void testWonkyNumber173() throws Exception
40+
{
41+
JsonPointer ptr = JsonPointer.compile("/1e0");
42+
assertFalse(ptr.matches());
43+
}
44+
3945
public void testQuotedPath() throws Exception
4046
{
4147
final String INPUT = "/w~1out/til~0de/a~1b";

0 commit comments

Comments
 (0)