diff --git a/src/main/java/de/dhbwstuttgart/bytecode/Codegen.java b/src/main/java/de/dhbwstuttgart/bytecode/Codegen.java index 9d196167f..ee6047791 100644 --- a/src/main/java/de/dhbwstuttgart/bytecode/Codegen.java +++ b/src/main/java/de/dhbwstuttgart/bytecode/Codegen.java @@ -979,7 +979,7 @@ public class Codegen { } private void generateConstructor(TargetConstructor constructor) { - MethodVisitor mv = cw.visitMethod(constructor.access() | ACC_PUBLIC, "", constructor.getDescriptor(), constructor.getSignature(), null); + MethodVisitor mv = cw.visitMethod(constructor.access() | ACC_PUBLIC, "", constructor.getDescriptor(), null, null); mv.visitCode(); var state = new State(null, mv, 1); for (var param: constructor.parameters()) @@ -1027,8 +1027,8 @@ public class Codegen { } public byte[] generate() { - cw.visit(V1_8, clazz.modifiers() | ACC_PUBLIC, clazz.qualifiedName(), - generateSignature(clazz), clazz.superType() != null ? clazz.superType().getInternalName(): "java/lang/Object", + cw.visit(V1_8, clazz.modifiers() | ACC_PUBLIC | ACC_SUPER, clazz.qualifiedName(), + null, clazz.superType() != null ? clazz.superType().getInternalName(): "java/lang/Object", clazz.implementingInterfaces().stream().map(TargetType::toSignature).toArray(String[]::new) ); clazz.fields().forEach(this::generateField); diff --git a/src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java b/src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java index 67e553e65..ce312d01d 100644 --- a/src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java +++ b/src/main/java/de/dhbwstuttgart/core/JavaTXCompiler.java @@ -909,7 +909,7 @@ public class JavaTXCompiler { // "/testBytecode/generatedBC/" +name+".class")); File outputFile = new File(path, name.getClassName() + ".class"); outputFile.getAbsoluteFile().getParentFile().mkdirs(); - output = new FileOutputStream(outputFile); + output = new FileOutputStream(outputFile, false); output.write(bytecode); output.close(); System.out.println(name + ".class file generated");