Aufräumen

This commit is contained in:
JanUlrich 2016-04-29 16:03:38 +02:00
parent d03e20df90
commit 46f1134bad
4 changed files with 9 additions and 20 deletions

View File

@ -68,7 +68,7 @@ public class ClassGenerator extends ClassGen{
//return getNearestType((TypePlaceholder) t); //return getNearestType((TypePlaceholder) t);
return new TypePlaceholderType((TypePlaceholder) t); return new TypePlaceholderType((TypePlaceholder) t);
}else{ }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){ public org.apache.commons.bcel6.generic.Type getNearestUsedType(TypePlaceholder toTPH){
@ -150,7 +150,7 @@ public class ClassGenerator extends ClassGen{
TypePlaceholder tph = it.next(); TypePlaceholder tph = it.next();
//ret += tph.getBytecodeMethodSignature(this); //ret += tph.getBytecodeMethodSignature(this);
//ret += ":"; //ret += ":";
ret += tph.getClassSignature(this, getTypeinferenceResults().getTypeReconstructions().firstElement()); ret += tph.getClassSignature(this, getTypeinferenceResults().getTypeReconstructions().get(0));
} }
ret += ">"; ret += ">";
} }

View File

@ -111,7 +111,7 @@ public class Class extends GTVDeclarationContext implements AClassOrInterface, I
} }
InstructionList fieldInitializations = new InstructionList(); InstructionList fieldInitializations = new InstructionList();
for(FieldDeclaration f : fieldDeclarations){ 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: //Die Konstruktoren müssen die Feld initialisierungswerte beinhalten:
for(Constructor c : constructors){ for(Constructor c : constructors){

View File

@ -71,19 +71,6 @@ public class ConstraintsSet extends UndMenge<Pair> implements Iterable<OderConst
}); });
} }
*/ */
/**
* Aus dem ConstraintsSet [ u1, u2, ... (OderConstraint), ... uN ] werden alle
* UndConstraints, welche sich nicht innerhalb eines OderConstraints befinden, herausgefiltert
* @return [u1, ... , uN]
*/
private Vector<UndConstraint> filterUndConstraints() {
Vector<UndConstraint> ret = new Vector<>();
for(OderConstraint con : constraintsSet){
UndConstraint filtered = con.filterUndConstraints();
if(filtered != null)ret.add(filtered);
}
return ret;
}
public void add(UndConstraint singleConstraint) { public void add(UndConstraint singleConstraint) {
OderConstraint toAdd = new OderConstraint(); OderConstraint toAdd = new OderConstraint();

View File

@ -1,5 +1,7 @@
package de.dhbwstuttgart.typeinference; package de.dhbwstuttgart.typeinference;
import java.util.List;
import de.dhbwstuttgart.bytecode.ClassGenerator; import de.dhbwstuttgart.bytecode.ClassGenerator;
import de.dhbwstuttgart.logger.Logger; import de.dhbwstuttgart.logger.Logger;
import de.dhbwstuttgart.logger.Section; import de.dhbwstuttgart.logger.Section;
@ -9,21 +11,21 @@ import de.dhbwstuttgart.syntaxtree.type.SuperWildcardType;
public class TypeinferenceResults { public class TypeinferenceResults {
private Menge<TypeinferenceResultSet> typeReconstructions; private List<TypeinferenceResultSet> typeReconstructions;
public TypeinferenceResults() { public TypeinferenceResults() {
typeReconstructions = new Menge<>(); typeReconstructions = new Menge<>();
} }
public TypeinferenceResults(Menge<TypeinferenceResultSet> typeReconstructions) { public TypeinferenceResults(List<TypeinferenceResultSet> typeReconstructions) {
this.typeReconstructions = typeReconstructions; this.typeReconstructions = typeReconstructions;
} }
public Menge<TypeinferenceResultSet> getTypeReconstructions() { public List<TypeinferenceResultSet> getTypeReconstructions() {
return typeReconstructions; return typeReconstructions;
} }
public Menge<TypeinferenceResultSet> getTypeReconstructions(Method method, ClassGenerator cg) { public List<TypeinferenceResultSet> getTypeReconstructions(Method method, ClassGenerator cg) {
return typeReconstructions; return typeReconstructions;
} }
} }