From 5e77a08b30f199073d657095e40727b1baa103a1 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Wed, 8 Mar 2017 08:43:51 +0100 Subject: [PATCH] DATAMONGO-1421 - Polishing. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove trailing whitespaces. Construct exception message with String.format(…). Original pull request: #448. --- .../org/springframework/data/mongodb/core/query/Query.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/Query.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/Query.java index 7db5b3f7c..19277748d 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/Query.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/Query.java @@ -95,8 +95,8 @@ public class Query { this.criteria.put(key, criteriaDefinition); } else { throw new InvalidMongoDbApiUsageException( - "Due to limitations of the com.mongodb.BasicDBObject, " + "you can't add a second '" + key + "' criteria. " - + "Query already contains '" + serializeToJsonSafely(existing.getCriteriaObject()) + "'."); + String.format("Due to limitations of the com.mongodb.BasicDBObject, you can't add a second '%s' criteria. " + + "Query already contains '%s'", key, serializeToJsonSafely(existing.getCriteriaObject()))); } return this;