diff --git a/json-path-assert/src/main/java/com/jayway/jsonassert/impl/JsonAsserterImpl.java b/json-path-assert/src/main/java/com/jayway/jsonassert/impl/JsonAsserterImpl.java index 661310b8..8f4bb3e7 100644 --- a/json-path-assert/src/main/java/com/jayway/jsonassert/impl/JsonAsserterImpl.java +++ b/json-path-assert/src/main/java/com/jayway/jsonassert/impl/JsonAsserterImpl.java @@ -33,7 +33,7 @@ public class JsonAsserterImpl implements JsonAsserter { try { obj = JsonPath.read(jsonObject, path); } catch (Exception e) { - throw new AssertionError(String.format("Error reading JSON path [%s]", path), e); + throw new AssertionError(String.format("Error reading JSON path [%s]: %s", path, e)); } if (!matcher.matches(obj)) { diff --git a/json-path/src/main/java/com/jayway/jsonpath/internal/PathRef.java b/json-path/src/main/java/com/jayway/jsonpath/internal/PathRef.java index 391fb8a1..b5192869 100644 --- a/json-path/src/main/java/com/jayway/jsonpath/internal/PathRef.java +++ b/json-path/src/main/java/com/jayway/jsonpath/internal/PathRef.java @@ -154,7 +154,7 @@ public abstract class PathRef implements Comparable { public int compareTo(PathRef o) { if(o instanceof ArrayIndexPathRef){ ArrayIndexPathRef pf = (ArrayIndexPathRef) o; - return Integer.compare(pf.index, this.index); + return Integer.valueOf(pf.index).compareTo(this.index); } return super.compareTo(o); }