// This causes the compiler to find the additional type, possibly
// winding its back to ask for the compilation unit from the source
// oracle.
//
ReferenceBinding type = resolvePossiblyNestedType(typeName);
// Sanity check rebind results.
if (type == null) {
FindDeferredBindingSitesVisitor.reportRebindProblem(site,
"Rebind result '" + typeName + "' could not be found");
continue;
}
if (!type.isClass()) {
FindDeferredBindingSitesVisitor.reportRebindProblem(site,
"Rebind result '" + typeName + "' must be a class");
continue;
}
if (type.isAbstract()) {
FindDeferredBindingSitesVisitor.reportRebindProblem(site,
"Rebind result '" + typeName + "' cannot be abstract");
continue;
}
if (type.isNestedType() && !type.isStatic()) {
FindDeferredBindingSitesVisitor.reportRebindProblem(site,
"Rebind result '" + typeName
+ "' cannot be a non-static nested class");
continue;
}
if (type.isLocalType()) {
FindDeferredBindingSitesVisitor.reportRebindProblem(site,
"Rebind result '" + typeName + "' cannot be a local class");
continue;
}
// Look for a noArg ctor.
MethodBinding noArgCtor = type.getExactConstructor(TypeBinding.NO_PARAMETERS);
if (noArgCtor == null) {
FindDeferredBindingSitesVisitor.reportRebindProblem(site,
"Rebind result '" + typeName
+ "' has no default (zero argument) constructors");
continue;