From 8920b3202039ff5e472753ab5a64e4ddedc32f0a Mon Sep 17 00:00:00 2001 From: JanUlrich Date: Fri, 19 Jan 2018 15:28:54 +0100 Subject: [PATCH 1/3] =?UTF-8?q?Unn=C3=B6tige=20import=20entfernen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/de/dhbwstuttgart/typeinference/assumptions/FunNClass.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/de/dhbwstuttgart/typeinference/assumptions/FunNClass.java b/src/de/dhbwstuttgart/typeinference/assumptions/FunNClass.java index 0eba225d..a04ce9bb 100644 --- a/src/de/dhbwstuttgart/typeinference/assumptions/FunNClass.java +++ b/src/de/dhbwstuttgart/typeinference/assumptions/FunNClass.java @@ -1,6 +1,5 @@ package de.dhbwstuttgart.typeinference.assumptions; -import com.sun.org.apache.regexp.internal.RE; import de.dhbwstuttgart.parser.NullToken; import de.dhbwstuttgart.parser.SyntaxTreeGenerator.GenericContext; import de.dhbwstuttgart.parser.scope.GenericTypeName; From bd0678f362759b2be935075241ac8e2b45dc0c9f Mon Sep 17 00:00:00 2001 From: JanUlrich Date: Sun, 21 Jan 2018 11:17:20 +0100 Subject: [PATCH 2/3] Lokales Repo eintragen --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index af770407..e589e3f7 100644 --- a/pom.xml +++ b/pom.xml @@ -42,7 +42,7 @@ target target/classes - ${artifactId}-${version} + ${project.artifactId}-${project.version} target/test-classes src/ test/ @@ -98,7 +98,7 @@ maven-repository - file:///${project.basedir}/target + file:///${project.basedir}/maven-repository From 63ac79f02c49665b346d0c80661d6a40c2180f1e Mon Sep 17 00:00:00 2001 From: JanUlrich Date: Mon, 28 May 2018 16:18:33 +0200 Subject: [PATCH 3/3] =?UTF-8?q?Hotfix=20f=C3=BCr=20Typparsen=20Problem?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../parser/SyntaxTreeGenerator/TypeGenerator.java | 14 ++++++++------ test/parser/PackageNameTest.jav | 9 +++++++++ 2 files changed, 17 insertions(+), 6 deletions(-) create mode 100644 test/parser/PackageNameTest.jav diff --git a/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/TypeGenerator.java b/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/TypeGenerator.java index b4923039..20846a1b 100644 --- a/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/TypeGenerator.java +++ b/src/de/dhbwstuttgart/parser/SyntaxTreeGenerator/TypeGenerator.java @@ -22,18 +22,20 @@ import java.util.List; public class TypeGenerator { public static RefTypeOrTPHOrWildcardOrGeneric convert(Java8Parser.UnannClassOrInterfaceTypeContext unannClassOrInterfaceTypeContext, JavaClassRegistry reg, GenericsRegistry generics) { - String name; - if(unannClassOrInterfaceTypeContext.unannInterfaceType_lfno_unannClassOrInterfaceType() != null){ - name = unannClassOrInterfaceTypeContext.unannInterfaceType_lfno_unannClassOrInterfaceType().unannClassType_lfno_unannClassOrInterfaceType().Identifier().getText(); - } Java8Parser.TypeArgumentsContext arguments; if(unannClassOrInterfaceTypeContext.unannClassType_lfno_unannClassOrInterfaceType() != null){ - name = unannClassOrInterfaceTypeContext.unannClassType_lfno_unannClassOrInterfaceType().Identifier().getText(); arguments = unannClassOrInterfaceTypeContext.unannClassType_lfno_unannClassOrInterfaceType().typeArguments(); }else{// if(unannClassOrInterfaceTypeContext.unannInterfaceType_lfno_unannClassOrInterfaceType() != null){ - name = unannClassOrInterfaceTypeContext.unannInterfaceType_lfno_unannClassOrInterfaceType().unannClassType_lfno_unannClassOrInterfaceType().getText(); arguments = unannClassOrInterfaceTypeContext.unannInterfaceType_lfno_unannClassOrInterfaceType().unannClassType_lfno_unannClassOrInterfaceType().typeArguments(); } + /** + * Problem sind hier die verschachtelten Typen mit verschachtelten Typargumenten + * Beispiel: Typ.InnererTyp + */ + String name = unannClassOrInterfaceTypeContext.getText(); + if(name.contains("<")){ + name = name.split("<")[0]; //Der Typ ist alles vor den ersten Argumenten + } return convertTypeName(name, arguments, unannClassOrInterfaceTypeContext.getStart(), reg, generics); } diff --git a/test/parser/PackageNameTest.jav b/test/parser/PackageNameTest.jav new file mode 100644 index 00000000..53c889b7 --- /dev/null +++ b/test/parser/PackageNameTest.jav @@ -0,0 +1,9 @@ +import java.lang.Integer; +import java.lang.Comparable; + +class PackageNameTest{ +java.lang.Integer test(a){return a;} + +Comparable test2(a){return a;} + +} \ No newline at end of file