Migrate code to Java 17 style.

Use var instead of explicit local types where applicable. Use pattern variable instead instanceof and cast. Prefer loops and nullable types over Stream and Optional. Convert classes to records where applicable.

See #2465
This commit is contained in:
Mark Paluch
2021-10-05 15:21:12 +02:00
committed by Jens Schauder
parent d4036ec0a9
commit c735b58607
463 changed files with 3670 additions and 4014 deletions

View File

@@ -17,9 +17,8 @@ package org.springframework.data.annotation;
import static org.assertj.core.api.Assertions.*;
import java.util.Set;
import org.junit.jupiter.api.Test;
import org.springframework.data.util.AnnotatedTypeScanner;
/**
@@ -33,8 +32,8 @@ class TypeAliasUnitTests {
@SuppressWarnings("unchecked")
void scanningforAtPersistentFindsTypeAliasAnnotatedTypes() {
AnnotatedTypeScanner scanner = new AnnotatedTypeScanner(Persistent.class);
Set<Class<?>> types = scanner.findTypes(getClass().getPackage().getName());
var scanner = new AnnotatedTypeScanner(Persistent.class);
var types = scanner.findTypes(getClass().getPackage().getName());
assertThat(types).containsExactlyInAnyOrder(SampleType.class, TypeAlias.class);
}