sourceTypes.put(key, arrayType);
}
return arrayType;
} else {
ReferenceBinding refBinding = (ReferenceBinding) binding;
JDeclaredType declType = createType(refBinding);
try {
if (declType instanceof JClassType) {
ReferenceBinding superclass = refBinding.superclass();
if (superclass != null && superclass.isValidBinding()) {
((JClassType) declType).setSuperClass((JClassType) get(superclass));
}
}
ReferenceBinding[] superInterfaces = refBinding.superInterfaces();
if (superInterfaces != null) {
for (ReferenceBinding intf : superInterfaces) {
if (intf.isValidBinding()) {
declType.addImplements((JInterfaceType) get(intf));
}
}
}
} catch (AbortCompilation ignored) {
/*
* The currently-compiling unit has no errors; however, we're running
* into a case where it references something with a bad hierarchy. This
* doesn't cause an error in the current unit, but it does mean we run
* into a wall here trying to construct the hierarchy. Catch the error
* so that compilation can proceed; the error units themselves will
* eventually cause the full compile to error out.
*/
}
// Emulate clinit method for super clinit calls.
JMethod clinit =
new JMethod(SourceOrigin.UNKNOWN, "$clinit", declType, JPrimitiveType.VOID, false, true,
true, AccessModifier.PRIVATE);
clinit.freezeParamTypes();
clinit.setSynthetic();
declType.addMethod(clinit);
declType.setExternal(true);
types.put(key, declType);
return declType;
}
}