From 34969e66ba33dc77531ef2d710661fc0e55cf1d2 Mon Sep 17 00:00:00 2001 From: Fayez Abu Alia Date: Fri, 3 Aug 2018 13:48:45 +0200 Subject: [PATCH] bug in Signature gefixt --- src/de/dhbwstuttgart/bytecode/signature/Signature.java | 1 + src/de/dhbwstuttgart/bytecode/signature/TypeToSignature.java | 2 ++ test/bytecode/javFiles/Lambda.jav | 4 ++-- test/bytecode/javFiles/Tph.jav | 5 +++-- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/de/dhbwstuttgart/bytecode/signature/Signature.java b/src/de/dhbwstuttgart/bytecode/signature/Signature.java index c06f7b38..c32cbf86 100644 --- a/src/de/dhbwstuttgart/bytecode/signature/Signature.java +++ b/src/de/dhbwstuttgart/bytecode/signature/Signature.java @@ -392,6 +392,7 @@ public class Signature { String sig2 = r.acceptTV(new TypeToSignature()); if(!(r instanceof TypePlaceholder)) { if(sig2.contains("$$")) { + System.out.println(" Signature FUN$$: "+r); sv.visitInterface().visitClassType(sig2.substring(1, sig2.length())); } else { sv.visitClassType(sig2.substring(1, sig2.length())); diff --git a/src/de/dhbwstuttgart/bytecode/signature/TypeToSignature.java b/src/de/dhbwstuttgart/bytecode/signature/TypeToSignature.java index 785bfabe..31d288f7 100644 --- a/src/de/dhbwstuttgart/bytecode/signature/TypeToSignature.java +++ b/src/de/dhbwstuttgart/bytecode/signature/TypeToSignature.java @@ -34,6 +34,8 @@ public class TypeToSignature implements TypeVisitor { // params += "L"+param.toString().replace(".", "/"); // } params += param.acceptTV(new TypeToSignature()); + if(param instanceof TypePlaceholder) + params += ";"; // if(it.hasNext())params += ";"; } params += ">"; diff --git a/test/bytecode/javFiles/Lambda.jav b/test/bytecode/javFiles/Lambda.jav index d7809e7e..ba466b18 100644 --- a/test/bytecode/javFiles/Lambda.jav +++ b/test/bytecode/javFiles/Lambda.jav @@ -3,8 +3,8 @@ import java.lang.Integer; public class Lambda { m () { - var lam1 = (Integer x) -> { - return x * x; + var lam1 = (x) -> { + return x; }; return lam1; } diff --git a/test/bytecode/javFiles/Tph.jav b/test/bytecode/javFiles/Tph.jav index 8dbb1507..93233a3a 100644 --- a/test/bytecode/javFiles/Tph.jav +++ b/test/bytecode/javFiles/Tph.jav @@ -1,8 +1,9 @@ public class Tph { m(a,b){ - var c = m2(b); - return c; +// var c = m2(b); +// return c; + return m2(b); } m2(b){