Fehler beim Umwandeln von Generischen Variablen zu TPH beseitigt

This commit is contained in:
JanUlrich 2014-07-16 16:40:49 +02:00
parent f059e0b9b8
commit df67185b45
2 changed files with 23 additions and 2 deletions

View File

@ -182,7 +182,7 @@ public class GenericTypeVar extends Type
public TypePlaceholder getTypePlaceHolder() {
if(!GenericTypeVar.tph.containsKey(this)){
GenericTypeVar.tph.put(this, TypePlaceholder.fresh());
GenericTypeVar.tph.put(this, TypePlaceholder.fresh(this.getName()));
}
return GenericTypeVar.tph.get(this);
//if(this.tph == null)this.tph = TypePlaceholder.fresh();

View File

@ -101,6 +101,27 @@ public class TypePlaceholder extends Type implements IReplaceTypeEventProvider
}
// ino.end
/**
* Generiert einen neuen TPH mit einem bestimmten Namen.
* Wird benötigt, wenn aus Generischen Variablen TPH generiert werden.
* @param name
* @return
*/
public static TypePlaceholder fresh(String name)
// ino.end
// ino.method.fresh.26800.body
{
TypePlaceholder typeVar = new TypePlaceholder(name);
TypePlaceholder oldTPH = m_TypePlaceholdersRegistry.put(typeVar.getName(), typeVar);
if(oldTPH != null){
oldTPH.name = makeNewName();
m_TypePlaceholdersRegistry.put(oldTPH.getName(), oldTPH);
}
return typeVar;
}
// ino.end
/**
* @author Andreas Stadelmeier, a10023
* Ruft die TypePlaceholder.fresh()-Methode auf.