diff --git a/src/main/java/CompilerInput.txt b/src/main/java/CompilerInput.txt index 106dace..0a31d5c 100644 --- a/src/main/java/CompilerInput.txt +++ b/src/main/java/CompilerInput.txt @@ -1,3 +1,11 @@ public class Example { + public int test; + +} + +public class Test { + + public char test; + } \ No newline at end of file diff --git a/src/main/java/bytecode/FieldCodeGen.java b/src/main/java/bytecode/FieldCodeGen.java index 8dd6a99..5e08941 100644 --- a/src/main/java/bytecode/FieldCodeGen.java +++ b/src/main/java/bytecode/FieldCodeGen.java @@ -9,6 +9,6 @@ public class FieldCodeGen { public void generateFieldCode(ClassWriter classWriter, FieldNode fieldNode) { Mapper mapper = new Mapper(); - FieldVisitor fieldVisitor = classWriter.visitField(mapper.mapAccesTypeToOpcode(fieldNode.accessTypeNode), fieldNode.name, "", null, null); + FieldVisitor fieldVisitor = classWriter.visitField(mapper.mapAccesTypeToOpcode(fieldNode.accessTypeNode), fieldNode.identifier.getName(), "", null, null); } } diff --git a/src/main/java/classFileOutput/Example.class b/src/main/java/classFileOutput/Example.class index e44ef84..7490cc1 100644 Binary files a/src/main/java/classFileOutput/Example.class and b/src/main/java/classFileOutput/Example.class differ diff --git a/src/main/java/classFileOutput/Test.class b/src/main/java/classFileOutput/Test.class index 25dfaa7..8ba4c23 100644 Binary files a/src/main/java/classFileOutput/Test.class and b/src/main/java/classFileOutput/Test.class differ diff --git a/src/main/resources/Example.txt b/src/main/resources/Example.txt deleted file mode 100644 index b6d9d6b..0000000 --- a/src/main/resources/Example.txt +++ /dev/null @@ -1,12 +0,0 @@ -public class Example { - - public int test; - -} - -public class Test { - - public char test; - -} -