From 5315b7d47f064544462b23849a205903cf3b907e Mon Sep 17 00:00:00 2001 From: Kalle Stenflo Date: Tue, 23 Sep 2014 16:08:18 +0200 Subject: [PATCH] Don't eval to much in && and || filters. --- json-path/src/main/java/com/jayway/jsonpath/Filter.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/json-path/src/main/java/com/jayway/jsonpath/Filter.java b/json-path/src/main/java/com/jayway/jsonpath/Filter.java index 74d67cce..630e7c25 100644 --- a/json-path/src/main/java/com/jayway/jsonpath/Filter.java +++ b/json-path/src/main/java/com/jayway/jsonpath/Filter.java @@ -67,8 +67,7 @@ public class Filter implements Predicate { @Override public boolean apply(PredicateContext ctx) { boolean a = Filter.this.apply(ctx); - boolean b = other.apply(ctx); - return a || b; + return a || other.apply(ctx); } }; } @@ -78,8 +77,7 @@ public class Filter implements Predicate { @Override public boolean apply(PredicateContext ctx) { boolean a = Filter.this.apply(ctx); - boolean b = other.apply(ctx); - return a && b; + return a && other.apply(ctx); } }; }