diff --git a/pom.xml b/pom.xml
index 26ae14e8..c03d39ab 100644
--- a/pom.xml
+++ b/pom.xml
@@ -63,6 +63,9 @@ http://maven.apache.org/maven-v4_0_0.xsd">
3.1.0
--enable-preview
+
+ **/JavaTXCompilerTest.java
+
diff --git a/src/main/antlr4/de/dhbwstuttgart/parser/antlr/Java17Parser.g4 b/src/main/antlr4/de/dhbwstuttgart/parser/antlr/Java17Parser.g4
index 6c658a7c..966b4458 100644
--- a/src/main/antlr4/de/dhbwstuttgart/parser/antlr/Java17Parser.g4
+++ b/src/main/antlr4/de/dhbwstuttgart/parser/antlr/Java17Parser.g4
@@ -475,7 +475,7 @@ blockStatement
;
localVariableDeclaration
- : variableModifier* (VAR identifier '=' expression | typeType variableDeclarators)
+ : variableModifier* (VAR | typeType) variableDeclarators
;
identifier
diff --git a/src/main/java/de/dhbwstuttgart/parser/SyntaxTreeGenerator/StatementGenerator.java b/src/main/java/de/dhbwstuttgart/parser/SyntaxTreeGenerator/StatementGenerator.java
index afe9946a..37b28cb3 100644
--- a/src/main/java/de/dhbwstuttgart/parser/SyntaxTreeGenerator/StatementGenerator.java
+++ b/src/main/java/de/dhbwstuttgart/parser/SyntaxTreeGenerator/StatementGenerator.java
@@ -380,16 +380,8 @@ public class StatementGenerator {
} else {
type = TypeGenerator.convert(declaration.typeType(), reg, generics);
}
- if (Objects.isNull(declaration.variableDeclarators())) {
- IdentifierContext identifier = declaration.identifier();
- Token offset = identifier.getStart();
- String name = identifier.getText();
- ret.add(new LocalVarDecl(name, type, offset));
- this.localVars.put(name, type);
- ret.add(new Assign(new AssignToLocal(new LocalVar(name, type, offset)), convert(declaration.expression()), offset));
- } else {
+ if (!Objects.isNull(declaration.variableDeclarators()))
ret.addAll(generateLocalVariableAssignments(declaration.variableDeclarators().variableDeclarator(), type));
- }
return ret;
}