Avoid recursion in ClassFileAnnotationMetadata.resolveTypeName()

See gh-36577
This commit is contained in:
Sam Brannen
2026-04-08 11:07:15 +02:00
parent f3b6c222f9
commit d4cc273c31
@@ -226,10 +226,11 @@ final class ClassFileAnnotationMetadata implements AnnotationMetadata {
if (type.isPrimitive()) {
return type.displayName();
}
if (type.isArray()) {
return resolveTypeName(type.componentType()) + "[]";
ClassDesc effectiveType = type;
while (effectiveType.isArray()) {
effectiveType = effectiveType.componentType();
}
String packageName = type.packageName();
String packageName = effectiveType.packageName();
return (packageName.isEmpty() ? type.displayName() : packageName + "." + type.displayName());
}