@@ -65,33 +65,35 @@ static <T> Specification<T> unrestricted() {
6565	}
6666
6767	/** 
68- 	 * Simple static factory method to add some syntactic sugar translating {@link PredicateSpecification} to 
69- 	 * {@link Specification}. 
68+ 	 * Simple static factory method to add some syntactic sugar around a {@link Specification}. 
7069	 * 
70+ 	 * @implNote does not accept {@literal null} values since 4.0, use {@link #unrestricted()} instead of passing 
71+ 	 *           {@literal null} values. 
7172	 * @param <T> the type of the {@link Root} the resulting {@literal Specification} operates on. 
72- 	 * @param spec the {@link PredicateSpecification} to wrap . 
73+ 	 * @param spec can be {@literal null} . 
7374	 * @return guaranteed to be not {@literal null}. 
75+ 	 * @since 2.0 
7476	 */ 
75- 	static  <T > Specification <T > where (PredicateSpecification <T > spec ) {
77+ 	static  <T > Specification <T > where (Specification <T > spec ) {
7678
77- 		Assert .notNull (spec , "PredicateSpecification  must not be null" );
79+ 		Assert .notNull (spec , "Specification  must not be null" );
7880
79- 		return  ( root ,  update ,  criteriaBuilder ) ->  spec . toPredicate ( root ,  criteriaBuilder ) ;
81+ 		return  spec ;
8082	}
8183
8284	/** 
83- 	 * Creates a {@link Specification} from the given {@link Specification}. This is a factory method for fluent composition. 
85+ 	 * Simple static factory method to add some syntactic sugar translating {@link PredicateSpecification} to 
86+ 	 * {@link Specification}. 
8487	 * 
8588	 * @param <T> the type of the {@link Root} the resulting {@literal Specification} operates on. 
86- 	 * @param spec must not be {@literal null}. 
87- 	 * @return the given specification. 
88- 	 * @since 4.1 
89+ 	 * @param spec the {@link PredicateSpecification} to wrap. 
90+ 	 * @return guaranteed to be not {@literal null}. 
8991	 */ 
90- 	static  <T > Specification <T > where (Specification <T > spec ) {
92+ 	static  <T > Specification <T > where (PredicateSpecification <T > spec ) {
9193
92- 		Assert .notNull (spec , "Specification  must not be null" );
94+ 		Assert .notNull (spec , "PredicateSpecification  must not be null" );
9395
94- 		return  spec ;
96+ 		return  ( root ,  update ,  criteriaBuilder ) ->  spec . toPredicate ( root ,  criteriaBuilder ) ;
9597	}
9698
9799	/** 
0 commit comments