diff --git a/src/de/dhbwstuttgart/syntaxtree/Class.java b/src/de/dhbwstuttgart/syntaxtree/Class.java index 972adb7f..2e710e0e 100755 --- a/src/de/dhbwstuttgart/syntaxtree/Class.java +++ b/src/de/dhbwstuttgart/syntaxtree/Class.java @@ -1250,8 +1250,8 @@ public class Class extends GTVDeclarationContext implements AClassOrInterface, I if(!constructorVorhanden){//Falls kein Konstruktor vorhanden ist, muss noch der Standardkonstruktor angefügt werden: Block konstruktorBlock = new Block(); konstruktorBlock.statements.add(new SuperCall(konstruktorBlock)); - //Constructor standardKonstruktor = new Constructor(Method.createEmptyMethod(konstruktorBlock,this.getName().toString(), this)); - Constructor standardKonstruktor = new Constructor(Method.createEmptyMethod(this.getName().toString(), this)); + Constructor standardKonstruktor = new Constructor(Method.createEmptyMethod(konstruktorBlock,this.getName().toString(), this)); + //Constructor standardKonstruktor = new Constructor(Method.createEmptyMethod(this.getName().toString(), this)); this.addField(standardKonstruktor); } diff --git a/src/de/dhbwstuttgart/syntaxtree/statement/SuperCall.java b/src/de/dhbwstuttgart/syntaxtree/statement/SuperCall.java index a66c2042..6abf8513 100644 --- a/src/de/dhbwstuttgart/syntaxtree/statement/SuperCall.java +++ b/src/de/dhbwstuttgart/syntaxtree/statement/SuperCall.java @@ -76,7 +76,9 @@ public class SuperCall extends ThisCall @Override public JavaCodeResult printJavaCode(ResultSet resultSet) { - return new JavaCodeResult("super("+this.getArgumentList().printJavaCode(resultSet)+")"); + String argList = ""; + if(this.getArgumentList() != null)argList = this.getArgumentList().printJavaCode(resultSet).getJavaCode(); + return new JavaCodeResult("super("+argList+")"); } }