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) {
|
||||
String ret = "<";
|
||||
String ret = "";
|
||||
if (generics.size() > 0) {
|
||||
ret += "<";
|
||||
for (var generic : generics) {
|
||||
ret += generic.name() + ":" + generic.bound().toDescriptor();
|
||||
}
|
||||
ret += ">";
|
||||
}
|
||||
ret += clazz.superType().toDescriptor();
|
||||
|
||||
return ret;
|
||||
|
@ -48,7 +48,6 @@ public class ASTFactory {
|
||||
if (classLoader != null) {
|
||||
var bytes = IOUtils.toByteArray(Objects.requireNonNull(classLoader.getResourceAsStream(path)));
|
||||
var classReader = new ClassReader(bytes);
|
||||
|
||||
var classVisitor = new ClassVisitor(Opcodes.ASM7) {
|
||||
String classSignature;
|
||||
@Override
|
||||
@ -300,7 +299,6 @@ public class ASTFactory {
|
||||
var sr = new SignatureReader(signature);
|
||||
sr.accept(signatureVisitor);
|
||||
|
||||
System.out.println(signature);
|
||||
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) {
|
||||
String ret = "<";
|
||||
String ret = "";
|
||||
if (generics.size() > 0) {
|
||||
ret += "<";
|
||||
for (var generic : generics) {
|
||||
ret += generic.name() + ":" + generic.bound().toDescriptor();
|
||||
}
|
||||
ret += ">(";
|
||||
ret += ">";
|
||||
}
|
||||
ret += "(";
|
||||
for (var param : parameters) {
|
||||
ret += param.type().toDescriptor();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user