ParameterizedType pType = ParameterizedTypeRepository.findParameterizedType((InterimParameterizedType) nextLayer, startPoint);
if (pType == null) {
try {
AuxiliaryFinder.findGenericClassDeclarationForParameterizedType((InterimParameterizedType) nextLayer, startPoint);
} catch(Throwable e) {
throw new TypeNotPresentException(((InterimParameterizedType) nextLayer).rawType.classTypeName.substring(1).replace('/', '.'), e);
}
// check the correspondence of the formal parameter number and the actual argument number:
AuxiliaryChecker.checkArgsNumber((InterimParameterizedType) nextLayer, startPoint); //the MalformedParameterizedTypeException may raise here
try {
pType = new ParameterizedTypeImpl(AuxiliaryCreator.createTypeArgs((InterimParameterizedType) nextLayer, startPoint), AuxiliaryCreator.createRawType((InterimParameterizedType) nextLayer, startPoint), AuxiliaryCreator.createOwnerType((InterimParameterizedType) nextLayer, startPoint));
} catch(ClassNotFoundException e) {
throw new TypeNotPresentException(e.getMessage(), e);
}
ParameterizedTypeRepository.registerParameterizedType(pType, (InterimParameterizedType) nextLayer, ((InterimParameterizedType)nextLayer).signature, startPoint);
}
return new GenericArrayTypeImpl((Type) pType);
} else if (nextLayer instanceof InterimTypeVariable) {
String tvName = ((InterimTypeVariable) nextLayer).typeVariableName;
TypeVariable variable = TypeVariableRepository.findTypeVariable(tvName, startPoint);
if (variable == null) {
variable = AuxiliaryFinder.findTypeVariable(tvName, startPoint);
if (variable == null) {
return (Type) null; // compatible behaviour
}
}
return new GenericArrayTypeImpl((Type) variable);
} else if (nextLayer instanceof InterimClassType) {
Type cType;
try {
cType = (Type) AuxiliaryLoader.findClass(((InterimClassType)nextLayer).classTypeName.substring((((InterimClassType)nextLayer).classTypeName.charAt(0)=='L'? 1 : 0)).replace('/', '.'), startPoint);
} catch(ClassNotFoundException e) {
throw new TypeNotPresentException(((InterimClassType)nextLayer).classTypeName.substring((((InterimClassType)nextLayer).classTypeName.charAt(0)=='L'? 1 : 0)).replace('/', '.'), e);
}
return new GenericArrayTypeImpl(cType);
} else { // GenericArrayType again
return new GenericArrayTypeImpl(AuxiliaryCreator.createGenericArrayType((InterimGenericArrayType)nextLayer, startPoint));
}