From 4d247421813b435993fbfcb23dcfdb3f2ab4bcb1 Mon Sep 17 00:00:00 2001 From: Thomas Darimont Date: Tue, 10 Mar 2015 10:02:18 +0100 Subject: [PATCH] DATAMONGO-1180 - Fixed incorrect exception message creation in PartTreeMongoQuery. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The JSONParseException caught in PartTreeMongoQuery is now passed to the IllegalStateException we throw from the method. Previously it was passed to the String.format(…) varargs. Verified by manually throwing a JSONParseException in the debugger. Original pull request: #280. Related pull request: #259. --- .../data/mongodb/repository/query/PartTreeMongoQuery.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/PartTreeMongoQuery.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/PartTreeMongoQuery.java index b8a34f118..35dfe7de5 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/PartTreeMongoQuery.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/PartTreeMongoQuery.java @@ -86,8 +86,8 @@ public class PartTreeMongoQuery extends AbstractMongoQuery { return result; } catch (JSONParseException o_O) { - throw new IllegalStateException(String.format("Invalid query or field specification in %s!", getQueryMethod(), - o_O)); + throw new IllegalStateException(String.format("Invalid query or field specification in %s!", getQueryMethod()), + o_O); } }