diff --git a/src/de/dhbwstuttgart/typedeployment/TypeInsertFactory.java b/src/de/dhbwstuttgart/typedeployment/TypeInsertFactory.java index d9513731..046ae735 100644 --- a/src/de/dhbwstuttgart/typedeployment/TypeInsertFactory.java +++ b/src/de/dhbwstuttgart/typedeployment/TypeInsertFactory.java @@ -93,8 +93,8 @@ public class TypeInsertFactory { } if(! inside)newGenerics.add(new GenericInsertPair(additionalTPH, null)); } - - ret.add(createGenericInsert(newGenerics, cl, m)); + if(newGenerics.size() > 0) + ret.add(createGenericInsert(newGenerics, cl, m)); //return ret; return new TypeInsert(insertPoint, ret); diff --git a/test/javFiles/mathStruc.jav b/test/javFiles/mathStruc.jav index 45121c5e..adcdf649 100644 --- a/test/javFiles/mathStruc.jav +++ b/test/javFiles/mathStruc.jav @@ -1,8 +1,6 @@ class mathStruc { -a = new mathStruc(); - mathStruc(A a) { } A model(){ A a; return a; } diff --git a/test/typeinference/JavaTXCompilerTest.java b/test/typeinference/JavaTXCompilerTest.java index fb0bd1b8..ad6eb143 100644 --- a/test/typeinference/JavaTXCompilerTest.java +++ b/test/typeinference/JavaTXCompilerTest.java @@ -34,7 +34,7 @@ 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+"mathStruc.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")); @@ -42,7 +42,7 @@ public class JavaTXCompilerTest extends JavaTXCompiler { //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+"Import.jav")); + //filesToTest.add(new File(rootDirectory+"Import.jav")); for(File f : filesToTest){ SourceFile sf = this.parse(f); System.out.println(ASTTypePrinter.print(this.sourceFiles.get(sourceFiles.size()-1)));