You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by va...@apache.org on 2007/06/09 16:19:00 UTC

svn commit: r545750 [1/2] - in /harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc: java/lang/ java/lang/reflect/ org/apache/harmony/lang/reflect/parser/

Author: varlax
Date: Sat Jun  9 07:18:59 2007
New Revision: 545750

URL: http://svn.apache.org/viewvc?view=rev&rev=545750
Log:
Applied partial fix to HARMONY-2052 [drlvm][kernel] Improve/re-implement a parser of generic signatures

Modified:
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/Class.java
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/reflect/Constructor.java
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/reflect/Field.java
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/reflect/Method.java
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/org/apache/harmony/lang/reflect/parser/Parser.java

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/Class.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/Class.java?view=diff&rev=545750&r1=545749&r2=545750
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/Class.java (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/Class.java Sat Jun  9 07:18:59 2007
@@ -24,24 +24,21 @@
 
 import java.io.InputStream;
 import java.io.Serializable;
+import java.lang.annotation.Annotation;
+import java.lang.annotation.Inherited;
 import java.lang.ref.SoftReference;
+import java.lang.reflect.AnnotatedElement;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Field;
+import java.lang.reflect.GenericDeclaration;
+import java.lang.reflect.GenericSignatureFormatError;
 import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.MalformedParameterizedTypeException;
 import java.lang.reflect.Member;
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
-
-import java.lang.reflect.AnnotatedElement;
-import java.lang.reflect.GenericDeclaration;
-import java.lang.reflect.GenericSignatureFormatError;
-import java.lang.reflect.MalformedParameterizedTypeException;
-import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
 import java.lang.reflect.TypeVariable;
-import java.lang.annotation.Annotation;
-import java.lang.annotation.Inherited;
-
 import java.net.URL;
 import java.security.AccessController;
 import java.security.AllPermission;
@@ -53,32 +50,11 @@
 import java.util.LinkedHashSet;
 import java.util.Map;
 
-
-import org.apache.harmony.lang.reflect.parser.InterimClassGenericDecl;
-import org.apache.harmony.lang.reflect.parser.Parser;
-import org.apache.harmony.lang.reflect.parser.Parser.SignatureKind;
-import org.apache.harmony.lang.reflect.parser.InterimParameterizedType;
-import org.apache.harmony.lang.reflect.parser.InterimType;
-import org.apache.harmony.lang.reflect.parser.InterimClassType;
-import org.apache.harmony.lang.reflect.parser.InterimTypeParameter;
-
-import org.apache.harmony.lang.reflect.repository.TypeVariableRepository;
-import org.apache.harmony.lang.reflect.repository.ParameterizedTypeRepository;
- 
-import org.apache.harmony.lang.reflect.support.AuxiliaryChecker;
-import org.apache.harmony.lang.reflect.support.AuxiliaryLoader;
-import org.apache.harmony.lang.reflect.support.AuxiliaryFinder;
-import org.apache.harmony.lang.reflect.support.AuxiliaryCreator;
-import org.apache.harmony.lang.reflect.support.AuxiliaryUtil;
- 
-import org.apache.harmony.lang.reflect.implementation.TypeVariableImpl;
-import org.apache.harmony.lang.reflect.implementation.ParameterizedTypeImpl;
-
-
 import org.apache.harmony.lang.RuntimePermissionCollection;
 import org.apache.harmony.lang.reflect.Reflection;
-import org.apache.harmony.vm.VMStack;
+import org.apache.harmony.lang.reflect.parser.Parser;
 import org.apache.harmony.vm.VMGenericsAndAnnotations;
+import org.apache.harmony.vm.VMStack;
 
 /**
  * @com.intel.drl.spec_ref
@@ -1399,62 +1375,8 @@
         }
         
         public synchronized Type[] getGenericInterfaces() {
-            if (genericInterfaces != null) {
-                return genericInterfaces;
-            }
-                
-            //So, here it can be only ParameterizedType or ordinary reference class type elements.
-            if (Class.this.isArray()) {
-                return genericInterfaces = new Type[]{Cloneable.class, Serializable.class};
-            }
             if (genericInterfaces == null) {
-                Object startPoint = (Object) Class.this;  // It should be this class itself because, for example, an interface may be a parameterized type with parameters which are the generic parameters of this class
-                String signature = AuxiliaryUtil.toUTF8(VMGenericsAndAnnotations.getSignature(Class.this)); // getting this class signature
-                if (signature == null) {
-                    return genericInterfaces = Class.this.getInterfaces();
-                }
-                InterimClassGenericDecl decl = (InterimClassGenericDecl) Parser.parseSignature(signature, SignatureKind.CLASS_SIGNATURE, (GenericDeclaration)startPoint); //GenericSignatureFormatError can be thrown here
-                InterimType[] superInterfaces = decl.superInterfaces;
-                if (superInterfaces == null) {
-                    return genericInterfaces =  Class.this.getInterfaces();
-                }
-                int l = superInterfaces.length;
-                genericInterfaces = new Type[l];
-                for (int i = 0; i < l; i++) { 
-                    if (superInterfaces[i] instanceof InterimParameterizedType) {
-                        ParameterizedType pType = ParameterizedTypeRepository.findParameterizedType((InterimParameterizedType) superInterfaces[i], ((InterimParameterizedType) superInterfaces[i]).signature, startPoint);
-                        if (pType == null) {
-                            try {
-                                AuxiliaryFinder.findGenericClassDeclarationForParameterizedType((InterimParameterizedType) superInterfaces[i], startPoint);
-                            } catch(Throwable e) {
-                                throw new TypeNotPresentException(((InterimParameterizedType) superInterfaces[i]).rawType.classTypeName.substring(1).replace('/', '.'), e);
-                            }
-                            //check the correspondence of the formal parameter number and the actual argument number:
-                            AuxiliaryChecker.checkArgsNumber((InterimParameterizedType) superInterfaces[i], startPoint); // the MalformedParameterizedTypeException may raise here
-                            try {
-                                pType = new ParameterizedTypeImpl(AuxiliaryCreator.createTypeArgs((InterimParameterizedType) superInterfaces[i], startPoint), AuxiliaryCreator.createRawType((InterimParameterizedType) superInterfaces[i], startPoint), AuxiliaryCreator.createOwnerType((InterimParameterizedType) superInterfaces[i], startPoint));
-                            } catch(ClassNotFoundException e) {
-                                throw new TypeNotPresentException(e.getMessage(), e);
-                            }
-                            ParameterizedTypeRepository.registerParameterizedType(pType, (InterimParameterizedType) superInterfaces[i], signature, startPoint);
-                        }
-                        genericInterfaces[i] = (Type) pType; 
-                    } else if (superInterfaces[i] instanceof InterimClassType) {
-                        try {
-                            if(Class.this.getClass().getClassLoader() != null){
-                                genericInterfaces[i] = (Type) Class.this.getClass().getClassLoader().findClass(AuxiliaryFinder.transform(((InterimClassType)superInterfaces[i]).classTypeName.substring(1).replace('/', '.'))); // XXX: should we propagate the class loader of initial user's request (Field.getGenericType()) or use this one?
-                            } else {
-                                genericInterfaces[i] = (Type) AuxiliaryLoader.ersatzLoader.findClass(AuxiliaryFinder.transform(((InterimClassType)superInterfaces[i]).classTypeName.substring(1).replace('/', '.'))); // XXX: should we propagate the class loader of initial user's request (Field.getGenericType()) or use this one?
-                            }
-                        } catch (ClassNotFoundException e) {
-                            throw new TypeNotPresentException(((InterimClassType)superInterfaces[i]).classTypeName.substring(1).replace('/', '.'), e);
-                        } catch (ExceptionInInitializerError e) {
-                        } catch (LinkageError e) {
-                        }
-                    } else {
-                        // Internal Error
-                    }
-                }
+                genericInterfaces = Parser.getGenericInterfaces(Class.this, VMGenericsAndAnnotations.getSignature(Class.this));
             }
             return genericInterfaces;
         }
@@ -1462,71 +1384,16 @@
         public Type getGenericSuperclass() {
             //So, here it can be only ParameterizedType or ordinary reference class type
             if (genericSuperclass == null) {
-                Object startPoint = (Object) Class.this;  // It should be this class itself because, for example, superclass may be a parameterized type with parameters which are the generic parameters of this class
-                String signature = AuxiliaryUtil.toUTF8(VMGenericsAndAnnotations.getSignature(Class.this)); // getting this class signature
-                if (signature == null) {
-                    return genericSuperclass = Class.this.getSuperclass();
-                }
-                InterimClassGenericDecl decl = (InterimClassGenericDecl) Parser.parseSignature(signature, SignatureKind.CLASS_SIGNATURE, (GenericDeclaration)startPoint); // GenericSignatureFormatError can be thrown here
-                InterimType superClassType = decl.superClass;
-                if (superClassType == null) {
-                    return genericSuperclass = Class.this.getSuperclass();
-                }
-                if (superClassType instanceof InterimParameterizedType) {
-                    ParameterizedType pType = ParameterizedTypeRepository.findParameterizedType((InterimParameterizedType) superClassType, ((InterimParameterizedType) superClassType).signature, startPoint);
-                    if (pType == null) {
-                        try {
-                            AuxiliaryFinder.findGenericClassDeclarationForParameterizedType((InterimParameterizedType) superClassType, startPoint);
-                        } catch(Throwable e) {
-                            throw new TypeNotPresentException(((InterimParameterizedType) superClassType).rawType.classTypeName.substring(1).replace('/', '.'), e);
-                        }
-                        //check the correspondence of the formal parameter number and the actual argument number:
-                        AuxiliaryChecker.checkArgsNumber((InterimParameterizedType) superClassType, startPoint); // the MalformedParameterizedTypeException may raise here
-                        try {
-                            pType = new ParameterizedTypeImpl(AuxiliaryCreator.createTypeArgs((InterimParameterizedType) superClassType, startPoint), AuxiliaryCreator.createRawType((InterimParameterizedType) superClassType, startPoint), AuxiliaryCreator.createOwnerType((InterimParameterizedType) superClassType, startPoint));
-                        } catch(ClassNotFoundException e) {
-                            throw new TypeNotPresentException(e.getMessage(), e);
-                        }
-                        ParameterizedTypeRepository.registerParameterizedType(pType, (InterimParameterizedType) superClassType, signature, startPoint);
-                    }
-                    genericSuperclass = (Type) pType; 
-                } else if (superClassType instanceof InterimClassType) {
-                    try {
-                        genericSuperclass = (Type) Class.this.getClass().getClassLoader().findClass(AuxiliaryFinder.transform(((InterimClassType)superClassType).classTypeName.substring(1).replace('/', '.'))); // XXX: should we propagate the class loader of initial user's request (Field.getGenericType()) or use this one?
-                    } catch (ClassNotFoundException e) {
-                        throw new TypeNotPresentException(((InterimClassType)superClassType).classTypeName.substring(1).replace('/', '.'), e);
-                    } catch (ExceptionInInitializerError e) {
-                    } catch (LinkageError e) {
-                    }
-                } else {
-                    // Internal Error
-                }
+                genericSuperclass = Parser.getGenericSuperClass(Class.this, VMGenericsAndAnnotations.getSignature(Class.this));
             }
             return genericSuperclass;
         }
 
         @SuppressWarnings("unchecked")
         public synchronized TypeVariable<Class<T>>[] getTypeParameters() {
-            //So, here it can be only TypeVariable elements.
-            if (typeParameters == null) {
-                Object startPoint = (Object) Class.this;
-                String signature = AuxiliaryUtil.toUTF8(VMGenericsAndAnnotations.getSignature(Class.this)); // getting this class signature
-                if (signature == null) {
-                    return typeParameters = new TypeVariable[0];
-                }
-                InterimClassGenericDecl decl = (InterimClassGenericDecl) Parser.parseSignature(signature, SignatureKind.CLASS_SIGNATURE, (GenericDeclaration)startPoint); // GenericSignatureFormatError can be thrown here
-                InterimTypeParameter[] pTypeParameters = decl.typeParameters;
-                if (pTypeParameters == null) {
-                    return typeParameters =  new TypeVariable[0];
-                }
-                int l = pTypeParameters.length;
-                typeParameters = new TypeVariable[l];
-                for (int i = 0; i < l; i++) {
-                    String tvName = pTypeParameters[i].typeParameterName;
-                    TypeVariable variable = new TypeVariableImpl((GenericDeclaration)Class.this, tvName, decl.typeParameters[i]);
-                    TypeVariableRepository.registerTypeVariable(variable, tvName, startPoint);
-                    typeParameters[i] = variable;               
-                }
+            if(typeParameters == null){
+                typeParameters = Parser.getTypeParameters(Class.this,
+                        VMGenericsAndAnnotations.getSignature(Class.this));
             }
             return typeParameters;
         }

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/reflect/Constructor.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/reflect/Constructor.java?view=diff&rev=545750&r1=545749&r2=545750
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/reflect/Constructor.java (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/reflect/Constructor.java Sat Jun  9 07:18:59 2007
@@ -21,36 +21,15 @@
 
 package java.lang.reflect;
 
-import static org.apache.harmony.vm.ClassFormat.ACC_VARARGS;
 import static org.apache.harmony.vm.ClassFormat.ACC_SYNTHETIC;
+import static org.apache.harmony.vm.ClassFormat.ACC_VARARGS;
 
 import java.lang.annotation.Annotation;
 import java.util.Arrays;
 
 import org.apache.harmony.lang.reflect.parser.Parser;
-import org.apache.harmony.lang.reflect.parser.Parser.SignatureKind;
-import org.apache.harmony.lang.reflect.parser.InterimParameterizedType;
-import org.apache.harmony.lang.reflect.parser.InterimTypeVariable;
-import org.apache.harmony.lang.reflect.parser.InterimType;
-import org.apache.harmony.lang.reflect.parser.InterimClassType;
-import org.apache.harmony.lang.reflect.parser.InterimTypeParameter;
-import org.apache.harmony.lang.reflect.parser.InterimGenericArrayType;
-import org.apache.harmony.lang.reflect.parser.InterimConstructorGenericDecl;
-
-import org.apache.harmony.lang.reflect.repository.TypeVariableRepository;
-import org.apache.harmony.lang.reflect.repository.ParameterizedTypeRepository;
-
-import org.apache.harmony.lang.reflect.support.AuxiliaryFinder;
-import org.apache.harmony.lang.reflect.support.AuxiliaryCreator;
-import org.apache.harmony.lang.reflect.support.AuxiliaryChecker;
-import org.apache.harmony.lang.reflect.support.AuxiliaryLoader;
-import org.apache.harmony.lang.reflect.support.AuxiliaryUtil;
-
-import org.apache.harmony.lang.reflect.implementation.TypeVariableImpl;
-import org.apache.harmony.lang.reflect.implementation.ParameterizedTypeImpl;
-
-import org.apache.harmony.vm.VMStack;
 import org.apache.harmony.vm.VMGenericsAndAnnotations;
+import org.apache.harmony.vm.VMStack;
 
 /**
 * @com.intel.drl.spec_ref 
@@ -108,7 +87,8 @@
     */
     public Type[] getGenericExceptionTypes() throws GenericSignatureFormatError, TypeNotPresentException, MalformedParameterizedTypeException {
         if (data.genericExceptionTypes == null) {
-            data.initGenericExceptionTypes();
+            data.genericExceptionTypes = Parser.getGenericExceptionTypes(this, VMGenericsAndAnnotations
+                    .getSignature(data.vm_member_id));
         }
 
         return (Type[])data.genericExceptionTypes.clone();
@@ -119,7 +99,7 @@
     */
     public Type[] getGenericParameterTypes() throws GenericSignatureFormatError, TypeNotPresentException, MalformedParameterizedTypeException {
         if (data.genericParameterTypes == null) {
-            data.initGenericParameterTypes();
+            data.genericParameterTypes = Parser.getGenericParameterTypes(this, VMGenericsAndAnnotations.getSignature(data.vm_member_id));
         }
 
         return (Type[])data.genericParameterTypes.clone();
@@ -128,11 +108,14 @@
     /**
     *  @com.intel.drl.spec_ref
     */
+    @SuppressWarnings("unchecked")
     public TypeVariable<Constructor<T>>[] getTypeParameters() throws GenericSignatureFormatError {
         if (data.typeParameters == null) {
-            data.initTypeParameters();
+            data.typeParameters = (TypeVariable<Constructor<T>>[])
+                    Parser.getTypeParameters(this, VMGenericsAndAnnotations
+                    .getSignature(data.vm_member_id));
         }
-        return (TypeVariable<Constructor<T>>[])data.typeParameters.clone();
+        return (TypeVariable<Constructor<T>>[]) data.typeParameters.clone();
     }
 
     /**
@@ -142,10 +125,11 @@
         StringBuilder sb = new StringBuilder(80);
         // data initialization
         if (data.genericParameterTypes == null) {
-            data.initGenericParameterTypes();
+            data.genericParameterTypes = Parser.getGenericParameterTypes(this, VMGenericsAndAnnotations.getSignature(data.vm_member_id));
         }
         if (data.genericExceptionTypes == null) {
-            data.initGenericExceptionTypes();
+            data.genericExceptionTypes = Parser.getGenericExceptionTypes(this, VMGenericsAndAnnotations
+                    .getSignature(data.vm_member_id));
         }
         // append modifiers if any
         int modifier = getModifiers();
@@ -347,16 +331,6 @@
          * information about this constructor object
          */
         final long vm_member_id;
-        
-        /**
-         * constructor generic signature
-         */
-        String constrSignature;
-
-        /**
-         * constructor generic declaration
-         */
-        InterimConstructorGenericDecl constrGenDecl;
 
         Annotation[] declaredAnnotations;
 
@@ -415,147 +389,6 @@
             return exceptionTypes;
         }
 
-        /**
-         * initializes generalized exeptions
-         */
-        public synchronized void initGenericExceptionTypes() {
-			//So, here it can be ParameterizedType or TypeVariable or ordinary reference class type elements.
-            if (genericExceptionTypes == null) {
-				Object startPoint = Constructor.this; 
-				if (constrSignature == null) {
-                    constrSignature = AuxiliaryUtil.toUTF8(VMGenericsAndAnnotations.getSignature(vm_member_id)); // getting this method signature
-					if (constrSignature == null) {
-						genericExceptionTypes = getExceptionTypes();
-						return;
-					}
-				}
-				if (constrGenDecl == null) {
-					// constrSignature&constrGenDecl is also the "hard" way to rethrow GenericSignatureFormatError each time for a while
-                    constrGenDecl =  (InterimConstructorGenericDecl) Parser.parseSignature(constrSignature, SignatureKind.CONSTRUCTOR_SIGNATURE, (GenericDeclaration)startPoint); // GenericSignatureFormatError can be thrown here
-				}
-                InterimType[] throwns = constrGenDecl.throwns;
-				if (throwns == null) {
-					genericExceptionTypes = getExceptionTypes();
-					return;
-				}
-				int l = throwns.length;
-				genericExceptionTypes = new Type[l];
-				for (int i = 0; i < l; i++) {
-                    if (throwns[i] instanceof InterimParameterizedType) {
-                        ParameterizedType pType = ParameterizedTypeRepository.findParameterizedType((InterimParameterizedType) throwns[i], ((InterimParameterizedType) throwns[i]).signature, startPoint);
-						if (pType == null) {
-							try {
-                                AuxiliaryFinder.findGenericClassDeclarationForParameterizedType((InterimParameterizedType) throwns[i], startPoint);
-							} catch(Throwable e) {
-                                throw new TypeNotPresentException(((InterimParameterizedType) throwns[i]).rawType.classTypeName.substring(1).replace('/', '.'), e);
-							}
-							//check the correspondence of the formal parameter number and the actual argument number:
-                            AuxiliaryChecker.checkArgsNumber((InterimParameterizedType) throwns[i], startPoint); // the MalformedParameterizedTypeException may raise here
-							try {
-                                pType = new ParameterizedTypeImpl(AuxiliaryCreator.createTypeArgs((InterimParameterizedType) throwns[i], startPoint), AuxiliaryCreator.createRawType((InterimParameterizedType) throwns[i], startPoint), AuxiliaryCreator.createOwnerType((InterimParameterizedType) throwns[i], startPoint));
-							} catch(ClassNotFoundException e) {
-								throw new TypeNotPresentException(e.getMessage(), e);
-							}
-                            ParameterizedTypeRepository.registerParameterizedType(pType, (InterimParameterizedType) throwns[i], ((InterimParameterizedType) throwns[i]).signature, startPoint);
-						}
-						genericExceptionTypes[i] = (Type) pType; 
-                    } else if (throwns[i] instanceof InterimClassType) {
-						try {
-                            genericExceptionTypes[i] = (Type) AuxiliaryLoader.ersatzLoader.findClass(((InterimClassType)throwns[i]).classTypeName.substring(1).replace('/', '.')); // XXX: should we propagate the class loader of initial user's request (Field.getGenericType()) or use this one?
-						} catch (ClassNotFoundException e) {
-                            throw new TypeNotPresentException(((InterimClassType)throwns[i]).classTypeName.substring(1).replace('/', '.'), e);
-						} catch (ExceptionInInitializerError e) {
-						} catch (LinkageError e) {
-						}
-                    } else if (throwns[i] instanceof InterimTypeVariable) {
-                        String tvName = ((InterimTypeVariable) throwns[i]).typeVariableName;
-                        TypeVariable variable = TypeVariableRepository.findTypeVariable(tvName, startPoint);
-						if (variable == null) {
-                            variable =  AuxiliaryFinder.findTypeVariable(tvName, startPoint);
-							if (variable == null) {
-								genericExceptionTypes[i] = (Type) null;
-								break;
-							}
-						}
-						genericExceptionTypes[i] = (Type) variable;
-					} else {
-						// Internal Error
-					}
-				}
-            }
-        }
-
-        /**
-         * initializes generalized parameters
-         */
-        public synchronized void initGenericParameterTypes() {
-			//So, here it can be ParameterizedType or TypeVariable or ordinary reference class type elements.
-            if (genericParameterTypes == null) {
-				Object startPoint = Constructor.this;
-				if (constrSignature == null) {
-                    constrSignature = AuxiliaryUtil.toUTF8(VMGenericsAndAnnotations.getSignature(vm_member_id)); // getting this method signature
-					if (constrSignature == null) {
-						genericParameterTypes = getParameterTypes();
-						return;
-					}
-				}
-				if (constrGenDecl == null) {
-                    constrGenDecl =  (InterimConstructorGenericDecl) Parser.parseSignature(constrSignature, SignatureKind.CONSTRUCTOR_SIGNATURE, (GenericDeclaration)startPoint); // GenericSignatureFormatError can be thrown here
-				}
-                InterimType[] methodParameters = constrGenDecl.methodParameters;
-				if (methodParameters == null) {
-					genericParameterTypes = new Type[0];
-					return;
-				}
-				int l = methodParameters.length;
-				genericParameterTypes = new Type[l];
-				for (int i = 0; i < l; i++) {
-                    if (methodParameters[i] instanceof InterimParameterizedType) {
-                        ParameterizedType pType = ParameterizedTypeRepository.findParameterizedType((InterimParameterizedType) methodParameters[i], ((InterimParameterizedType) methodParameters[i]).signature, startPoint);
-						if (pType == null) {
-							try {
-                                AuxiliaryFinder.findGenericClassDeclarationForParameterizedType((InterimParameterizedType) methodParameters[i], startPoint);
-							} catch(Throwable e) {
-                                throw new TypeNotPresentException(((InterimParameterizedType) methodParameters[i]).rawType.classTypeName.substring(1).replace('/', '.'), e);
-							}
-							//check the correspondence of the formal parameter number and the actual argument number:
-                            AuxiliaryChecker.checkArgsNumber((InterimParameterizedType) methodParameters[i], startPoint); // the MalformedParameterizedTypeException may raise here
-							try {
-                                pType = new ParameterizedTypeImpl(AuxiliaryCreator.createTypeArgs((InterimParameterizedType) methodParameters[i], startPoint), AuxiliaryCreator.createRawType((InterimParameterizedType) methodParameters[i], startPoint), AuxiliaryCreator.createOwnerType((InterimParameterizedType) methodParameters[i], startPoint));
-							} catch(ClassNotFoundException e) {
-								throw new TypeNotPresentException(e.getMessage(), e);
-							}
-                            ParameterizedTypeRepository.registerParameterizedType(pType, (InterimParameterizedType) methodParameters[i], ((InterimParameterizedType) methodParameters[i]).signature, startPoint);
-						}
-						genericParameterTypes[i] = (Type) pType; 
-                    } else if (methodParameters[i] instanceof InterimClassType) {
-						try {
-                            genericParameterTypes[i] = (Type) AuxiliaryLoader.ersatzLoader.findClass(((InterimClassType)methodParameters[i]).classTypeName.substring((((InterimClassType)methodParameters[i]).classTypeName.charAt(0)=='L'? 1 : 0)).replace('/', '.')); // XXX: should we propagate the class loader of initial user's request (Field.getGenericType()) or use this one?
-						} catch (ClassNotFoundException e) {
-                            throw new TypeNotPresentException(((InterimClassType)methodParameters[i]).classTypeName.substring((((InterimClassType)methodParameters[i]).classTypeName.charAt(0)=='L'? 1 : 0)).replace('/', '.'), e);
-						} catch (ExceptionInInitializerError e) {
-						} catch (LinkageError e) {
-						}
-                    } else if (methodParameters[i] instanceof InterimTypeVariable) {
-                        String tvName = ((InterimTypeVariable) methodParameters[i]).typeVariableName;
-                        TypeVariable variable = TypeVariableRepository.findTypeVariable(tvName, startPoint);
-						if (variable == null) {
-                            variable =  AuxiliaryFinder.findTypeVariable(tvName, startPoint);
-							if (variable == null) {
-								genericParameterTypes[i] = (Type) null;
-								continue;
-							}
-						}
-						genericParameterTypes[i] = (Type) variable;
-                    } else if (methodParameters[i] instanceof InterimGenericArrayType) {
-                        genericParameterTypes[i] = AuxiliaryCreator.createGenericArrayType((InterimGenericArrayType) methodParameters[i], startPoint); 
-					} else {
-						// Internal Error
-					}
-				}
-            }
-        }
-
         public Annotation[][] getParameterAnnotations() {
             if (parameterAnnotations == null) {
                 parameterAnnotations = VMGenericsAndAnnotations
@@ -572,40 +405,6 @@
                 parameterTypes = VMReflection.getParameterTypes(vm_member_id);
             }
             return parameterTypes;
-        }
-
-        /**
-         * initializes type parameters
-         */
-        @SuppressWarnings("unchecked")
-		public synchronized void initTypeParameters() {
-			//So, here it can be only TypeVariable elements.
-            if (typeParameters == null) {
-				Object startPoint = Constructor.this;
-				if (constrSignature == null) {
-                    constrSignature = AuxiliaryUtil.toUTF8(VMGenericsAndAnnotations.getSignature(vm_member_id)); // getting this method signature
-					if (constrSignature == null) {
-						typeParameters =  new TypeVariable[0];
-						return;
-					}
-				}
-				if (constrGenDecl == null) {
-                    constrGenDecl =  (InterimConstructorGenericDecl) Parser.parseSignature(constrSignature, SignatureKind.CONSTRUCTOR_SIGNATURE, (GenericDeclaration)startPoint); // GenericSignatureFormatError can be thrown here
-				}
-                InterimTypeParameter[] pTypeParameters = constrGenDecl.typeParameters;
-				if (pTypeParameters == null) {
-					typeParameters =  new TypeVariable[0];
-					return;
-				}
-				int l = pTypeParameters.length;
-				typeParameters = new TypeVariable[l];
-				for (int i = 0; i < l; i++) {
-					String tvName = pTypeParameters[i].typeParameterName;
-                    TypeVariable variable = new TypeVariableImpl((GenericDeclaration)Constructor.this, tvName, constrGenDecl.typeParameters[i]);
-                    TypeVariableRepository.registerTypeVariable(variable, tvName, startPoint);
-					typeParameters[i] = variable;				
-				}
-            }
         }
     }
 }

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/reflect/Field.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/reflect/Field.java?view=diff&rev=545750&r1=545749&r2=545750
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/reflect/Field.java (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/reflect/Field.java Sat Jun  9 07:18:59 2007
@@ -26,26 +26,9 @@
 
 import java.lang.annotation.Annotation;
 
-import org.apache.harmony.lang.reflect.parser.InterimFieldGenericDecl;
 import org.apache.harmony.lang.reflect.parser.Parser;
-import org.apache.harmony.lang.reflect.parser.Parser.SignatureKind;
-import org.apache.harmony.lang.reflect.parser.InterimParameterizedType;
-import org.apache.harmony.lang.reflect.parser.InterimTypeVariable;
-import org.apache.harmony.lang.reflect.parser.InterimGenericArrayType;
-import org.apache.harmony.lang.reflect.parser.InterimGenericType;
-
-import org.apache.harmony.lang.reflect.repository.TypeVariableRepository;
-import org.apache.harmony.lang.reflect.repository.ParameterizedTypeRepository;
-
-import org.apache.harmony.lang.reflect.support.AuxiliaryFinder;
-import org.apache.harmony.lang.reflect.support.AuxiliaryCreator;
-import org.apache.harmony.lang.reflect.support.AuxiliaryChecker;
-import org.apache.harmony.lang.reflect.support.AuxiliaryUtil;
-
-import org.apache.harmony.lang.reflect.implementation.ParameterizedTypeImpl;
-
-import org.apache.harmony.vm.VMStack;
 import org.apache.harmony.vm.VMGenericsAndAnnotations;
+import org.apache.harmony.vm.VMStack;
 
 /**
 * @com.intel.drl.spec_ref 
@@ -81,50 +64,11 @@
     /**
     *  @com.intel.drl.spec_ref
     */
-    public Type getGenericType() throws GenericSignatureFormatError, TypeNotPresentException, MalformedParameterizedTypeException {
+    public Type getGenericType() throws GenericSignatureFormatError,
+            TypeNotPresentException, MalformedParameterizedTypeException {
         if (data.genericType == null) {
-            Object startPoint = data.declaringClass;
-            String signature = AuxiliaryUtil.toUTF8(VMGenericsAndAnnotations.getSignature(data.vm_member_id));
-            if (signature == null) {
-                return data.genericType = (Type)data.getType();
-            }
-            InterimFieldGenericDecl decl =  (InterimFieldGenericDecl) Parser.parseSignature(signature, SignatureKind.FIELD_SIGNATURE, (GenericDeclaration)startPoint);
-            InterimGenericType fldType = decl.fieldType;
-            if (fldType instanceof InterimTypeVariable) {
-                String tvName = ((InterimTypeVariable) fldType).typeVariableName;
-                TypeVariable variable = TypeVariableRepository.findTypeVariable(tvName, startPoint);
-                if (variable == null) {
-                    variable =  AuxiliaryFinder.findTypeVariable(tvName, startPoint);
-                    if (variable == null) {
-                        return (Type) null;
-                    }
-                }
-                data.genericType = (Type) variable;
-                return (Type) variable;
-            } else if (fldType instanceof InterimParameterizedType) {
-                ParameterizedType pType = ParameterizedTypeRepository.findParameterizedType((InterimParameterizedType) fldType, ((InterimParameterizedType) fldType).signature, startPoint);
-                if (pType == null) {
-                    try {
-                        AuxiliaryFinder.findGenericClassDeclarationForParameterizedType((InterimParameterizedType) fldType, startPoint);
-                    } catch(Throwable e) {
-                        throw new TypeNotPresentException(((InterimParameterizedType) fldType).rawType.classTypeName.substring(1).replace('/', '.'), e);
-                    }
-                    // check the correspondence of the formal parameter number and the actual argument number:
-                    AuxiliaryChecker.checkArgsNumber((InterimParameterizedType) fldType, startPoint); // the MalformedParameterizedTypeException may raise here
-                    try {
-                        pType = new ParameterizedTypeImpl(AuxiliaryCreator.createTypeArgs((InterimParameterizedType) fldType, startPoint), AuxiliaryCreator.createRawType((InterimParameterizedType) fldType, startPoint), AuxiliaryCreator.createOwnerType((InterimParameterizedType) fldType, startPoint));
-                    } catch(ClassNotFoundException e) {
-                        throw new TypeNotPresentException(e.getMessage(), e);
-                    }
-                    ParameterizedTypeRepository.registerParameterizedType(pType, (InterimParameterizedType) fldType, ((InterimParameterizedType) fldType).signature, startPoint);
-                }
-                data.genericType = (Type) pType;
-                return pType; 
-            } else if (fldType instanceof InterimGenericArrayType) {
-                return AuxiliaryCreator.createGenericArrayType((InterimGenericArrayType) fldType, startPoint); 
-            } else {
-                return data.genericType = (Type)data.getType();
-            }
+            data.genericType = Parser.parseFieldGenericType(this, VMGenericsAndAnnotations
+                    .getSignature(data.vm_member_id));
         }
         return data.genericType;
     }

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/reflect/Method.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/reflect/Method.java?view=diff&rev=545750&r1=545749&r2=545750
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/reflect/Method.java (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/javasrc/java/lang/reflect/Method.java Sat Jun  9 07:18:59 2007
@@ -29,29 +29,8 @@
 import java.util.Arrays;
 
 import org.apache.harmony.lang.reflect.parser.Parser;
-import org.apache.harmony.lang.reflect.parser.Parser.SignatureKind;
-import org.apache.harmony.lang.reflect.parser.InterimParameterizedType;
-import org.apache.harmony.lang.reflect.parser.InterimTypeVariable;
-import org.apache.harmony.lang.reflect.parser.InterimType;
-import org.apache.harmony.lang.reflect.parser.InterimClassType;
-import org.apache.harmony.lang.reflect.parser.InterimTypeParameter;
-import org.apache.harmony.lang.reflect.parser.InterimGenericArrayType;
-import org.apache.harmony.lang.reflect.parser.InterimMethodGenericDecl;
-
-import org.apache.harmony.lang.reflect.repository.TypeVariableRepository;
-import org.apache.harmony.lang.reflect.repository.ParameterizedTypeRepository;
-
-import org.apache.harmony.lang.reflect.support.AuxiliaryFinder;
-import org.apache.harmony.lang.reflect.support.AuxiliaryCreator;
-import org.apache.harmony.lang.reflect.support.AuxiliaryChecker;
-import org.apache.harmony.lang.reflect.support.AuxiliaryLoader;
-import org.apache.harmony.lang.reflect.support.AuxiliaryUtil;
-
-import org.apache.harmony.lang.reflect.implementation.TypeVariableImpl;
-import org.apache.harmony.lang.reflect.implementation.ParameterizedTypeImpl;
-
-import org.apache.harmony.vm.VMStack;
 import org.apache.harmony.vm.VMGenericsAndAnnotations;
+import org.apache.harmony.vm.VMStack;
 
 /**
 * @com.intel.drl.spec_ref 
@@ -117,9 +96,8 @@
     */
     public Type[] getGenericExceptionTypes() throws GenericSignatureFormatError, TypeNotPresentException, MalformedParameterizedTypeException {
         if (data.genericExceptionTypes == null) {
-            data.initGenericExceptionTypes();
+            data.genericExceptionTypes = Parser.getGenericExceptionTypes(this, VMGenericsAndAnnotations.getSignature(data.vm_member_id));
         }
-
         return (Type[])data.genericExceptionTypes.clone();
     }
 
@@ -128,7 +106,7 @@
     */
     public Type[] getGenericParameterTypes() throws GenericSignatureFormatError, TypeNotPresentException, MalformedParameterizedTypeException {
         if (data.genericParameterTypes == null) {
-            data.initGenericParameterTypes();
+            data.genericParameterTypes = Parser.getGenericParameterTypes(this, VMGenericsAndAnnotations.getSignature(data.vm_member_id));
         }
 
         return (Type[])data.genericParameterTypes.clone();
@@ -139,53 +117,8 @@
     */
     public Type getGenericReturnType() throws GenericSignatureFormatError, TypeNotPresentException, MalformedParameterizedTypeException {
         if (data.genericReturnType == null) {
-            Object startPoint = this; 
-            if (data.methSignature == null) {
-                data.methSignature = AuxiliaryUtil.toUTF8(VMGenericsAndAnnotations.getSignature(data.vm_member_id));
-                if (data.methSignature == null) {
-                    data.genericReturnType = (Type)getReturnType();
-                    return data.genericReturnType;
-                }
-            }
-            if (data.methGenDecl == null) {
-                data.methGenDecl =  (InterimMethodGenericDecl) Parser.parseSignature(data.methSignature, SignatureKind.METHOD_SIGNATURE, (GenericDeclaration)startPoint);
-            }
-            InterimType mthdType = data.methGenDecl.returnValue;
-            if (mthdType instanceof InterimTypeVariable) {
-                String tvName = ((InterimTypeVariable) mthdType).typeVariableName;
-                TypeVariable variable = TypeVariableRepository.findTypeVariable(tvName, startPoint);
-                if (variable == null) {
-                    variable =  AuxiliaryFinder.findTypeVariable(tvName, startPoint);
-                    if (variable == null) {
-                        return (Type) null; // compatible behaviour
-                    }
-                }
-                data.genericReturnType = (Type) variable;
-                return (Type) variable;
-            } else if (mthdType instanceof InterimParameterizedType) {
-                ParameterizedType pType = ParameterizedTypeRepository.findParameterizedType((InterimParameterizedType) mthdType, ((InterimParameterizedType) mthdType).signature, startPoint);
-                if (pType == null) {
-                    try {
-                        AuxiliaryFinder.findGenericClassDeclarationForParameterizedType((InterimParameterizedType) mthdType, startPoint);
-                    } catch(Throwable e) {
-                        throw new TypeNotPresentException(((InterimParameterizedType) mthdType).rawType.classTypeName.substring(1).replace('/', '.'), e);
-                    }
-                    // check the correspondence of the formal parameter number and the actual argument number:
-                    AuxiliaryChecker.checkArgsNumber((InterimParameterizedType) mthdType, startPoint); // the MalformedParameterizedTypeException may raise here
-                    try {
-                        pType = new ParameterizedTypeImpl(AuxiliaryCreator.createTypeArgs((InterimParameterizedType) mthdType, startPoint), AuxiliaryCreator.createRawType((InterimParameterizedType) mthdType, startPoint), AuxiliaryCreator.createOwnerType((InterimParameterizedType) mthdType, startPoint));
-                    } catch(ClassNotFoundException e) {
-                        throw new TypeNotPresentException(e.getMessage(), e);
-                    }
-                    ParameterizedTypeRepository.registerParameterizedType(pType, (InterimParameterizedType) mthdType, ((InterimParameterizedType) mthdType).signature, startPoint);
-                }
-                data.genericReturnType = (Type) pType;
-                return (Type) pType; 
-            } else if (mthdType instanceof InterimGenericArrayType) {
-                return AuxiliaryCreator.createGenericArrayType((InterimGenericArrayType) mthdType, startPoint); 
-            } else {
-                return getReturnType();
-            }            
+            data.genericReturnType = Parser.getGenericReturnTypeImpl(this, VMGenericsAndAnnotations
+                    .getSignature(data.vm_member_id));            
         }
         return data.genericReturnType;
     }
@@ -193,11 +126,13 @@
     /**
     *  @com.intel.drl.spec_ref
     */
+    @SuppressWarnings("unchecked")
     public TypeVariable<Method>[] getTypeParameters() throws GenericSignatureFormatError {
         if (data.typeParameters == null) {
-            data.initTypeParameters();
+            data.typeParameters = Parser.getTypeParameters(this,
+                    VMGenericsAndAnnotations.getSignature(data.vm_member_id));
         }
-        return (TypeVariable<Method>[])data.typeParameters.clone();
+        return (TypeVariable<Method>[]) data.typeParameters.clone();
     }
 
     /**
@@ -207,10 +142,10 @@
         StringBuilder sb = new StringBuilder(80);
         // data initialization
         if (data.genericParameterTypes == null) {
-            data.initGenericParameterTypes();
+            data.genericParameterTypes = Parser.getGenericParameterTypes(this, VMGenericsAndAnnotations.getSignature(data.vm_member_id));
         }
         if (data.genericExceptionTypes == null) {
-            data.initGenericExceptionTypes();
+            data.genericExceptionTypes = Parser.getGenericExceptionTypes(this, VMGenericsAndAnnotations.getSignature(data.vm_member_id));
         }
         // append modifiers if any
         int modifier = getModifiers();
@@ -448,11 +383,6 @@
 
         String methSignature;
 
-        /**
-         * method generic declaration
-         */
-        InterimMethodGenericDecl methGenDecl;
-
         final int modifiers;
 
         final String name;
@@ -508,147 +438,6 @@
             return exceptionTypes;
         }
 
-        /**
-         * initializes generalized exeptions
-         */
-        public synchronized void initGenericExceptionTypes() {
-            // So, here it can be ParameterizedType or TypeVariable or ordinary reference class type elements.
-            if (genericExceptionTypes == null) {
-                Object startPoint = Method.this;
-                if (methSignature == null) {
-                    methSignature = AuxiliaryUtil.toUTF8(VMGenericsAndAnnotations.getSignature(vm_member_id)); // getting this method signature
-                    if (methSignature == null) {
-                        genericExceptionTypes = getExceptionTypes();
-                        return;
-                    }
-                }
-                if (methGenDecl == null) {
-                    methGenDecl =  (InterimMethodGenericDecl) Parser.parseSignature(methSignature, SignatureKind.METHOD_SIGNATURE, (GenericDeclaration)startPoint); // GenericSignatureFormatError can be thrown here
-                }
-                InterimType[] throwns = methGenDecl.throwns;
-                if (throwns == null) {
-                    genericExceptionTypes = getExceptionTypes();
-                    return;
-                }
-                int l = throwns.length;
-                genericExceptionTypes = new Type[l];
-                for (int i = 0; i < l; i++) {
-                    if (throwns[i] instanceof InterimParameterizedType) {
-                        ParameterizedType pType = ParameterizedTypeRepository.findParameterizedType((InterimParameterizedType) throwns[i], ((InterimParameterizedType) throwns[i]).signature, startPoint);
-                        if (pType == null) {
-                            try {
-                                AuxiliaryFinder.findGenericClassDeclarationForParameterizedType((InterimParameterizedType) throwns[i], startPoint);
-                            } catch(Throwable e) {
-                                throw new TypeNotPresentException(((InterimParameterizedType) throwns[i]).rawType.classTypeName.substring(1).replace('/', '.'), e);
-                            }
-                            // check the correspondence of the formal parameter number and the actual argument number:
-                            AuxiliaryChecker.checkArgsNumber((InterimParameterizedType) throwns[i], startPoint); // the MalformedParameterizedTypeException may raise here
-                            try {
-                                pType = new ParameterizedTypeImpl(AuxiliaryCreator.createTypeArgs((InterimParameterizedType) throwns[i], startPoint), AuxiliaryCreator.createRawType((InterimParameterizedType) throwns[i], startPoint), AuxiliaryCreator.createOwnerType((InterimParameterizedType) throwns[i], startPoint));
-                            } catch(ClassNotFoundException e) {
-                                throw new TypeNotPresentException(e.getMessage(), e);
-                            }
-                            ParameterizedTypeRepository.registerParameterizedType(pType, (InterimParameterizedType) throwns[i], ((InterimParameterizedType) throwns[i]).signature, startPoint);
-                        }
-                        genericExceptionTypes[i] = (Type) pType; 
-                    } else if (throwns[i] instanceof InterimClassType) {
-                        try {
-                            genericExceptionTypes[i] = (Type) AuxiliaryLoader.ersatzLoader.findClass(((InterimClassType)throwns[i]).classTypeName.substring((((InterimClassType)throwns[i]).classTypeName.charAt(0)=='L'? 1 : 0)).replace('/', '.')); // XXX: should we propagate the class loader of initial user's request (Field.getGenericType()) or use this one?
-                        } catch (ClassNotFoundException e) {
-                            throw new TypeNotPresentException(((InterimClassType)throwns[i]).classTypeName.substring((((InterimClassType)throwns[i]).classTypeName.charAt(0)=='L'? 1 : 0)).replace('/', '.'), e);
-                        } catch (ExceptionInInitializerError e) {
-                        } catch (LinkageError e) {
-                        }
-                    } else if (throwns[i] instanceof InterimTypeVariable) {
-                        String tvName = ((InterimTypeVariable) throwns[i]).typeVariableName;
-                        TypeVariable variable = TypeVariableRepository.findTypeVariable(tvName, startPoint);
-                        if (variable == null) {
-                            variable =  AuxiliaryFinder.findTypeVariable(tvName, startPoint);
-                            if (variable == null) {
-                                genericExceptionTypes[i] = (Type) null;
-                                break;
-                            }
-                        }
-                        genericExceptionTypes[i] = (Type) variable;
-                    } else {
-                        // Internal Error
-                    }
-                }
-            }
-        }
-
-        /**
-         * initializes generalized parameters
-         */
-        public synchronized void initGenericParameterTypes() {
-            // So, here it can be ParameterizedType or TypeVariable or ordinary reference class type elements.
-            if (genericParameterTypes == null) {
-                Object startPoint = Method.this;
-                if (methSignature == null) {
-                    methSignature = AuxiliaryUtil.toUTF8(VMGenericsAndAnnotations.getSignature(vm_member_id)); // getting this method signature
-                    if (methSignature == null) {
-                        genericParameterTypes = getParameterTypes();
-                        return;
-                    }
-                }
-                if (methGenDecl == null) {
-                    methGenDecl =  (InterimMethodGenericDecl) Parser.parseSignature(methSignature, SignatureKind.METHOD_SIGNATURE, (GenericDeclaration)startPoint); // GenericSignatureFormatError can be thrown here
-                }
-                InterimType[] methodParameters = methGenDecl.methodParameters;
-                if (methodParameters == null) {
-                    genericParameterTypes = new Type[0];
-                    return;
-                }
-                int l = methodParameters.length;
-                genericParameterTypes = new Type[l];
-                for (int i = 0; i < l; i++) {
-                    if (methodParameters[i] instanceof InterimParameterizedType) {
-                        ParameterizedType pType = ParameterizedTypeRepository.findParameterizedType((InterimParameterizedType) methodParameters[i], ((InterimParameterizedType) methodParameters[i]).signature, startPoint);
-                        if (pType == null) {
-                            try {
-                                AuxiliaryFinder.findGenericClassDeclarationForParameterizedType((InterimParameterizedType) methodParameters[i], startPoint);
-                            } catch(Throwable e) {
-                                throw new TypeNotPresentException(((InterimParameterizedType) methodParameters[i]).rawType.classTypeName.substring(1).replace('/', '.'), e);
-                            }
-                            // check the correspondence of the formal parameter number and the actual argument number:
-                            AuxiliaryChecker.checkArgsNumber((InterimParameterizedType) methodParameters[i], startPoint); // the MalformedParameterizedTypeException may raise here
-                            try {
-                                pType = new ParameterizedTypeImpl(AuxiliaryCreator.createTypeArgs((InterimParameterizedType) methodParameters[i], startPoint), AuxiliaryCreator.createRawType((InterimParameterizedType) methodParameters[i], startPoint), AuxiliaryCreator.createOwnerType((InterimParameterizedType) methodParameters[i], startPoint));
-                            } catch(ClassNotFoundException e) {
-                                throw new TypeNotPresentException(e.getMessage(), e);
-                            }
-                            ParameterizedTypeRepository.registerParameterizedType(pType, (InterimParameterizedType) methodParameters[i], ((InterimParameterizedType) methodParameters[i]).signature, startPoint);
-                        }
-                        genericParameterTypes[i] = (Type) pType; 
-                    } else if (methodParameters[i] instanceof InterimClassType) {
-                        try {
-                            genericParameterTypes[i] = (Type) AuxiliaryLoader.ersatzLoader.findClass(((InterimClassType)methodParameters[i]).classTypeName.substring((((InterimClassType)methodParameters[i]).classTypeName.charAt(0)=='L'? 1 : 0)).replace('/', '.')); // XXX: should we propagate the class loader of initial user's request (Field.getGenericType()) or use this one?
-                        } catch (ClassNotFoundException e) {
-                            throw new TypeNotPresentException(((InterimClassType)methodParameters[i]).classTypeName.substring((((InterimClassType)methodParameters[i]).classTypeName.charAt(0)=='L'? 1 : 0)).replace('/', '.'), e);
-                        } catch (ExceptionInInitializerError e) {
-                        } catch (LinkageError e) {
-                        }
-                    } else if (methodParameters[i] instanceof InterimTypeVariable) {
-                        String tvName = ((InterimTypeVariable) methodParameters[i]).typeVariableName;
-                        TypeVariable variable = TypeVariableRepository.findTypeVariable(tvName, startPoint);
-                        if (variable == null) {
-                            variable =  AuxiliaryFinder.findTypeVariable(tvName, startPoint);
-                            if (variable == null) {
-                                genericParameterTypes[i] = (Type) null;
-                                continue;
-                            }
-                        }
-                        genericParameterTypes[i] = (Type) variable;
-                    } else if (methodParameters[i] instanceof InterimGenericArrayType) {
-                        genericParameterTypes[i] = AuxiliaryCreator.createGenericArrayType((InterimGenericArrayType) methodParameters[i], startPoint); 
-                    } else {
-                        // Internal Error
-                    }
-                }
-            }
-        }
-
-
         public Annotation[][] getParameterAnnotations() {
             if (parameterAnnotations == null) {
                 parameterAnnotations = VMGenericsAndAnnotations
@@ -675,40 +464,6 @@
                 returnType = VMReflection.getMethodReturnType(vm_member_id);
             }
             return returnType;
-        }
-        
-        /**
-         * initializes type parameters
-         */
-        @SuppressWarnings("unchecked")
-        public synchronized void initTypeParameters() {
-            // So, here it can be only TypeVariable elements.
-            if (typeParameters == null) {
-                Object startPoint = Method.this;
-                if (methSignature == null) {
-                    methSignature = AuxiliaryUtil.toUTF8(VMGenericsAndAnnotations.getSignature(vm_member_id)); // getting this method signature
-                    if (methSignature == null) {
-                        typeParameters =  new TypeVariable[0];
-                        return;
-                    }
-                }
-                if (methGenDecl == null) {
-                    methGenDecl =  (InterimMethodGenericDecl) Parser.parseSignature(methSignature, SignatureKind.METHOD_SIGNATURE, (GenericDeclaration)startPoint); // GenericSignatureFormatError can be thrown here
-                }
-                InterimTypeParameter[] pTypeParameters = methGenDecl.typeParameters;
-                if (pTypeParameters == null) {
-                    typeParameters =  new TypeVariable[0];
-                    return;
-                }
-                int l = pTypeParameters.length;
-                typeParameters = new TypeVariable[l];
-                for (int i = 0; i < l; i++) {
-                    String tvName = pTypeParameters[i].typeParameterName;
-                    TypeVariable variable = new TypeVariableImpl((GenericDeclaration)Method.this, tvName, methGenDecl.typeParameters[i]);
-                    TypeVariableRepository.registerTypeVariable(variable, tvName, startPoint);
-                    typeParameters[i] = variable;                
-                }
-            }
         }
     }
 }