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 60926f918..104abde43 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 @@ -63,10 +63,8 @@ public class Query { } public Field fields() { - synchronized (this) { - if (fieldSpec == null) { - this.fieldSpec = new Field(); - } + if (fieldSpec == null) { + this.fieldSpec = new Field(); } return this.fieldSpec; } @@ -82,11 +80,10 @@ public class Query { } public Sort sort() { - synchronized (this) { - if (this.sort == null) { - this.sort = new Sort(); - } + if (this.sort == null) { + this.sort = new Sort(); } + return this.sort; }