diff --git a/src/mycompiler/SourceFile.java b/src/mycompiler/SourceFile.java index 4918595d..32ffc47a 100755 --- a/src/mycompiler/SourceFile.java +++ b/src/mycompiler/SourceFile.java @@ -13,6 +13,9 @@ import java.util.Vector; import mycompiler.mybytecode.ClassFile; import mycompiler.myclass.BasicAssumptionClass; import mycompiler.myclass.Class; +import mycompiler.myclass.Constructor; +import mycompiler.myclass.Field; +import mycompiler.myclass.FieldDeclaration; import mycompiler.myclass.ImportDeclarations; import mycompiler.myclass.UsedId; import mycompiler.myexception.CTypeReconstructionException; @@ -41,6 +44,9 @@ import mycompiler.mytypereconstruction.unify.Unify; import org.apache.log4j.Logger; +import mycompiler.myclass.*; + +import mycompiler.*; import sun.reflect.generics.reflectiveObjects.NotImplementedException; import sun.reflect.generics.reflectiveObjects.TypeVariableImpl; import typinferenz.ConstraintsSet; @@ -1043,16 +1049,17 @@ public class SourceFile // ino.method.makeBasicAssumptionsFromJRE.21409.definition @Deprecated //angefügt von Andreas Stadelmeier. Grund: Die Funktion wurde neu als getBasicAssumptions angelegt - private TypeinferenceResultSet makeBasicAssumptionsFromJRE(Vector imports) + private TypeAssumptions makeBasicAssumptionsFromJRE(Vector imports) // ino.end // ino.method.makeBasicAssumptionsFromJRE.21409.body { - return null; - /* + //return null; + ///* Vector doneImports=new Vector(); - TypeinferenceResultSet basicAssumptions = new TypeinferenceResultSet(null); - + //TypeinferenceResultSet basicAssumptions = new TypeinferenceResultSet(null); + TypeAssumptions basicAssumptions = new TypeAssumptions(); + Modifiers mod = new Modifiers(); mod.addModifier(new Public()); @@ -1087,11 +1094,13 @@ public class SourceFile jreSpiderRegistry.put(tvs[j].getName(),gtv); } - BasicAssumptionClass myCl = new BasicAssumptionClass(className, mod); - + //BasicAssumptionClass myCl = new BasicAssumptionClass(className, mod); + Class parentClass = new Class(className, mod); + if(typeGenPara.size()>0){ - basicAssumptions.addGenericTypeVars(className, typeGenPara); - myCl.set_ParaList((Vector)typeGenPara); + //auskommentiert von Andreas Stadelmeier: + //basicAssumptions.addGenericTypeVars(className, typeGenPara); + parentClass.set_ParaList((Vector)typeGenPara);//myCl.set_ParaList((Vector)typeGenPara); } @@ -1125,19 +1134,20 @@ public class SourceFile } ui.set_ParaList(supertypeGenPara); ui.vParaOrg=supertypeGenPara; - myCl.set_UsedId(ui); + parentClass.set_UsedId(ui); } } - this.addElement(myCl); - - basicAssumptions.addClassName(className); + //auskommentiert von Andreas Stadelmeier + //this.addElement(myCl); + //basicAssumptions.addClassName(className); for(int j=0;j()); CInstVarTypeAssumption instVar = new CInstVarTypeAssumption(className, fields[j].getName(), new RefType(fields[j].getType().getName(),-1), MyCompiler.NO_LINENUMBER,MyCompiler.NO_LINENUMBER,new Vector()); - basicAssumptions.addFieldOrLocalVarAssumption(instVar); + //basicAssumptions.addFieldOrLocalVarAssumption(instVar); + parentClass.addField(new FieldDeclaration(0)); } } for(int j=0;j())); } - basicAssumptions.addMethodIntersectionType(new CIntersectionType(method)); + //basicAssumptions.addMethodIntersectionType(new CIntersectionType(method)); + parentClass.addField(mycompiler.myclass.Method.createEmptyMethod(methodName, parentClass)); } } @@ -1171,7 +1182,9 @@ public class SourceFile // Fixme HOTI beachte overloaded id constructor.addParaAssumption(new CParaTypeAssumption(className, methodName, constructors[j].getParameterTypes().length,0,paraType, new RefType(paraType,-1), MyCompiler.NO_LINENUMBER,MyCompiler.NO_LINENUMBER,new Vector())); } - basicAssumptions.addMethodIntersectionType(new CIntersectionType(constructor)); + //basicAssumptions.addMethodIntersectionType(new CIntersectionType(constructor)); + Method constructorMethod = mycompiler.myclass.Method.createEmptyMethod(methodName, parentClass); + parentClass.addField(new Constructor(constructorMethod)); } } @@ -1182,7 +1195,7 @@ public class SourceFile imports.addAll(doneImports); return basicAssumptions; - */ + //*/ } // ino.end