protected void updateEmbedCompilationUnitDependencies(List<IEmbedResolver> embedNodes, Collection<ICompilerProblem> problems) throws InterruptedException
{
Set<ICompilationUnit> previousEmbedCompilationUnits = new HashSet<ICompilationUnit>(embedCompilationUnits);
embedCompilationUnits.clear();
CompilerProject project = getProject();
for (IEmbedResolver embedNode : embedNodes)
{
ICompilationUnit cu = embedNode.resolveCompilationUnit(project);
if (cu != null)
{
// if the cu has already been part of this CU, nothing to do
if (!previousEmbedCompilationUnits.remove(cu))
{
// this dependency targets the embedNode's (import etc) data qname
project.addDependency(this, cu, DependencyType.EXPRESSION, cu.getQualifiedNames().get(0));
}
embedCompilationUnits.add(cu);
}
}
// remove any CUs which are no longer referenced in this file
project.removeCompilationUnits(previousEmbedCompilationUnits);
}