fix: stackoverflowerror (infinite recursion)

This commit is contained in:
zaaarf 2023-03-27 22:49:47 +02:00
parent ab7fbd3f6e
commit 5b4b63021e
No known key found for this signature in database
GPG key ID: 82240E075E31FA4C

View file

@ -42,7 +42,7 @@ public class TypeProxy extends QualifiableProxy {
* @param containerClass the FQN of the parent class of the class
*/
protected TypeProxy(String name, String descriptor, int modifiers, QualifiableProxy containerClass, boolean primitive) {
super(descriptor, modifiers, containerClass, String.format("%s$%s", name, containerClass.fullyQualifiedName), ProxyType.TYPE);
super(descriptor, modifiers, containerClass, String.format("%s$%s", containerClass.fullyQualifiedName, name), ProxyType.TYPE);
this.primitive = primitive;
}
@ -59,8 +59,8 @@ public class TypeProxy extends QualifiableProxy {
String fqn = primitive ? type.getClassName() : type.getInternalName().replace('/', '.');
String simpleName = extractSimpleNameFromFQN(fqn);
String parent = extractParentFromFQN(fqn);
if(fqn.contains("$"))
return new TypeProxy(simpleName, type.getDescriptor(), modifiers, from(type, Modifier.PUBLIC), primitive);
if(fqn.contains("$") && parent != null)
return new TypeProxy(simpleName, type.getDescriptor(), modifiers, from(parent, 0, Modifier.PUBLIC), primitive);
else return new TypeProxy(simpleName, type.getDescriptor(), modifiers, parent, primitive);
}