}
if ( currentClass == null ) currentClass = NetuiSubTask.get().getCurrentSourceClass();
XJavaDoc xJavaDoc = currentClass.getXJavaDoc();
XClass originalResolvedType = getXClass( typeName, xJavaDoc );
XClass attemptedResolvedType = originalResolvedType;
if ( isUnknownClass( attemptedResolvedType ) )
{
attemptedResolvedType = getXClass( "java.lang." + typeName, xJavaDoc );
}
if ( isUnknownClass( attemptedResolvedType ) )
{
// See if it was an imported class.
List importedClasses = currentClass.getImportedClasses();
String dotPrepended = '.' + typeName;
for ( Iterator i = importedClasses.iterator(); i.hasNext(); )
{
XClass importedClass = ( XClass ) i.next();
if ( importedClass.getQualifiedName().endsWith( dotPrepended ) )
{
attemptedResolvedType = getXClass( importedClass.getQualifiedName(), xJavaDoc );
break;
}
}
}
if ( isUnknownClass( attemptedResolvedType ) )
{
// See if it was in an imported package.
List importedPackages = currentClass.getImportedPackages();
String dotPrepended = '.' + typeName;
for ( Iterator i = importedPackages.iterator(); i.hasNext(); )
{
XPackage importedPackage = ( XPackage ) i.next();
XClass implicitImportedClass = getXClass( importedPackage.getName() + dotPrepended, xJavaDoc );
if ( ! isUnknownClass( implicitImportedClass ) )
{
attemptedResolvedType = implicitImportedClass;
break;
}