From 8419b1aa175a092f34ce102f43c448f1a2907861 Mon Sep 17 00:00:00 2001 From: Jochen Seyfried Date: Thu, 9 May 2024 15:10:53 +0200 Subject: [PATCH] Changed the generation to a .class --- Source/abstractSyntaxTree/Program.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Source/abstractSyntaxTree/Program.java b/Source/abstractSyntaxTree/Program.java index 0ef8585..659ad47 100644 --- a/Source/abstractSyntaxTree/Program.java +++ b/Source/abstractSyntaxTree/Program.java @@ -61,7 +61,16 @@ public class Program { cw.visitEnd(); byte[] bytecode = cw.toByteArray(); - // Write the bytecode to a .class file in the .jar file + try (FileOutputStream fos = new FileOutputStream(oneClass.name + ".class")) { + fos.write(bytecode); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + + /*// Write the bytecode to a .class file in the .jar file JarEntry entry = new JarEntry(oneClass.name + ".class"); jos.putNextEntry(entry); jos.write(bytecode); @@ -69,7 +78,7 @@ public class Program { } } catch (IOException e) { e.printStackTrace(); - } + }*/ /* for(RefType oneClass : classes){