//
try {
String msg = "Analyzing source in module '" + name + "'";
TreeLogger branch = logger.branch(TreeLogger.TRACE, msg, null);
long before = System.currentTimeMillis();
TypeOracleBuilder builder = new TypeOracleBuilder(getCacheManager());
CompilationUnitProvider[] currentCups = getCompilationUnits();
Arrays.sort(currentCups, CompilationUnitProvider.LOCATION_COMPARATOR);
TreeLogger subBranch = null;
if (branch.isLoggable(TreeLogger.DEBUG)) {
subBranch = branch.branch(TreeLogger.DEBUG,
"Adding compilation units...", null);
}
for (int i = 0; i < currentCups.length; i++) {
CompilationUnitProvider cup = currentCups[i];
if (subBranch != null) {
subBranch.log(TreeLogger.DEBUG, cup.getLocation(), null);
}
builder.addCompilationUnit(currentCups[i]);
}
lazyTypeOracle = builder.build(branch);
long after = System.currentTimeMillis();
branch.log(TreeLogger.TRACE, "Finished in " + (after - before) + " ms",
null);
} catch (UnableToCompleteException e) {
logger.log(TreeLogger.ERROR, "Failed to complete analysis", null);