diff --git a/src/main/java/de/dhbwstuttgart/bytecode/FunNGenerator.java b/src/main/java/de/dhbwstuttgart/bytecode/FunNGenerator.java index c5ae16f76..49c9b7361 100644 --- a/src/main/java/de/dhbwstuttgart/bytecode/FunNGenerator.java +++ b/src/main/java/de/dhbwstuttgart/bytecode/FunNGenerator.java @@ -31,7 +31,7 @@ public class FunNGenerator { private static String applyDescriptor(TargetType a) { return a.toDescriptor(); } private static String applySignature(TargetType a) { return a.toSignature(); } - private static String applyNameDescriptor(TargetType a){ return a instanceof TargetGenericType ? "LTPH;" : String.format("L%s;", applySignature(a)); } + private static String applyNameDescriptor(TargetType a){ return a instanceof TargetGenericType ? "LTPH;" : String.format("%s;", applySignature(a)); } public static byte[] generateSuperBytecode(int numberArguments) { StringBuilder superFunNClassSignature = new StringBuilder("<"); @@ -40,13 +40,15 @@ public class FunNGenerator { for (int currentParameter = 1; currentParameter <= numberArguments; currentParameter++){ superFunNClassSignature.append(String.format("%s%d:%s",argumentGenericBase, currentParameter, objectSignature)); - superFunNMethodSignature.append(String.format("T%s;", applySignature(new TargetRefType(argumentGenericBase + currentParameter)))); + superFunNMethodSignature.append(String.format("%s", applySignature(new TargetRefType(argumentGenericBase + currentParameter)))); superFunNMethodDescriptor.append(objectSignature); } superFunNClassSignature.append(String.format("%s:%s>%s", returnGeneric, objectSignature, objectSignature)); - superFunNMethodSignature.append(String.format(")T%s;", applySignature(new TargetRefType(returnGeneric)))); + superFunNMethodSignature.append(String.format(")%s", applySignature(new TargetRefType(returnGeneric)))); superFunNMethodDescriptor.append(String.format(")%s", objectSignature)); + System.out.println(superFunNMethodSignature); + ClassWriter classWriter = new ClassWriter(0); MethodVisitor methodVisitor; classWriter.visit(bytecodeVersion, ACC_PUBLIC | ACC_ABSTRACT | ACC_INTERFACE, getSuperClassName(numberArguments), superFunNClassSignature.toString(), objectSuperType, null); diff --git a/src/test/resources/target/Test.java b/src/test/resources/target/Test.java deleted file mode 100644 index f7e1a0bc8..000000000 --- a/src/test/resources/target/Test.java +++ /dev/null @@ -1,9 +0,0 @@ -public class Test { - public void lambda() { - Interface mul2 = (Integer a) -> a * 2; - } -} - -interface Interface { - R apply(T t); -} \ No newline at end of file