if (isPackageInfoTypeName(qname)) {
return resolvePackage(logger, clazz);
}
// Just resolve the type.
JRealClassType jtype = (JRealClassType) resolveType(logger, binding);
if (jtype == null) {
// Failed to resolve.
//
return false;
}
/*
* Modifiers were added during processType since getParameterizedType
* depends on them being set.
*/
// Try to resolve annotations, ignore any that fail.
Map<Class<? extends java.lang.annotation.Annotation>, java.lang.annotation.Annotation> declaredAnnotations = newAnnotationMap();
resolveAnnotations(logger, clazz.annotations, declaredAnnotations);
jtype.addAnnotations(declaredAnnotations);
// Resolve bounds for type parameters on generic types. Note that this
// step does not apply to type parameters on generic methods; that
// occurs during the method resolution stage.
JGenericType jGenericType = jtype.isGenericType();
if (jGenericType != null
&& !resolveBoundsForTypeParameters(logger, jtype.isGenericType(),
clazz.typeParameters)) {
// Failed to resolve
return false;
}
// Resolve superclass (for classes only).
//
if (jtype.isInterface() == null) {
ReferenceBinding superclassRef = binding.superclass;
assert superclassRef != null
|| "java.lang.Object".equals(jtype.getQualifiedSourceName());
if (superclassRef != null) {
JClassType jsuperClass = (JClassType) resolveType(logger, superclassRef);
assert jsuperClass != null;
jtype.setSuperclass(jsuperClass);
}
}
// Resolve superinterfaces.
//
ReferenceBinding[] superintfRefs = binding.superInterfaces;
for (int i = 0; i < superintfRefs.length; i++) {
ReferenceBinding superintfRef = superintfRefs[i];
JClassType jinterface = (JClassType) resolveType(logger, superintfRef);
if (jinterface == null) {
// Failed to resolve.
//
return false;
}
jtype.addImplementedInterface(jinterface);
}
// Resolve fields.
//
FieldDeclaration[] fields = clazz.fields;