From 0ea1cb59adc1e9d15ff7ff918f54c94ead3c86e0 Mon Sep 17 00:00:00 2001 From: kysnm Date: Wed, 21 Sep 2016 13:20:23 +0900 Subject: [PATCH] The conditions the same as the other --- .../java/com/jayway/jsonpath/internal/path/PathCompiler.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/json-path/src/main/java/com/jayway/jsonpath/internal/path/PathCompiler.java b/json-path/src/main/java/com/jayway/jsonpath/internal/path/PathCompiler.java index b1e142c0..f83e953a 100644 --- a/json-path/src/main/java/com/jayway/jsonpath/internal/path/PathCompiler.java +++ b/json-path/src/main/java/com/jayway/jsonpath/internal/path/PathCompiler.java @@ -576,7 +576,8 @@ public class PathCompiler { break; } else if (c == potentialStringDelimiter) { if (inProperty && !inEscape) { - if (!path.nextSignificantCharIs(readPosition, COMMA) && !path.nextSignificantCharIs(readPosition, CLOSE_SQUARE_BRACKET)) { + char nextSignificantChar = path.nextSignificantChar(readPosition); + if (nextSignificantChar != CLOSE_SQUARE_BRACKET && nextSignificantChar != COMMA) { fail("Property must be separated by comma or Property must be terminated close square bracket at index "+readPosition); } endPosition = readPosition;