Polishing.

Add missing `@FunctionalInterface` to Specification interfaces.
`SpecificationUnitTests` shouldn't be `Serializable`.

Closes #3452
This commit is contained in:
Yanming Zhou
2024-04-28 09:36:37 +08:00
committed by Mark Paluch
parent 3cb7e909cb
commit e90f2fea91
2 changed files with 3 additions and 2 deletions

View File

@@ -40,6 +40,7 @@ import org.springframework.util.Assert;
* @author Mark Paluch
* @since 4.0
*/
@FunctionalInterface
public interface PredicateSpecification<T> extends Serializable {
/**

View File

@@ -88,7 +88,7 @@ class SpecificationUnitTests {
assertThat(specification).isNotNull();
@SuppressWarnings({ "unchecked", "deprecation" })
@SuppressWarnings({ "unchecked", "deprecation"})
Specification<Object> transferredSpecification = (Specification<Object>) deserialize(serialize(specification));
assertThat(transferredSpecification).isNotNull();
@@ -103,7 +103,7 @@ class SpecificationUnitTests {
assertThat(specification).isNotNull();
@SuppressWarnings({ "unchecked", "deprecation" })
@SuppressWarnings({ "unchecked", "deprecation"})
Specification<Object> transferredSpecification = (Specification<Object>) deserialize(serialize(specification));
assertThat(transferredSpecification).isNotNull();