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 f010cef62..56060e9ce 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 b733e110f..9549e1374 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 3317cbeac..7e3b82214 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)); }