From 2bbb6e0b6bbabd8eb7565a518a9f09b14cbd5547 Mon Sep 17 00:00:00 2001 From: Fayez Abu Alia Date: Wed, 8 Aug 2018 14:33:31 +0200 Subject: [PATCH 1/3] 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; From 7d9976e638c4fe7bd1f7f787e8647cd81a42eac2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Pl=C3=BCmicke?= Date: Wed, 8 Aug 2018 15:32:42 +0200 Subject: [PATCH 2/3] modified: ../../src/de/dhbwstuttgart/typeinference/typeAlgo/GenericsResolverSameName.java superwildcard durch extendswildcard ausgetauscht. --- .../typeinference/typeAlgo/GenericsResolverSameName.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/de/dhbwstuttgart/typeinference/typeAlgo/GenericsResolverSameName.java b/src/de/dhbwstuttgart/typeinference/typeAlgo/GenericsResolverSameName.java index f8754e63..2bb131f1 100644 --- a/src/de/dhbwstuttgart/typeinference/typeAlgo/GenericsResolverSameName.java +++ b/src/de/dhbwstuttgart/typeinference/typeAlgo/GenericsResolverSameName.java @@ -42,7 +42,7 @@ public class GenericsResolverSameName implements GenericsResolver, TypeVisitor Date: Wed, 8 Aug 2018 18:12:24 +0200 Subject: [PATCH 3/3] modified: ../../test/bytecode/javFiles/Merge.jav modified: ../../test/bytecode/javFiles/OL.jav --- test/bytecode/javFiles/Merge.jav | 4 ++-- test/bytecode/javFiles/OL.jav | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/bytecode/javFiles/Merge.jav b/test/bytecode/javFiles/Merge.jav index 627e9f45..9240146e 100644 --- a/test/bytecode/javFiles/Merge.jav +++ b/test/bytecode/javFiles/Merge.jav @@ -10,11 +10,11 @@ class Merge { } -/* + sort(in){ var firstHalf = in.subList(1,2); var secondHalf = in.subList(1,2); return merge(sort(firstHalf), sort(secondHalf)); } - */ + } \ No newline at end of file diff --git a/test/bytecode/javFiles/OL.jav b/test/bytecode/javFiles/OL.jav index b231e6a0..68650428 100644 --- a/test/bytecode/javFiles/OL.jav +++ b/test/bytecode/javFiles/OL.jav @@ -14,7 +14,7 @@ public class OL { public class OLMain { - main(java.lang.Integer x) { + main(x) { var ol; ol = new OL(); return ol.m(x);