diff --git a/src/de/dhbwstuttgart/bytecode/ClassGenerator.java b/src/de/dhbwstuttgart/bytecode/ClassGenerator.java index 393d2e6e..decb0f8b 100644 --- a/src/de/dhbwstuttgart/bytecode/ClassGenerator.java +++ b/src/de/dhbwstuttgart/bytecode/ClassGenerator.java @@ -68,7 +68,7 @@ public class ClassGenerator extends ClassGen{ //return getNearestType((TypePlaceholder) t); return new TypePlaceholderType((TypePlaceholder) t); }else{ - return t.getBytecodeType(this, getTypeinferenceResults().getTypeReconstructions().firstElement()); + return t.getBytecodeType(this, getTypeinferenceResults().getTypeReconstructions().get(0)); } } public org.apache.commons.bcel6.generic.Type getNearestUsedType(TypePlaceholder toTPH){ @@ -150,7 +150,7 @@ public class ClassGenerator extends ClassGen{ TypePlaceholder tph = it.next(); //ret += tph.getBytecodeMethodSignature(this); //ret += ":"; - ret += tph.getClassSignature(this, getTypeinferenceResults().getTypeReconstructions().firstElement()); + ret += tph.getClassSignature(this, getTypeinferenceResults().getTypeReconstructions().get(0)); } ret += ">"; } diff --git a/src/de/dhbwstuttgart/syntaxtree/Class.java b/src/de/dhbwstuttgart/syntaxtree/Class.java index 5c46d450..7e6ce461 100755 --- a/src/de/dhbwstuttgart/syntaxtree/Class.java +++ b/src/de/dhbwstuttgart/syntaxtree/Class.java @@ -111,7 +111,7 @@ public class Class extends GTVDeclarationContext implements AClassOrInterface, I } InstructionList fieldInitializations = new InstructionList(); for(FieldDeclaration f : fieldDeclarations){ - fieldInitializations.append(f.genByteCode(_cg, typeinferenceResults.getTypeReconstructions().firstElement())); + fieldInitializations.append(f.genByteCode(_cg, typeinferenceResults.getTypeReconstructions().get(0))); } //Die Konstruktoren müssen die Feld initialisierungswerte beinhalten: for(Constructor c : constructors){ diff --git a/src/de/dhbwstuttgart/typeinference/ConstraintsSet.java b/src/de/dhbwstuttgart/typeinference/ConstraintsSet.java index e9f9918d..dd4a2ff1 100755 --- a/src/de/dhbwstuttgart/typeinference/ConstraintsSet.java +++ b/src/de/dhbwstuttgart/typeinference/ConstraintsSet.java @@ -71,19 +71,6 @@ public class ConstraintsSet extends UndMenge implements Iterable filterUndConstraints() { - Vector ret = new Vector<>(); - for(OderConstraint con : constraintsSet){ - UndConstraint filtered = con.filterUndConstraints(); - if(filtered != null)ret.add(filtered); - } - return ret; - } public void add(UndConstraint singleConstraint) { OderConstraint toAdd = new OderConstraint(); diff --git a/src/de/dhbwstuttgart/typeinference/TypeinferenceResults.java b/src/de/dhbwstuttgart/typeinference/TypeinferenceResults.java index 5ce7a445..d4f01d53 100644 --- a/src/de/dhbwstuttgart/typeinference/TypeinferenceResults.java +++ b/src/de/dhbwstuttgart/typeinference/TypeinferenceResults.java @@ -1,5 +1,7 @@ package de.dhbwstuttgart.typeinference; +import java.util.List; + import de.dhbwstuttgart.bytecode.ClassGenerator; import de.dhbwstuttgart.logger.Logger; import de.dhbwstuttgart.logger.Section; @@ -9,21 +11,21 @@ import de.dhbwstuttgart.syntaxtree.type.SuperWildcardType; public class TypeinferenceResults { - private Menge typeReconstructions; + private List typeReconstructions; public TypeinferenceResults() { typeReconstructions = new Menge<>(); } - public TypeinferenceResults(Menge typeReconstructions) { + public TypeinferenceResults(List typeReconstructions) { this.typeReconstructions = typeReconstructions; } - public Menge getTypeReconstructions() { + public List getTypeReconstructions() { return typeReconstructions; } - public Menge getTypeReconstructions(Method method, ClassGenerator cg) { + public List getTypeReconstructions(Method method, ClassGenerator cg) { return typeReconstructions; } } \ No newline at end of file