Skip to content

Commit 1bbc564

Browse files
committed
Polishing
1 parent 04dde03 commit 1bbc564

File tree

7 files changed

+24
-17
lines changed

7 files changed

+24
-17
lines changed

spring-core/src/main/java/org/springframework/aot/hint/ProxyHintsPredicates.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
/**
2525
* Generator of {@link ProxyHints} predicates, testing whether the given hints
2626
* match the expected behavior for proxies.
27+
*
2728
* @author Brian Clozel
2829
* @since 6.0
2930
*/

spring-core/src/main/java/org/springframework/aot/hint/ReflectionHintsPredicates.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
/**
3535
* Generator of {@link ReflectionHints} predicates, testing whether the given hints
3636
* match the expected behavior for reflection.
37+
*
3738
* @author Brian Clozel
3839
* @since 6.0
3940
*/
@@ -265,6 +266,7 @@ public static class ConstructorHintPredicate extends ExecutableHintPredicate<Con
265266
super(constructor);
266267
}
267268

269+
@Override
268270
MemberCategory[] getPublicMemberCategories() {
269271
if (this.executableMode == ExecutableMode.INTROSPECT) {
270272
return new MemberCategory[] {MemberCategory.INTROSPECT_PUBLIC_CONSTRUCTORS,
@@ -273,6 +275,7 @@ MemberCategory[] getPublicMemberCategories() {
273275
return new MemberCategory[] {MemberCategory.INVOKE_PUBLIC_CONSTRUCTORS};
274276
}
275277

278+
@Override
276279
MemberCategory[] getDeclaredMemberCategories() {
277280
if (this.executableMode == ExecutableMode.INTROSPECT) {
278281
return new MemberCategory[] {MemberCategory.INTROSPECT_DECLARED_CONSTRUCTORS,
@@ -299,6 +302,7 @@ public static class MethodHintPredicate extends ExecutableHintPredicate<Method>
299302
super(method);
300303
}
301304

305+
@Override
302306
MemberCategory[] getPublicMemberCategories() {
303307
if (this.executableMode == ExecutableMode.INTROSPECT) {
304308
return new MemberCategory[] {MemberCategory.INTROSPECT_PUBLIC_METHODS,
@@ -307,6 +311,7 @@ MemberCategory[] getPublicMemberCategories() {
307311
return new MemberCategory[] {MemberCategory.INVOKE_PUBLIC_METHODS};
308312
}
309313

314+
@Override
310315
MemberCategory[] getDeclaredMemberCategories() {
311316

312317
if (this.executableMode == ExecutableMode.INTROSPECT) {

spring-core/src/main/java/org/springframework/aot/hint/ReflectionTypeReference.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
* A {@link TypeReference} based on a {@link Class}.
2323
*
2424
* @author Stephane Nicoll
25+
* @since 6.0
2526
*/
2627
final class ReflectionTypeReference extends AbstractTypeReference {
2728

spring-core/src/main/java/org/springframework/aot/hint/ResourceHintsPredicates.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
/**
2626
* Generator of {@link ResourceHints} predicates, testing whether the given hints
2727
* match the expected behavior for resources.
28+
*
2829
* @author Brian Clozel
2930
* @since 6.0
3031
*/

spring-core/src/main/java/org/springframework/aot/hint/RuntimeHintsPredicates.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,16 @@
1818

1919
/**
2020
* Static generator of predicates that test whether the given {@link RuntimeHints}
21-
* instance matches the expected behavior for reflection, resource or proxy generation.
21+
* instance matches the expected behavior for reflection, resource, or proxy generation.
22+
*
2223
* <p>This utility class can be used by {@link RuntimeHintsRegistrar} to conditionally
2324
* register hints depending on what's present already. This can also be used as a
2425
* testing utility for checking proper registration of hints:
2526
* <pre class="code">
2627
* Predicate&lt;RuntimeHints&gt; predicate = RuntimeHintsPredicates.reflection().onMethod(MyClass.class, "someMethod").invoke();
2728
* assertThat(predicate).accepts(runtimeHints);
2829
* </pre>
30+
*
2931
* @author Brian Clozel
3032
* @since 6.0
3133
*/
@@ -39,7 +41,6 @@ public abstract class RuntimeHintsPredicates {
3941

4042

4143
private RuntimeHintsPredicates() {
42-
4344
}
4445

4546
/**

spring-core/src/main/java/org/springframework/aot/hint/SimpleTypeReference.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
* A {@link TypeReference} based on fully qualified name.
2828
*
2929
* @author Stephane Nicoll
30+
* @since 6.0
3031
*/
3132
final class SimpleTypeReference extends AbstractTypeReference {
3233

spring-core/src/test/java/org/springframework/aot/hint/ReflectionTypeReferenceTests.java

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import org.junit.jupiter.params.provider.MethodSource;
2424

2525
import static org.assertj.core.api.Assertions.assertThat;
26+
import static org.junit.jupiter.params.provider.Arguments.arguments;
2627

2728
/**
2829
* Tests for {@link ReflectionTypeReference}.
@@ -34,28 +35,24 @@ class ReflectionTypeReferenceTests {
3435

3536
@ParameterizedTest
3637
@MethodSource("reflectionTargetNames")
37-
void typeReferenceFromClasHasSuitableReflectionTargetName(TypeReference typeReference, String binaryName) {
38-
assertThat(typeReference.getName()).isEqualTo(binaryName);
38+
void typeReferenceFromClassHasSuitableReflectionTargetName(Class<?> clazz, String binaryName) {
39+
assertThat(ReflectionTypeReference.of(clazz).getName()).isEqualTo(binaryName);
3940
}
4041

4142
static Stream<Arguments> reflectionTargetNames() {
4243
return Stream.of(
43-
Arguments.of(ReflectionTypeReference.of(int.class), "int"),
44-
Arguments.of(ReflectionTypeReference.of(int[].class), "int[]"),
45-
Arguments.of(ReflectionTypeReference.of(Integer[].class), "java.lang.Integer[]"),
46-
Arguments.of(ReflectionTypeReference.of(Object[].class), "java.lang.Object[]"),
47-
Arguments.of(ReflectionTypeReference.of(StaticInner.class),
48-
"org.springframework.aot.hint.ReflectionTypeReferenceTests$StaticInner"),
49-
Arguments.of(ReflectionTypeReference.of(StaticInner[].class),
50-
"org.springframework.aot.hint.ReflectionTypeReferenceTests$StaticInner[]"),
51-
Arguments.of(ReflectionTypeReference.of(Inner.class),
52-
"org.springframework.aot.hint.ReflectionTypeReferenceTests$Inner"),
53-
Arguments.of(ReflectionTypeReference.of(Inner[].class),
54-
"org.springframework.aot.hint.ReflectionTypeReferenceTests$Inner[]")
44+
arguments(int.class, "int"),
45+
arguments(int[].class, "int[]"),
46+
arguments(Integer[].class, "java.lang.Integer[]"),
47+
arguments(Object[].class, "java.lang.Object[]"),
48+
arguments(StaticNested.class, "org.springframework.aot.hint.ReflectionTypeReferenceTests$StaticNested"),
49+
arguments(StaticNested[].class, "org.springframework.aot.hint.ReflectionTypeReferenceTests$StaticNested[]"),
50+
arguments(Inner.class, "org.springframework.aot.hint.ReflectionTypeReferenceTests$Inner"),
51+
arguments(Inner[].class, "org.springframework.aot.hint.ReflectionTypeReferenceTests$Inner[]")
5552
);
5653
}
5754

58-
static class StaticInner {
55+
static class StaticNested {
5956
}
6057

6158
class Inner {

0 commit comments

Comments
 (0)