From 85fcef82893b4e0c7c1eefe7676fd2918a62072f Mon Sep 17 00:00:00 2001 From: Fayez Abu Alia Date: Thu, 20 Dec 2018 10:25:55 +0100 Subject: [PATCH] commit --- src/de/dhbwstuttgart/bytecode/BytecodeGen.java | 3 ++- .../bytecode/descriptor/DescriptorToString.java | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/de/dhbwstuttgart/bytecode/BytecodeGen.java b/src/de/dhbwstuttgart/bytecode/BytecodeGen.java index 2ac10fccb..f67b9c4de 100644 --- a/src/de/dhbwstuttgart/bytecode/BytecodeGen.java +++ b/src/de/dhbwstuttgart/bytecode/BytecodeGen.java @@ -272,7 +272,8 @@ public class BytecodeGen implements ASTVisitor { for(String paramName : methodParamsAndTypes.keySet()) { String typeOfParam = methodParamsAndTypes.get(paramName).acceptTV(new TypeToSignature()); - if(genericsAndBounds.containsKey(typeOfParam) ||typeOfParam.substring(0, 4).equals("TPH ") + System.out.println(typeOfParam); + if(genericsAndBounds.containsKey(typeOfParam) ||typeOfParam.contains("$") || typeOfParam.contains("<")) { hasGen = true; break; diff --git a/src/de/dhbwstuttgart/bytecode/descriptor/DescriptorToString.java b/src/de/dhbwstuttgart/bytecode/descriptor/DescriptorToString.java index 5464aa910..07471ae1b 100644 --- a/src/de/dhbwstuttgart/bytecode/descriptor/DescriptorToString.java +++ b/src/de/dhbwstuttgart/bytecode/descriptor/DescriptorToString.java @@ -106,7 +106,14 @@ public class DescriptorToString implements DescriptorVisitor{ if(constructor.getGenericsAndBounds().containsKey(fpDesc)){ desc += "L"+constructor.getGenericsAndBounds().get(fpDesc)+ ";"; }else { - desc += "L"+resultSet.resolveType(fp.getType()).resolvedType.acceptTV(new TypeToDescriptor())+ ";"; +// desc += "L"+resultSet.resolveType(fp.getType()).resolvedType.acceptTV(new TypeToDescriptor())+ ";"; + String resType = resultSet.resolveType(fp.getType()).resolvedType.acceptTV(new TypeToDescriptor()); + if(resType.subSequence(0, 4).equals("TPH ")) { + // Bound ist immer Object + desc += "L"+Type.getInternalName(Object.class)+ ";"; + } else { + desc += "L"+resType+ ";"; + } } }else { // System.out.println("Cons has NO Gens");