Skip to content

Commit 15d3cde

Browse files
mp911dechristophstrobl
authored andcommitted
Polishing.
Revise nullability requirements around non-nullable specifications. Original Pull Request: #3578
1 parent 31f2900 commit 15d3cde

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/SimpleJpaRepository.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,9 @@ protected Page<T> readPage(TypedQuery<T> query, Pageable pageable, Specification
720720
*/
721721
@Contract("_, _, _, null -> fail")
722722
protected <S extends T> Page<S> readPage(TypedQuery<S> query, Class<S> domainClass, Pageable pageable,
723-
@Nullable Specification<S> spec) {
723+
Specification<S> spec) {
724+
725+
Assert.notNull(spec, "Specification must not be null");
724726

725727
Assert.notNull(spec, "Specification must not be null");
726728

@@ -739,7 +741,7 @@ protected <S extends T> Page<S> readPage(TypedQuery<S> query, Class<S> domainCla
739741
* @param spec must not be {@literal null}.
740742
* @param pageable must not be {@literal null}.
741743
*/
742-
protected TypedQuery<T> getQuery(@Nullable Specification<T> spec, Pageable pageable) {
744+
protected TypedQuery<T> getQuery(Specification<T> spec, Pageable pageable) {
743745
return getQuery(spec, getDomainClass(), pageable.getSort());
744746
}
745747

0 commit comments

Comments
 (0)