From 5a026a431c98093f905206349d82f3bfbde05175 Mon Sep 17 00:00:00 2001 From: Fayez Abu Alia Date: Fri, 3 Nov 2017 14:17:36 +0100 Subject: [PATCH] kleine Aenderung --- src/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java | 4 +++- test/bytecode/JavaTXCompilerTest.java | 2 +- test/typeinference/FiniteClosureTest.java | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java b/src/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java index c65e691c..debcd8e4 100644 --- a/src/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java +++ b/src/de/dhbwstuttgart/bytecode/BytecodeGenMethod.java @@ -175,8 +175,10 @@ public class BytecodeGenMethod implements StatementVisitor{ MethodVisitor mvLambdaBody = cw.visitMethod(Opcodes.ACC_PRIVATE+ Opcodes.ACC_STATIC + Opcodes.ACC_SYNTHETIC, methodName, arg3.toString(), null, null); // new BytecodeGenLambda(lambdaExpression, mvLambdaBody); + HashMap paramsAndLocalsLambda = new HashMap<>(); + new BytecodeGenMethod(lambdaExpression, mvLambdaBody, paramsAndLocalsLambda, arg3.toString()); - new BytecodeGenMethod(lambdaExpression, mvLambdaBody, new HashMap<>(), arg3.toString()); + mv.visitVarInsn(Opcodes.ASTORE, paramsAndLocalsLambda.size()); mvLambdaBody.visitMaxs(0, 0); mvLambdaBody.visitEnd(); } diff --git a/test/bytecode/JavaTXCompilerTest.java b/test/bytecode/JavaTXCompilerTest.java index 9ca91abb..228a4851 100644 --- a/test/bytecode/JavaTXCompilerTest.java +++ b/test/bytecode/JavaTXCompilerTest.java @@ -51,7 +51,7 @@ public class JavaTXCompilerTest { byte[] bytecode = classFiles.get(name); try { System.out.println("generating .class file"); - output = new FileOutputStream(new File(System.getProperty("user.dir") + "/testBytecode/" +name+".class")); + output = new FileOutputStream(new File(System.getProperty("user.dir") + "/testBytecode/generatedBC/" +name+".class")); output.write(bytecode); output.close(); System.out.println(".class file generated"); diff --git a/test/typeinference/FiniteClosureTest.java b/test/typeinference/FiniteClosureTest.java index d3e1fdb0..8b62e4e5 100644 --- a/test/typeinference/FiniteClosureTest.java +++ b/test/typeinference/FiniteClosureTest.java @@ -4,6 +4,6 @@ import java.io.File; public class FiniteClosureTest extends JavaTXCompilerTest{ public FiniteClosureTest() { - this.fileToTest = new File(rootDirectory+"fc.jav"); +// this.fileToTest = new File(rootDirectory+"fc.jav"); } } \ No newline at end of file