ASM doesn't like empty generics for some reason, don't know if valid?
This commit is contained in:
parent
a0c25a517d
commit
d945947362
@ -1044,11 +1044,14 @@ public class Codegen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static String generateSignature(TargetClass clazz, Set<TargetGeneric> generics) {
|
private static String generateSignature(TargetClass clazz, Set<TargetGeneric> generics) {
|
||||||
String ret = "<";
|
String ret = "";
|
||||||
for (var generic : generics) {
|
if (generics.size() > 0) {
|
||||||
ret += generic.name() + ":" + generic.bound().toDescriptor();
|
ret += "<";
|
||||||
|
for (var generic : generics) {
|
||||||
|
ret += generic.name() + ":" + generic.bound().toDescriptor();
|
||||||
|
}
|
||||||
|
ret += ">";
|
||||||
}
|
}
|
||||||
ret += ">";
|
|
||||||
ret += clazz.superType().toDescriptor();
|
ret += clazz.superType().toDescriptor();
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -48,7 +48,6 @@ public class ASTFactory {
|
|||||||
if (classLoader != null) {
|
if (classLoader != null) {
|
||||||
var bytes = IOUtils.toByteArray(Objects.requireNonNull(classLoader.getResourceAsStream(path)));
|
var bytes = IOUtils.toByteArray(Objects.requireNonNull(classLoader.getResourceAsStream(path)));
|
||||||
var classReader = new ClassReader(bytes);
|
var classReader = new ClassReader(bytes);
|
||||||
|
|
||||||
var classVisitor = new ClassVisitor(Opcodes.ASM7) {
|
var classVisitor = new ClassVisitor(Opcodes.ASM7) {
|
||||||
String classSignature;
|
String classSignature;
|
||||||
@Override
|
@Override
|
||||||
@ -300,7 +299,6 @@ public class ASTFactory {
|
|||||||
var sr = new SignatureReader(signature);
|
var sr = new SignatureReader(signature);
|
||||||
sr.accept(signatureVisitor);
|
sr.accept(signatureVisitor);
|
||||||
|
|
||||||
System.out.println(signature);
|
|
||||||
return new GenericDeclarationList(gtvs, new NullToken());
|
return new GenericDeclarationList(gtvs, new NullToken());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,11 +22,15 @@ public record TargetMethod(int access, String name, TargetBlock block, Signature
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static String getSignature(Set<TargetGeneric> generics, List<MethodParameter> parameters, TargetType returnType) {
|
public static String getSignature(Set<TargetGeneric> generics, List<MethodParameter> parameters, TargetType returnType) {
|
||||||
String ret = "<";
|
String ret = "";
|
||||||
for (var generic : generics) {
|
if (generics.size() > 0) {
|
||||||
ret += generic.name() + ":" + generic.bound().toDescriptor();
|
ret += "<";
|
||||||
|
for (var generic : generics) {
|
||||||
|
ret += generic.name() + ":" + generic.bound().toDescriptor();
|
||||||
|
}
|
||||||
|
ret += ">";
|
||||||
}
|
}
|
||||||
ret += ">(";
|
ret += "(";
|
||||||
for (var param : parameters) {
|
for (var param : parameters) {
|
||||||
ret += param.type().toDescriptor();
|
ret += param.type().toDescriptor();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user