From 34d6dd9b6278fdb32be31dc656c1196ce43d91a8 Mon Sep 17 00:00:00 2001 From: Sam Brannen <104798+sbrannen@users.noreply.github.com> Date: Mon, 27 Jan 2025 13:46:20 +0100 Subject: [PATCH] Polishing --- .../validation/DataBinderConstructTests.java | 4 ++-- .../RegisterReflectionReflectiveProcessorTests.java | 5 +---- .../springframework/core/BridgeMethodResolverTests.java | 7 +++++-- .../convert/support/GenericConversionServiceTests.java | 6 ++++-- .../web/bind/support/WebExchangeDataBinderTests.java | 5 +++-- 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/spring-context/src/test/java/org/springframework/validation/DataBinderConstructTests.java b/spring-context/src/test/java/org/springframework/validation/DataBinderConstructTests.java index c4ee77a6f901..ccdd1f6b5302 100644 --- a/spring-context/src/test/java/org/springframework/validation/DataBinderConstructTests.java +++ b/spring-context/src/test/java/org/springframework/validation/DataBinderConstructTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2024 the original author or authors. + * Copyright 2002-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -225,7 +225,7 @@ public int param3() { } - private static class NestedDataClass { + static class NestedDataClass { private final String param1; diff --git a/spring-core/src/test/java/org/springframework/aot/hint/annotation/RegisterReflectionReflectiveProcessorTests.java b/spring-core/src/test/java/org/springframework/aot/hint/annotation/RegisterReflectionReflectiveProcessorTests.java index ba230f335f7f..26f9e7f0daf3 100644 --- a/spring-core/src/test/java/org/springframework/aot/hint/annotation/RegisterReflectionReflectiveProcessorTests.java +++ b/spring-core/src/test/java/org/springframework/aot/hint/annotation/RegisterReflectionReflectiveProcessorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2024 the original author or authors. + * Copyright 2002-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -180,10 +180,7 @@ public void setDescription(String description) { @RegisterReflection(memberCategories = MemberCategory.INVOKE_DECLARED_CONSTRUCTORS) static class AnnotatedSimplePojo { - private String test; - AnnotatedSimplePojo(String test) { - this.test = test; } } diff --git a/spring-core/src/test/java/org/springframework/core/BridgeMethodResolverTests.java b/spring-core/src/test/java/org/springframework/core/BridgeMethodResolverTests.java index 06dfcf404541..6f909c9fea47 100644 --- a/spring-core/src/test/java/org/springframework/core/BridgeMethodResolverTests.java +++ b/spring-core/src/test/java/org/springframework/core/BridgeMethodResolverTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2024 the original author or authors. + * Copyright 2002-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -405,7 +405,10 @@ void someMethod(T theArg, Object otherArg) { } - public abstract static class SubBar extends InterBar { + public abstract static class SubBar extends InterBar { + } + + public interface StringProducer extends CharSequence { } diff --git a/spring-core/src/test/java/org/springframework/core/convert/support/GenericConversionServiceTests.java b/spring-core/src/test/java/org/springframework/core/convert/support/GenericConversionServiceTests.java index 818bd021b9dc..b5155635dc28 100644 --- a/spring-core/src/test/java/org/springframework/core/convert/support/GenericConversionServiceTests.java +++ b/spring-core/src/test/java/org/springframework/core/convert/support/GenericConversionServiceTests.java @@ -570,12 +570,12 @@ void stringListToListOfSubclassOfUnboundGenericClass() { conversionService.addConverter(new StringListToAListConverter()); conversionService.addConverter(new StringListToBListConverter()); - List aList = (List) conversionService.convert(List.of("foo"), + List aList = (List) conversionService.convert(List.of("foo"), TypeDescriptor.collection(List.class, TypeDescriptor.valueOf(String.class)), TypeDescriptor.collection(List.class, TypeDescriptor.valueOf(ARaw.class))); assertThat(aList).allMatch(e -> e instanceof ARaw); - List bList = (List) conversionService.convert(List.of("foo"), + List bList = (List) conversionService.convert(List.of("foo"), TypeDescriptor.collection(List.class, TypeDescriptor.valueOf(String.class)), TypeDescriptor.collection(List.class, TypeDescriptor.valueOf(BRaw.class))); assertThat(bList).allMatch(e -> e instanceof BRaw); @@ -945,9 +945,11 @@ public Color convert(String source) { private static class GenericBaseClass { } + @SuppressWarnings("rawtypes") private static class ARaw extends GenericBaseClass { } + @SuppressWarnings("rawtypes") private static class BRaw extends GenericBaseClass { } diff --git a/spring-web/src/test/java/org/springframework/web/bind/support/WebExchangeDataBinderTests.java b/spring-web/src/test/java/org/springframework/web/bind/support/WebExchangeDataBinderTests.java index 049d4a59cb19..6bf41469e60e 100644 --- a/spring-web/src/test/java/org/springframework/web/bind/support/WebExchangeDataBinderTests.java +++ b/spring-web/src/test/java/org/springframework/web/bind/support/WebExchangeDataBinderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2024 the original author or authors. + * Copyright 2002-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -330,7 +330,7 @@ public void setSomePartList(List somePartList) { } - private static class MultipartDataClass { + static class MultipartDataClass { private final FilePart part; @@ -351,4 +351,5 @@ public FilePart getNullablePart() { return nullablePart; } } + }