Fix enclosing class in TypeReference for inner type arrays

See gh-28664
This commit is contained in:
Moritz Halbritter
2022-06-20 15:37:17 +02:00
committed by Stephane Nicoll
parent 4cb9e65353
commit c34de54d8a
2 changed files with 24 additions and 3 deletions

View File

@@ -28,6 +28,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* Tests for {@link ReflectionTypeReference}.
*
* @author Stephane Nicoll
* @author Moritz Halbritter
*/
class ReflectionTypeReferenceTests {
@@ -38,10 +39,22 @@ class ReflectionTypeReferenceTests {
}
static Stream<Arguments> reflectionTargetNames() {
return Stream.of(Arguments.of(ReflectionTypeReference.of(int.class), "int"),
return Stream.of(
Arguments.of(ReflectionTypeReference.of(int.class), "int"),
Arguments.of(ReflectionTypeReference.of(int[].class), "int[]"),
Arguments.of(ReflectionTypeReference.of(Integer[].class), "java.lang.Integer[]"),
Arguments.of(ReflectionTypeReference.of(Object[].class), "java.lang.Object[]"));
Arguments.of(ReflectionTypeReference.of(Object[].class), "java.lang.Object[]"),
Arguments.of(ReflectionTypeReference.of(StaticInner.class), "org.springframework.aot.hint.ReflectionTypeReferenceTests$StaticInner"),
Arguments.of(ReflectionTypeReference.of(StaticInner[].class), "org.springframework.aot.hint.ReflectionTypeReferenceTests$StaticInner[]"),
Arguments.of(ReflectionTypeReference.of(Inner.class), "org.springframework.aot.hint.ReflectionTypeReferenceTests$Inner"),
Arguments.of(ReflectionTypeReference.of(Inner[].class), "org.springframework.aot.hint.ReflectionTypeReferenceTests$Inner[]")
);
}
static class StaticInner {
}
class Inner {
}
}