From 2bbb6e0b6bbabd8eb7565a518a9f09b14cbd5547 Mon Sep 17 00:00:00 2001 From: Fayez Abu Alia Date: Wed, 8 Aug 2018 14:33:31 +0200 Subject: [PATCH] Bug in Signature gefixt. Merge Test tut. --- .../bytecode/signature/Signature.java | 3 ++- .../bytecode/signature/TypeToSignature.java | 2 +- test/bytecode/javFiles/Lambda.jav | 8 ++------ test/bytecode/javFiles/OL.jav | 15 +++------------ 4 files changed, 8 insertions(+), 20 deletions(-) diff --git a/src/de/dhbwstuttgart/bytecode/signature/Signature.java b/src/de/dhbwstuttgart/bytecode/signature/Signature.java index ae91932a..5c5d8d48 100644 --- a/src/de/dhbwstuttgart/bytecode/signature/Signature.java +++ b/src/de/dhbwstuttgart/bytecode/signature/Signature.java @@ -119,7 +119,7 @@ public class Signature { if(!ret.equals("V")) { // TODO TypeToSignature nochmal kontrollieren und schauen ob man dort wirklich // T... braucht und L ... - if(ret.contains("$") && !ret.contains("$$")) { + if(ret.contains("$") && !ret.contains("$$") && !ret.contains("<")) { if(genericsAndBounds.containsKey(ret)) { genericsAndBoundsMethod.put(ret.substring(1), genericsAndBounds.get(ret.substring(1))); }else { @@ -233,6 +233,7 @@ public class Signature { if(p instanceof WildcardType) { if(((WildcardType) p).getInnerType() instanceof GenericRefType) { String name = new TypeToSignature().visit((GenericRefType)((WildcardType) p).getInnerType()); + System.out.println("NAME WC = " + name); 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 3bad4066..2d484ece 100644 --- a/src/de/dhbwstuttgart/bytecode/signature/TypeToSignature.java +++ b/src/de/dhbwstuttgart/bytecode/signature/TypeToSignature.java @@ -34,7 +34,7 @@ public class TypeToSignature implements TypeVisitor { // params += "L"+param.toString().replace(".", "/"); // } params += param.acceptTV(new TypeToSignature()); - if(param instanceof TypePlaceholder) + if(!(param instanceof RefType)) params += ";"; // if(it.hasNext())params += ";"; } diff --git a/test/bytecode/javFiles/Lambda.jav b/test/bytecode/javFiles/Lambda.jav index bb7de0b4..b025fb51 100644 --- a/test/bytecode/javFiles/Lambda.jav +++ b/test/bytecode/javFiles/Lambda.jav @@ -6,13 +6,9 @@ public class Lambda { var lam1 = (x) -> { return x; }; -<<<<<<< HEAD - return lam1; -======= - return lam1.apply(new Apply()); - //return lam1; +// return lam1.apply(new Apply()); + return lam1; //return new Vector(); ->>>>>>> 3fedbcc4a0e015ec8f5f6ccb77081f888135c850 } } diff --git a/test/bytecode/javFiles/OL.jav b/test/bytecode/javFiles/OL.jav index 55e018bc..b231e6a0 100644 --- a/test/bytecode/javFiles/OL.jav +++ b/test/bytecode/javFiles/OL.jav @@ -1,27 +1,18 @@ import java.lang.String; import java.lang.Integer; import java.lang.Double; -import java.lang.String; -<<<<<<< HEAD -public class OL { - m(x) { return x + x; } -======= -class OL { +public class OL { m(x) { return x + x; } ->>>>>>> 3fedbcc4a0e015ec8f5f6ccb77081f888135c850 } -<<<<<<< HEAD -public class OLMain { -======= -class OLMain { ->>>>>>> 3fedbcc4a0e015ec8f5f6ccb77081f888135c850 + +public class OLMain { main(java.lang.Integer x) { var ol;