sources
public Map<String,Source> sources()
Checks if there is a cached Source for each local Source and if
found, copies it's CompilationUnit into it.
public void applyApplicationCache(ApplicationCache applicationCache)
{
for (Map.Entry entry : sources.entrySet())
{
String className = entry.getKey();
Source source = entry.getValue();
Source cachedSource = applicationCache.getSource(className);
if ((cachedSource != null) && !cachedSource.isUpdated())
{
CompilationUnit cachedCompilationUnit = cachedSource.getCompilationUnit();
if (cachedSource.getPathRoot().equals(source.getPathRoot()) &&
(cachedCompilationUnit != null) && cachedCompilationUnit.hasTypeInfo)
{
CompilationUnit compilationUnit =
source.newCompilationUnit(cachedCompilationUnit.getSyntaxTree(),
new CompilerContext());
Source.copyCompilationUnit(cachedCompilationUnit, compilationUnit, true);
source.setFileTime(cachedSource.getFileTime());
cachedSource.reused();
}
}
}
}