diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/QuerydslMongoPredicateExecutor.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/QuerydslMongoPredicateExecutor.java old mode 100644 new mode 100755 index 4e3a7608d5..3b8b7e213a --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/QuerydslMongoPredicateExecutor.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/QuerydslMongoPredicateExecutor.java @@ -96,9 +96,6 @@ public QuerydslMongoPredicateExecutor(MongoEntityInformation entityInforma */ @Override public Optional findOne(Predicate predicate) { - - Assert.notNull(predicate, "Predicate must not be null!"); - try { return Optional.ofNullable(createQueryFor(predicate).fetchOne()); } catch (NonUniqueResultException ex) { @@ -112,9 +109,6 @@ public Optional findOne(Predicate predicate) { */ @Override public List findAll(Predicate predicate) { - - Assert.notNull(predicate, "Predicate must not be null!"); - return createQueryFor(predicate).fetchResults().getResults(); } @@ -125,7 +119,6 @@ public List findAll(Predicate predicate) { @Override public List findAll(Predicate predicate, OrderSpecifier... orders) { - Assert.notNull(predicate, "Predicate must not be null!"); Assert.notNull(orders, "Order specifiers must not be null!"); return createQueryFor(predicate).orderBy(orders).fetchResults().getResults(); @@ -138,7 +131,6 @@ public List findAll(Predicate predicate, OrderSpecifier... orders) { @Override public List findAll(Predicate predicate, Sort sort) { - Assert.notNull(predicate, "Predicate must not be null!"); Assert.notNull(sort, "Sort must not be null!"); return applySorting(createQueryFor(predicate), sort).fetchResults().getResults(); @@ -163,7 +155,6 @@ public Iterable findAll(OrderSpecifier... orders) { @Override public Page findAll(Predicate predicate, Pageable pageable) { - Assert.notNull(predicate, "Predicate must not be null!"); Assert.notNull(pageable, "Pageable must not be null!"); AbstractMongodbQuery> query = createQueryFor(predicate); @@ -178,9 +169,6 @@ public Page findAll(Predicate predicate, Pageable pageable) { */ @Override public long count(Predicate predicate) { - - Assert.notNull(predicate, "Predicate must not be null!"); - return createQueryFor(predicate).fetchCount(); } @@ -190,9 +178,6 @@ public long count(Predicate predicate) { */ @Override public boolean exists(Predicate predicate) { - - Assert.notNull(predicate, "Predicate must not be null!"); - return createQueryFor(predicate).fetchCount() > 0; }