diff --git a/src/main/java/com/alibaba/fastjson/JSONPath.java b/src/main/java/com/alibaba/fastjson/JSONPath.java index 6182b72912..682030e1f6 100644 --- a/src/main/java/com/alibaba/fastjson/JSONPath.java +++ b/src/main/java/com/alibaba/fastjson/JSONPath.java @@ -100,7 +100,8 @@ public Object extract(DefaultJSONParser parser) { boolean last = i == segments.length - 1; if (context != null && context.object != null) { - return segment.eval(this, null, context.object); + context.object = segment.eval(this, null, context.object); + continue; } boolean eval; @@ -122,6 +123,8 @@ public Object extract(DefaultJSONParser parser) { eval = true; } else if (nextSegment instanceof FilterSegment) { eval = true; + } else if (segment instanceof WildCardSegment) { + eval = true; } else { eval = false; }