From 7115c6155f8ef315ddad8cee51493a28f9d349a1 Mon Sep 17 00:00:00 2001 From: Jochen Berger Date: Thu, 18 Feb 2016 13:15:56 +0100 Subject: [PATCH] fix detection of trailing comma --- .../java/com/jayway/jsonpath/internal/path/PathCompiler.java | 3 +++ 1 file changed, 3 insertions(+) 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 9e2db4bb..4d003dc7 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 @@ -570,6 +570,9 @@ public class PathCompiler { } else if('\\' == c){ inEscape = true; } else if (c == CLOSE_SQUARE_BRACKET && !inProperty) { + if (lastSignificantWasComma){ + fail("Found empty property at index "+readPosition); + } break; } else if (c == potentialStringDelimiter) { if (inProperty && !inEscape) {