Skip to content

Commit

Permalink
Merge pull request json-path#448 from davsclaus/pos-fix
Browse files Browse the repository at this point in the history
Fixes json-path#447: To report correct index of invalid jsonpath failure. This…
  • Loading branch information
kallestenflo committed Dec 13, 2018
2 parents 2911bdb + 57604c8 commit b13740e
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,8 @@ private boolean readWildCardToken(PathTokenAppender appender) {
if (inBracket) {
int wildCardIndex = path.indexOfNextSignificantChar(WILDCARD);
if (!path.nextSignificantCharIs(wildCardIndex, CLOSE_SQUARE_BRACKET)) {
throw new InvalidPathException("Expected wildcard token to end with ']' on position " + wildCardIndex + 1);
int offset = wildCardIndex + 1;
throw new InvalidPathException("Expected wildcard token to end with ']' on position " + offset);
}
int bracketCloseIndex = path.indexOfNextSignificantChar(wildCardIndex, CLOSE_SQUARE_BRACKET);
path.setPosition(bracketCloseIndex + 1);
Expand Down

0 comments on commit b13740e

Please sign in to comment.