if (htmlEntry == null) {
throw new AnalysisException("An HTML file became a non-HTML file: "
+ source.getFullName());
}
}
HtmlEntryImpl htmlCopy = ((HtmlEntry) sourceEntry).getWritableCopy();
if (thrownException == null) {
LineInfo lineInfo = task.getLineInfo();
HtmlUnit unit = task.getHtmlUnit();
htmlCopy.setValue(SourceEntry.LINE_INFO, lineInfo);
htmlCopy.setValue(HtmlEntry.PARSED_UNIT, unit);
htmlCopy.setValue(HtmlEntry.PARSE_ERRORS, task.getErrors());
htmlCopy.setValue(HtmlEntry.REFERENCED_LIBRARIES, task.getReferencedLibraries());
cache.storedAst(source);
ChangeNoticeImpl notice = getNotice(source);
notice.setErrors(htmlCopy.getAllErrors(), lineInfo);
} else {
htmlCopy.recordParseError(thrownException);
cache.removedAst(source);
}
cache.put(source, htmlCopy);
htmlEntry = htmlCopy;
} else {
logInformation(
"Parse results discarded for " + debuggingString(source) + "; sourceTime = "
+ sourceTime + ", resultTime = " + resultTime + ", cacheTime = "
+ htmlEntry.getModificationTime(),
thrownException);
HtmlEntryImpl htmlCopy = ((HtmlEntry) sourceEntry).getWritableCopy();
if (thrownException == null || resultTime >= 0L) {
//
// The analysis was performed on out-of-date sources. Mark the cache so that the sources
// will be re-analyzed using the up-to-date sources.
//
// if (htmlCopy.getState(SourceEntry.LINE_INFO) == CacheState.IN_PROCESS) {
// htmlCopy.setState(SourceEntry.LINE_INFO, CacheState.INVALID);
// }
// if (htmlCopy.getState(HtmlEntry.PARSED_UNIT) == CacheState.IN_PROCESS) {
// htmlCopy.setState(HtmlEntry.PARSED_UNIT, CacheState.INVALID);
// }
// if (htmlCopy.getState(HtmlEntry.REFERENCED_LIBRARIES) == CacheState.IN_PROCESS) {
// htmlCopy.setState(HtmlEntry.REFERENCED_LIBRARIES, CacheState.INVALID);
// }
htmlCopy.invalidateAllInformation();
htmlCopy.setModificationTime(sourceTime);
cache.removedAst(source);
} else {
//
// We could not determine whether the sources were up-to-date or out-of-date. Mark the
// cache so that we won't attempt to re-analyze the sources until there's a good chance
// that we'll be able to do so without error.
//
htmlCopy.recordParseError(thrownException);
}
cache.put(source, htmlCopy);
htmlEntry = htmlCopy;
}
}