Update ref docs for Inner class names

This commit updates the reference manual to point out that one may use
`.` instead of `$` as the nested class separator when providing a fully
qualified class name for a nested class in XML configuration.

This commit also updates the test for ClassUtils#forName to assert
support for `.` instead of `$`.

Closes gh-26540
This commit is contained in:
Oleksandr Kravchuk
2021-02-11 19:09:50 +02:00
committed by Sam Brannen
parent 1c6bab23ea
commit 77b7e49fb2
3 changed files with 10 additions and 7 deletions

View File

@@ -75,4 +75,7 @@ public class TestObject implements ITestObject, ITestInterface, Comparable<Objec
return 1;
}
}
public static class NestedObject {
}
}

View File

@@ -86,6 +86,8 @@ class ClassUtilsTests {
assertThat(ClassUtils.forName("org.springframework.tests.sample.objects.TestObject[][]", classLoader)).isEqualTo(TestObject[][].class);
assertThat(ClassUtils.forName(TestObject[][].class.getName(), classLoader)).isEqualTo(TestObject[][].class);
assertThat(ClassUtils.forName("[[[S", classLoader)).isEqualTo(short[][][].class);
assertThat(ClassUtils.forName("org.springframework.tests.sample.objects.TestObject$NestedObject", classLoader)).isEqualTo(TestObject.NestedObject.class);
assertThat(ClassUtils.forName("org.springframework.tests.sample.objects.TestObject.NestedObject", classLoader)).isEqualTo(TestObject.NestedObject.class);
}
@Test