Fehler in get_ParaList behoben

This commit is contained in:
JanUlrich 2014-09-09 17:47:57 +02:00
parent 81d9d3ab64
commit 45ea59e7ad
3 changed files with 13 additions and 7 deletions

View File

@ -111,7 +111,7 @@ public class RefType extends Type implements IMatchable
super(offset); super(offset);
// otth: Copy-Konstruktor // otth: Copy-Konstruktor
this.setName(R.getTypeName()); this.setName(R.getTypeName());
this.set_ParaList(R.get_ParaList()); this.set_ParaList(R.getParaList());
} }
// ino.end // ino.end
@ -332,15 +332,23 @@ public class RefType extends Type implements IMatchable
} }
// ino.end // ino.end
/**
* @return gibt bei leere Parameterliste null zurück. Ist entscheidend für unify-Algorithmus
*/
// ino.method.get_ParaList.26664.definition // ino.method.get_ParaList.26664.definition
public Vector<Type> get_ParaList() public Vector<Type> get_ParaList()
// ino.end // ino.end
// ino.method.get_ParaList.26664.body // ino.method.get_ParaList.26664.body
{ {
if(this.parameter == null || this.parameter.size()==0)return null;
return this.parameter; return this.parameter;
} }
// ino.end // ino.end
public Vector<Type> getParaList(){
return this.parameter;
}
// ino.method.add_Parameter.26667.definition // ino.method.add_Parameter.26667.definition
public void add_Parameter(Type o) public void add_Parameter(Type o)
// ino.end // ino.end
@ -737,9 +745,9 @@ public class RefType extends Type implements IMatchable
@Override @Override
public JavaCodeResult printJavaCode(ResultSet resultSet) { public JavaCodeResult printJavaCode(ResultSet resultSet) {
JavaCodeResult ret = new JavaCodeResult(this.name.toString()); JavaCodeResult ret = new JavaCodeResult(this.name.toString());
if(this.get_ParaList()!=null && this.get_ParaList().size()>0){ if(this.getParaList()!=null && this.getParaList().size()>0){
ret .attach( "<" ); ret .attach( "<" );
Iterator<Type> it = this.get_ParaList().iterator(); Iterator<Type> it = this.getParaList().iterator();
while(it.hasNext()){ while(it.hasNext()){
Type t = it.next(); Type t = it.next();
ret .attach( t.printJavaCode(resultSet)); ret .attach( t.printJavaCode(resultSet));

View File

@ -301,7 +301,7 @@ public class TypeAssumptions {
if(match && t instanceof RefType){ if(match && t instanceof RefType){
RefType tr = (RefType)t; RefType tr = (RefType)t;
RefType ret = ass.getAssumedClass().getType(); //Dadurch erhält der RefType den vollen Namen (bsp. java.lang.Integer) RefType ret = ass.getAssumedClass().getType(); //Dadurch erhält der RefType den vollen Namen (bsp. java.lang.Integer)
ret.set_ParaList(tr.get_ParaList()); ret.set_ParaList(tr.getParaList());
return new ConstraintType(ret); return new ConstraintType(ret);
} }
} }

View File

@ -7,9 +7,7 @@ import java.util.Enumeration;
import java.util.Hashtable; import java.util.Hashtable;
import java.util.Iterator; import java.util.Iterator;
import java.util.Vector; import java.util.Vector;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import de.dhbwstuttgart.core.MyCompiler; import de.dhbwstuttgart.core.MyCompiler;
import de.dhbwstuttgart.myexception.CTypeReconstructionException; import de.dhbwstuttgart.myexception.CTypeReconstructionException;
import de.dhbwstuttgart.myexception.MatchException; import de.dhbwstuttgart.myexception.MatchException;