*/
private JRealClassType createType(
TypeData typeData, CollectClassData collectClassData, CollectClassData enclosingClassData) {
int access = collectClassData.getAccess();
String simpleName = Shared.getShortName(typeData.sourceName);
JRealClassType type = null;
String packageName = typeData.packageName;
JPackage pkg = typeOracle.getOrCreatePackage(packageName);
boolean isInterface = (access & Opcodes.ACC_INTERFACE) != 0;
assert !collectClassData.hasNoExternalName();
String enclosingSimpleName = null;
if (enclosingClassData != null) {
enclosingSimpleName = enclosingClassData.getNestedSourceName();
}
if ((access & Opcodes.ACC_ANNOTATION) != 0) {
type = newAnnotationType(pkg, enclosingSimpleName, simpleName);
} else if ((access & Opcodes.ACC_ENUM) != 0) {
type = newEnumType(pkg, enclosingSimpleName, simpleName);
} else {
JTypeParameter[] typeParams = getTypeParametersForClass(collectClassData);
if ((typeParams != null && typeParams.length > 0)
|| nonStaticInsideGeneric(collectClassData, enclosingClassData)) {
type = new JGenericType(
typeOracle, pkg, enclosingSimpleName, simpleName, isInterface, typeParams);
} else {
type = newRealClassType(pkg, enclosingSimpleName, simpleName, isInterface);
}
}
type.addModifierBits(mapBits(ASM_TO_SHARED_MODIFIERS, access));
if (isInterface) {
// Always add implicit modifiers on interfaces.
type.addModifierBits(Shared.MOD_STATIC | Shared.MOD_ABSTRACT);
}
type.addLastModifiedTime(typeData.lastModifiedTime);
return type;
}