Use modern language features in tests

This commit is contained in:
Sam Brannen
2022-02-03 15:35:32 +01:00
parent 32cd73261a
commit b3f786728e
58 changed files with 117 additions and 151 deletions

View File

@@ -85,8 +85,8 @@ public class GenericConversionService implements ConfigurableConversionService {
@Override
public void addConverter(Converter<?, ?> converter) {
ResolvableType[] typeInfo = getRequiredTypeInfo(converter.getClass(), Converter.class);
if (typeInfo == null && converter instanceof DecoratingProxy) {
typeInfo = getRequiredTypeInfo(((DecoratingProxy) converter).getDecoratedClass(), Converter.class);
if (typeInfo == null && converter instanceof DecoratingProxy decoratingProxy) {
typeInfo = getRequiredTypeInfo(decoratingProxy.getDecoratedClass(), Converter.class);
}
if (typeInfo == null) {
throw new IllegalArgumentException("Unable to determine source type <S> and target type <T> for your " +

View File

@@ -85,8 +85,8 @@ final class SimpleAnnotationMetadataReadingVisitor extends ClassVisitor {
if (supername != null && !isInterface(access)) {
this.superClassName = toClassName(supername);
}
for (int i = 0; i < interfaces.length; i++) {
this.interfaceNames.add(toClassName(interfaces[i]));
for (String element : interfaces) {
this.interfaceNames.add(toClassName(element));
}
}