diff --git a/src/de/dhbwstuttgart/syntaxtree/AbstractASTWalker.java b/src/de/dhbwstuttgart/syntaxtree/AbstractASTWalker.java index 58ba3fae..20e895b4 100644 --- a/src/de/dhbwstuttgart/syntaxtree/AbstractASTWalker.java +++ b/src/de/dhbwstuttgart/syntaxtree/AbstractASTWalker.java @@ -63,7 +63,8 @@ public abstract class AbstractASTWalker implements ASTVisitor{ private void visitMethod(Method method){ method.getType().accept(this); method.getParameterList().accept(this); - method.block.accept(this); + if(method.block != null) + method.block.accept(this); } @Override diff --git a/src/de/dhbwstuttgart/syntaxtree/visual/OutputGenerator.java b/src/de/dhbwstuttgart/syntaxtree/visual/OutputGenerator.java index e5040d6c..e38c0230 100644 --- a/src/de/dhbwstuttgart/syntaxtree/visual/OutputGenerator.java +++ b/src/de/dhbwstuttgart/syntaxtree/visual/OutputGenerator.java @@ -84,7 +84,8 @@ public class OutputGenerator implements ASTVisitor { method.getType().accept(this); out.append(" " + method.getName()); method.getParameterList().accept(this); - method.block.accept(this); + if(method.block != null) + method.block.accept(this); out.append("\n"); } diff --git a/src/de/dhbwstuttgart/typedeployment/TypeInsertFactory.java b/src/de/dhbwstuttgart/typedeployment/TypeInsertFactory.java index a3f81a4a..d9513731 100644 --- a/src/de/dhbwstuttgart/typedeployment/TypeInsertFactory.java +++ b/src/de/dhbwstuttgart/typedeployment/TypeInsertFactory.java @@ -62,6 +62,8 @@ public class TypeInsertFactory { additionalInserts.add(((TypePlaceholder) type)); }else if(type instanceof GenericRefType){ insertPoint = new TypeInsertPoint(offset, ((GenericRefType) type).getName().toString()); + }else if(type instanceof RefType){ + insertPoint = new TypeInsertPoint(offset, ((RefType) type).getName().toString()); }else throw new NotImplementedException(); } diff --git a/test/typeinference/JavaTXCompilerTest.java b/test/typeinference/JavaTXCompilerTest.java index a129b13e..2d44c2bb 100644 --- a/test/typeinference/JavaTXCompilerTest.java +++ b/test/typeinference/JavaTXCompilerTest.java @@ -33,15 +33,15 @@ public class JavaTXCompilerTest extends JavaTXCompiler { @Test public void test() throws IOException, java.lang.ClassNotFoundException { - //filesToTest.add(new File(rootDirectory+"Faculty.jav")); + filesToTest.add(new File(rootDirectory+"Faculty.jav")); filesToTest.add(new File(rootDirectory+"mathStruc.jav")); - //filesToTest.add(new File(rootDirectory+"Lambda.jav")); - //filesToTest.add(new File(rootDirectory+"Lambda2.jav")); - //filesToTest.add(new File(rootDirectory+"Lambda3.jav")); - //filesToTest.add(new File(rootDirectory+"Vector.jav")); - //filesToTest.add(new File(rootDirectory+"Generics.jav")); - //filesToTest.add(new File(rootDirectory+"MethodsEasy.jav")); - //filesToTest.add(new File(rootDirectory+"Matrix.jav")); + filesToTest.add(new File(rootDirectory+"Lambda.jav")); + filesToTest.add(new File(rootDirectory+"Lambda2.jav")); + filesToTest.add(new File(rootDirectory+"Lambda3.jav")); + filesToTest.add(new File(rootDirectory+"Vector.jav")); + filesToTest.add(new File(rootDirectory+"Generics.jav")); + filesToTest.add(new File(rootDirectory+"MethodsEasy.jav")); + filesToTest.add(new File(rootDirectory+"Matrix.jav")); for(File f : filesToTest){ SourceFile sf = this.parse(f); System.out.println(ASTTypePrinter.print(this.sourceFiles.get(sourceFiles.size()-1)));