ObjectClass einführen
This commit is contained in:
parent
388685d3b2
commit
7d09131c27
@ -496,7 +496,7 @@ public class SourceFile
|
||||
String className=x.getName();
|
||||
|
||||
//Ermittle die Superklasse:
|
||||
Class sClass = new Class("Object",0);
|
||||
Class sClass = new ObjectClass();
|
||||
if(withSubtypes)sClass = getSuperClassOfJREClass(x, basicAssumptions);
|
||||
|
||||
// Namen von Generische Typen erzeugen
|
||||
@ -528,33 +528,6 @@ public class SourceFile
|
||||
boolean isObject=x.getSuperclass().getName().equalsIgnoreCase("java.lang.Object");
|
||||
boolean isBaseType=isBaseType(className);
|
||||
|
||||
//if((!isObject || READ_OBJECT_SUPERCLASSES_FROM_JRE) && (!isBaseType|| READ_BASE_TYPE_SUPERCLASSES_FROM_JRE))
|
||||
if (((!isObject || READ_OBJECT_SUPERCLASSES_FROM_JRE) && READ_IMPORTED_SUPERCLASSES_FROM_JRE) //eingefuegt 07-08-11
|
||||
|| (isBaseType && READ_BASE_TYPE_SUPERCLASSES_FROM_JRE))
|
||||
{
|
||||
String superclassFullyQualifiedName = x.getSuperclass().getCanonicalName();
|
||||
//Andere Methode, da Menge.contains bei Strings nicht richtig vergleicht.
|
||||
if(!containsString(imports,superclassFullyQualifiedName) && !containsString(doneImports,superclassFullyQualifiedName)){
|
||||
imports.addElement(UsedId.createFromQualifiedName(superclassFullyQualifiedName,-1));
|
||||
}
|
||||
//UsedId ui = new UsedId();
|
||||
//ui.set_Name(x.getSuperclass().getSimpleName());
|
||||
UsedId ui=UsedId.createFromQualifiedName(x.getSuperclass().getName(),-1);
|
||||
java.lang.Class superClass=x.getSuperclass();
|
||||
java.lang.reflect.TypeVariable[] superclassTVS=superClass.getTypeParameters();
|
||||
Menge<Type> supertypeGenPara = new Menge<Type>();
|
||||
for(int tvi=0;tvi<superclassTVS.length;tvi++){
|
||||
GenericTypeVar newGTV=new GenericTypeVar(superclassTVS[tvi].getName(),parentClass,-1);
|
||||
supertypeGenPara.addElement(newGTV);
|
||||
}
|
||||
|
||||
if(supertypeGenPara.size()==0){
|
||||
supertypeGenPara=null;
|
||||
}
|
||||
ui.set_ParaList(supertypeGenPara);
|
||||
ui.vParaOrg=supertypeGenPara;
|
||||
parentClass.set_UsedId(ui);
|
||||
}
|
||||
}
|
||||
|
||||
//auskommentiert von Andreas Stadelmeier
|
||||
@ -636,7 +609,7 @@ public class SourceFile
|
||||
Class ret;
|
||||
java.lang.Class s = x.getSuperclass();
|
||||
if(s == null){
|
||||
return new Class("java.lang.Object",new Modifiers(), 0);
|
||||
return new ObjectClass();
|
||||
}
|
||||
|
||||
Menge<String> supertypeGenPara = new Menge<>();//Die Generischen Parameter für die Superklasse berechnen:
|
||||
|
@ -51,16 +51,6 @@ public class FunVoidN extends FunN {
|
||||
this.name = new JavaClassName("FunVoid"+T.size());
|
||||
}
|
||||
|
||||
/**
|
||||
* Muss nach jeder Ãnderung von T oder R aufgerufen werden.
|
||||
* Dabei werden bestimmte, von RefType geerbte, Parameter angepasst. Dies ist wichtig für den Typinferenzalgorithmus.
|
||||
*/
|
||||
private void calculateNewParalist(){
|
||||
Menge<Type> t = new Menge<Type>();
|
||||
if(T!=null)t.addAll(T);
|
||||
this.set_ParaList(t);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Type TYPE(TypeAssumptions ass, SyntaxTreeNode parent){
|
||||
//FunN Typen müssen nicht geprüft werden. Sie werden schließlich nur von unserem Typinferenzalgorithmus erstellt:
|
||||
|
Loading…
Reference in New Issue
Block a user