// We still need to verify that the source for generated types hasn't
// changed.
//
TreeLogger branch = logger.branch(TreeLogger.DEBUG,
"Loading cached compilation: " + cacheXml, null);
Compilation c = new Compilation();
c.setStrongName(strongName);
CompilationSchema schema = new CompilationSchema(c);
FileReader r = null;
Throwable caught = null;
try {
r = new FileReader(cacheXml);
ReflectiveParser.parse(logger, schema, r);
} catch (FileNotFoundException e) {
caught = e;
} catch (UnableToCompleteException e) {
caught = e;
} finally {
Utility.close(r);
}
if (caught != null) {
String msg = "Unable to load the cached file";
branch.log(TreeLogger.WARN, msg, caught);
continue;
}
// Check that the hash code of the generated sources for this compilation
// matches the current generated source for the same type.
//
boolean isBadCompilation = false;
String[] genTypes = c.getGeneratedTypeNames();
for (int j = 0; j < genTypes.length; j++) {
String genTypeName = genTypes[j];
String cachedHash = c.getTypeHash(genTypeName);
JClassType genType = typeOracle.findType(genTypeName);
if (genType == null) {
// This cache entry refers to a type that no longer seems to exist.
// Remove it.
//