From a7e1a5e2c2498402d00162e933877972ae8382c1 Mon Sep 17 00:00:00 2001 From: JanUlrich Date: Mon, 28 Aug 2017 18:36:26 +0200 Subject: [PATCH] Fehler beheben --- src/de/dhbwstuttgart/typedeployment/TypeInsertFactory.java | 4 ++-- test/javFiles/mathStruc.jav | 2 -- test/typeinference/JavaTXCompilerTest.java | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) 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)));