Browse Source

fix detection of trailing comma

pull/194/head
Jochen Berger 9 years ago
parent
commit
7115c6155f
  1. 3
      json-path/src/main/java/com/jayway/jsonpath/internal/path/PathCompiler.java

3
json-path/src/main/java/com/jayway/jsonpath/internal/path/PathCompiler.java

@ -570,6 +570,9 @@ public class PathCompiler {
} else if('\\' == c){ } else if('\\' == c){
inEscape = true; inEscape = true;
} else if (c == CLOSE_SQUARE_BRACKET && !inProperty) { } else if (c == CLOSE_SQUARE_BRACKET && !inProperty) {
if (lastSignificantWasComma){
fail("Found empty property at index "+readPosition);
}
break; break;
} else if (c == potentialStringDelimiter) { } else if (c == potentialStringDelimiter) {
if (inProperty && !inEscape) { if (inProperty && !inEscape) {

Loading…
Cancel
Save