From 383e5bd883b7dc60d25b7735c128bfb111363ef7 Mon Sep 17 00:00:00 2001 From: JanUlrich Date: Tue, 7 Oct 2014 17:47:23 +0200 Subject: [PATCH] NullPointerException in Unify beseitigt --- src/de/dhbwstuttgart/syntaxtree/type/RefType.java | 1 - .../typeinference/assumptions/TypeAssumptions.java | 1 - src/de/dhbwstuttgart/typeinference/unify/Unify.java | 4 ++++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/de/dhbwstuttgart/syntaxtree/type/RefType.java b/src/de/dhbwstuttgart/syntaxtree/type/RefType.java index f010cef6..56060e9c 100755 --- a/src/de/dhbwstuttgart/syntaxtree/type/RefType.java +++ b/src/de/dhbwstuttgart/syntaxtree/type/RefType.java @@ -24,7 +24,6 @@ import de.dhbwstuttgart.typeinference.assumptions.TypeAssumptions; import de.dhbwstuttgart.typeinference.exceptions.TypeinferenceException; import de.dhbwstuttgart.typeinference.unify.CSubstitutionGenVar; import de.dhbwstuttgart.typeinference.unify.CSubstitutionSet; -import sun.reflect.generics.reflectiveObjects.NotImplementedException; diff --git a/src/de/dhbwstuttgart/typeinference/assumptions/TypeAssumptions.java b/src/de/dhbwstuttgart/typeinference/assumptions/TypeAssumptions.java index b733e110..9549e137 100755 --- a/src/de/dhbwstuttgart/typeinference/assumptions/TypeAssumptions.java +++ b/src/de/dhbwstuttgart/typeinference/assumptions/TypeAssumptions.java @@ -16,7 +16,6 @@ import de.dhbwstuttgart.typeinference.FunN; import de.dhbwstuttgart.typeinference.FunNInterface; import de.dhbwstuttgart.typeinference.FunNMethod; import de.dhbwstuttgart.typeinference.exceptions.TypeinferenceException; -import sun.reflect.generics.reflectiveObjects.NotImplementedException; /** * Eine Sammlung von TypeAssumptions. diff --git a/src/de/dhbwstuttgart/typeinference/unify/Unify.java b/src/de/dhbwstuttgart/typeinference/unify/Unify.java index 3317cbea..7e3b8221 100755 --- a/src/de/dhbwstuttgart/typeinference/unify/Unify.java +++ b/src/de/dhbwstuttgart/typeinference/unify/Unify.java @@ -1068,6 +1068,10 @@ throws MatchException for(int i=0; i < FCtype.get_ParaList().size(); i++) { if (FCtype.get_ParaList().elementAt(i) instanceof GenericTypeVar) { inferencelog.debug("PUT"); + //TODO Auf Korrektheit prüfen: + if(tomatch.getParaList().size() != FCtype.getParaList().size()){ + throw new MatchException("Different Parameter Sizes!"); + }//Angefügt von Andreas Stadelmeier (ENDE) ht.put(((GenericTypeVar)FCtype.get_ParaList().elementAt(i)).getName(), tomatch.get_ParaList().elementAt(i)); }