You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Json-Patch project leader has noted me that there is a bug on JsonPointer implementation and I have decided to investigate.
Basically if you do something like JsonPointer.compile("/1e0"); it throws a NumberFormatExpcetion which is not true. This is because this piece of code:
privatefinalstaticint_parseInt(Stringstr)
{
finalintlen = str.length();
if (len == 0) {
return -1;
}
for (inti = 0; i < len; ++i) {
charc = str.charAt(i++);
if (c > '9' || c < '0') {
return -1;
}
}
// for now, we'll assume 32-bit indexes are finereturnNumberInput.parseInt(str);
}
When they found a number it interprets the segment as integer but in reality it should be the whole expression. For this reason I think that the condition should be changed to the inverse condition (if it doesn't found any char then it is a number.
If you want I can send you a PR as well.
Alex.
The text was updated successfully, but these errors were encountered:
Json-Patch project leader has noted me that there is a bug on JsonPointer implementation and I have decided to investigate.
Basically if you do something like
JsonPointer.compile("/1e0");
it throws a NumberFormatExpcetion which is not true. This is because this piece of code:When they found a number it interprets the segment as integer but in reality it should be the whole expression. For this reason I think that the condition should be changed to the inverse condition (if it doesn't found any char then it is a number.
If you want I can send you a PR as well.
Alex.
The text was updated successfully, but these errors were encountered: