From d3d1d658b81dce2ff89e5d3bb606f5bbec09080a Mon Sep 17 00:00:00 2001 From: Fayez Abu Alia Date: Wed, 26 Sep 2018 15:37:00 +0200 Subject: [PATCH] Bug 112 gefixt --- src/de/dhbwstuttgart/bytecode/signature/Signature.java | 9 ++++++++- .../bytecode/signature/TypeToSignature.java | 10 ++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/de/dhbwstuttgart/bytecode/signature/Signature.java b/src/de/dhbwstuttgart/bytecode/signature/Signature.java index 60023895..ffcf5409 100644 --- a/src/de/dhbwstuttgart/bytecode/signature/Signature.java +++ b/src/de/dhbwstuttgart/bytecode/signature/Signature.java @@ -231,8 +231,15 @@ public class Signature { private void createSigForParamTypeWithWC(RefType ref) { for(RefTypeOrTPHOrWildcardOrGeneric p : ref.getParaList()) { if(p instanceof WildcardType) { + String name = null; if(((WildcardType) p).getInnerType() instanceof GenericRefType) { - String name = new TypeToSignature().visit((GenericRefType)((WildcardType) p).getInnerType()); + name = new TypeToSignature().visit((GenericRefType)((WildcardType) p).getInnerType()); + } + if(((WildcardType) p).getInnerType() instanceof TypePlaceholder) { + name = new TypeToSignature().visit((TypePlaceholder)((WildcardType) p).getInnerType()); + name = name.substring(1); + } + if(name != null) { if(!genericsAndBoundsMethod.containsKey(name) && !genericsAndBounds.containsKey(name)) { sw.visitFormalTypeParameter(name); sw.visitClassBound().visitClassType(Type.getInternalName(Object.class)); diff --git a/src/de/dhbwstuttgart/bytecode/signature/TypeToSignature.java b/src/de/dhbwstuttgart/bytecode/signature/TypeToSignature.java index 7d47406d..24792550 100644 --- a/src/de/dhbwstuttgart/bytecode/signature/TypeToSignature.java +++ b/src/de/dhbwstuttgart/bytecode/signature/TypeToSignature.java @@ -48,7 +48,10 @@ public class TypeToSignature implements TypeVisitor { @Override public String visit(SuperWildcardType superWildcardType) { // throw new NotImplementedException(); - return "-" + superWildcardType.getInnerType().acceptTV(new TypeToSignature()); + String sig = "-" + superWildcardType.getInnerType().acceptTV(new TypeToSignature()); + if(superWildcardType.getInnerType() instanceof TypePlaceholder) + sig += ";"; + return sig; } @Override @@ -60,7 +63,10 @@ public class TypeToSignature implements TypeVisitor { @Override public String visit(ExtendsWildcardType extendsWildcardType) { // throw new NotImplementedException(); - return "+" + extendsWildcardType.getInnerType().acceptTV(new TypeToSignature()); + String sig = "+" + extendsWildcardType.getInnerType().acceptTV(new TypeToSignature()); + if(extendsWildcardType.getInnerType() instanceof TypePlaceholder) + sig += ";"; + return sig; } @Override