Fix incorrect signatures
This commit is contained in:
parent
1d7e755a98
commit
337ff8b865
@ -1,5 +1,5 @@
|
|||||||
import java.lang.Integer;
|
import java.lang.Integer;
|
||||||
//import java.lang.Double;
|
import java.lang.Double;
|
||||||
|
|
||||||
public class Fac {
|
public class Fac {
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
public class Id {
|
public class Id <FAU> {
|
||||||
// a;
|
// a;
|
||||||
// id(b){
|
// id(b){
|
||||||
// return b;
|
// return b;
|
||||||
|
@ -33,8 +33,10 @@ public class FunNGenerator {
|
|||||||
|
|
||||||
|
|
||||||
private static String applyDescriptor(TargetType type, int[] start) {
|
private static String applyDescriptor(TargetType type, int[] start) {
|
||||||
var res = "L" + type.getInternalName() + "<";
|
var res = "L" + type.getInternalName();
|
||||||
if (type instanceof TargetSpecializedType a)
|
if (type instanceof TargetSpecializedType a)
|
||||||
|
if (a.params().size() > 0) {
|
||||||
|
res += "<";
|
||||||
for (var param : a.params()) {
|
for (var param : a.params()) {
|
||||||
if (param instanceof TargetGenericType gp) {
|
if (param instanceof TargetGenericType gp) {
|
||||||
res += "TT" + start[0] + ";";
|
res += "TT" + start[0] + ";";
|
||||||
@ -43,8 +45,10 @@ public class FunNGenerator {
|
|||||||
res += applyDescriptor(param, start);
|
res += applyDescriptor(param, start);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
res += ">";
|
||||||
|
}
|
||||||
else return type.toDescriptor();
|
else return type.toDescriptor();
|
||||||
res += ">;";
|
res += ";";
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
@ -156,6 +156,7 @@ public class ASTFactory {
|
|||||||
List<FormalParameter> params = new ArrayList<>();
|
List<FormalParameter> params = new ArrayList<>();
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for(Type jreParam : jreGenericParams){
|
for(Type jreParam : jreGenericParams){
|
||||||
|
if (jreParam == null) continue;
|
||||||
RefTypeOrTPHOrWildcardOrGeneric paramType = createType(jreParam);
|
RefTypeOrTPHOrWildcardOrGeneric paramType = createType(jreParam);
|
||||||
params.add(new FormalParameter(jreParams[i].getName(),paramType, new NullToken()));
|
params.add(new FormalParameter(jreParams[i].getName(),paramType, new NullToken()));
|
||||||
i++;
|
i++;
|
||||||
@ -188,6 +189,7 @@ public class ASTFactory {
|
|||||||
List<FormalParameter> params = new ArrayList<>();
|
List<FormalParameter> params = new ArrayList<>();
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for(Type jreParam : jreGenericParams){
|
for(Type jreParam : jreGenericParams){
|
||||||
|
if (jreParam == null) continue;
|
||||||
RefTypeOrTPHOrWildcardOrGeneric paramType = createType(jreParam);
|
RefTypeOrTPHOrWildcardOrGeneric paramType = createType(jreParam);
|
||||||
params.add(new FormalParameter(jreParams[i].getName(),paramType, new NullToken()));
|
params.add(new FormalParameter(jreParams[i].getName(),paramType, new NullToken()));
|
||||||
i++;
|
i++;
|
||||||
@ -333,7 +335,7 @@ public class ASTFactory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static RefTypeOrTPHOrWildcardOrGeneric createType(java.lang.reflect.Type type){
|
private static RefTypeOrTPHOrWildcardOrGeneric createType(java.lang.reflect.Type type){
|
||||||
if(type.getTypeName().equals("void")){
|
if(type == null || type.getTypeName().equals("void")){
|
||||||
return new Void(new NullToken());
|
return new Void(new NullToken());
|
||||||
}else if(type.getTypeName().equals("int")){
|
}else if(type.getTypeName().equals("int")){
|
||||||
return new RefType(new JavaClassName("java.lang.Integer"), new ArrayList<>(), new NullToken());
|
return new RefType(new JavaClassName("java.lang.Integer"), new ArrayList<>(), new NullToken());
|
||||||
|
Loading…
Reference in New Issue
Block a user