DATAMONGO-305 - Removed synchronization from Query class.

As Query is not intended to be thread-safe at all, we can safely remove the synchronized blocks from sort() and fields().
This commit is contained in:
Oliver Gierke
2011-11-23 12:48:39 +01:00
parent f156d7b5af
commit b26bb62a63

View File

@@ -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;
}