//
final CacheManager.Mapper identityMapper = cacheManager.getIdentityMapper();
for (Iterator iter = cudsByFileName.values().iterator(); iter.hasNext();) {
CompilationUnitDeclaration cud = (CompilationUnitDeclaration) iter.next();
cud.traverse(new ASTVisitor() {
public boolean visit(TypeDeclaration typeDecl, BlockScope scope) {
JClassType enclosingType = identityMapper.get((SourceTypeBinding) typeDecl.binding.enclosingType());
processType(typeDecl, enclosingType, true);
return true;
}
public boolean visit(TypeDeclaration typeDecl, ClassScope scope) {
JClassType enclosingType = identityMapper.get((SourceTypeBinding) typeDecl.binding.enclosingType());
processType(typeDecl, enclosingType, false);
return true;
}
public boolean visit(TypeDeclaration typeDecl,
CompilationUnitScope scope) {
processType(typeDecl, null, false);
return true;
}
}, cud.scope);
}
// Perform a deep pass to resolve all types in terms of our types.
//
for (Iterator iter = cudsByFileName.values().iterator(); iter.hasNext();) {
CompilationUnitDeclaration cud = (CompilationUnitDeclaration) iter.next();
String loc = String.valueOf(cud.getFileName());
String processing = "Processing types in compilation unit: " + loc;
final TreeLogger cudLogger = logger.branch(TreeLogger.SPAM, processing,
null);
final char[] source = cud.compilationResult.compilationUnit.getContents();
cud.traverse(new ASTVisitor() {
public boolean visit(TypeDeclaration typeDecl, BlockScope scope) {
if (!resolveTypeDeclaration(cudLogger, source, typeDecl)) {
String name = String.valueOf(typeDecl.binding.readableName());
String msg = "Unexpectedly unable to fully resolve type " + name;
logger.log(TreeLogger.WARN, msg, null);