Skip to content

Commit 241a466

Browse files
quaffmp911de
authored andcommitted
Polishing.
Add missing `@FunctionalInterface` to Specification interfaces. `SpecificationUnitTests` shouldn't be `Serializable`. Closes #3452
1 parent 6c7509f commit 241a466

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

spring-data-jpa/src/main/java/org/springframework/data/jpa/domain/PredicateSpecification.java

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
* @author Mark Paluch
4141
* @since 4.0
4242
*/
43+
@FunctionalInterface
4344
public interface PredicateSpecification<T> extends Serializable {
4445

4546
/**

spring-data-jpa/src/test/java/org/springframework/data/jpa/domain/SpecificationUnitTests.java

+3-4
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,9 @@
4444
* @author Mark Paluch
4545
* @author Daniel Shuy
4646
*/
47-
@SuppressWarnings("serial")
4847
@ExtendWith(MockitoExtension.class)
4948
@MockitoSettings(strictness = Strictness.LENIENT)
50-
class SpecificationUnitTests implements Serializable {
49+
class SpecificationUnitTests {
5150

5251
private Specification<Object> spec;
5352
@Mock(serializable = true) Root<Object> root;
@@ -88,7 +87,7 @@ void specificationsShouldBeSerializable() {
8887

8988
assertThat(specification).isNotNull();
9089

91-
@SuppressWarnings("unchecked")
90+
@SuppressWarnings({"unchecked", "deprecation"})
9291
Specification<Object> transferredSpecification = (Specification<Object>) deserialize(serialize(specification));
9392

9493
assertThat(transferredSpecification).isNotNull();
@@ -103,7 +102,7 @@ void complexSpecificationsShouldBeSerializable() {
103102

104103
assertThat(specification).isNotNull();
105104

106-
@SuppressWarnings("unchecked")
105+
@SuppressWarnings({"unchecked", "deprecation"})
107106
Specification<Object> transferredSpecification = (Specification<Object>) deserialize(serialize(specification));
108107

109108
assertThat(transferredSpecification).isNotNull();

0 commit comments

Comments
 (0)