Fix typo in ClassUtils.forName()

See gh-31258
Closes gh-31428
This commit is contained in:
Johnny Lim
2023-10-14 17:45:33 +09:00
committed by Brian Clozel
parent 39400901cd
commit 15f7e8ef2f
3 changed files with 32 additions and 1 deletions

View File

@@ -306,7 +306,7 @@ public abstract class ClassUtils {
catch (ClassNotFoundException ex) {
int lastDotIndex = name.lastIndexOf(PACKAGE_SEPARATOR);
int previousDotIndex = name.lastIndexOf(PACKAGE_SEPARATOR, lastDotIndex -1);
if (lastDotIndex != -1 && previousDotIndex != 1 && Character.isUpperCase(name.charAt(previousDotIndex + 1))) {
if (lastDotIndex != -1 && previousDotIndex != -1 && Character.isUpperCase(name.charAt(previousDotIndex + 1))) {
String nestedClassName =
name.substring(0, lastDotIndex) + NESTED_CLASS_SEPARATOR + name.substring(lastDotIndex + 1);
try {