protected void buildAndCollectProblems(
final Set<ICompilationUnit> compilationUnits,
final Collection<ICompilerProblem> problems)
throws InterruptedException
{
final JSSharedData sharedData = JSSharedData.instance;
sharedData.beginCodeGen();
BuiltCompilationUnitSet builtCompilationUnits = getBuiltCompilationUnitSet();
// if (JSSharedData.OUTPUT_ISOLATED)
// {
final ICompilationUnit rootCU = getRootClassCompilationUnit();
compilationUnits.clear();
compilationUnits.add(rootCU);
// i added
Iterables.addAll(problems, builtCompilationUnits.problems);
// }
// else
// {
// final List<ICompilationUnit> allUnits = new ArrayList<ICompilationUnit>();
// allUnits.addAll(project
// .getReachableCompilationUnitsInSWFOrder(builtCompilationUnits.compilationUnits));
// final List<ICompilationUnit> cuList = sortCompilationUnits(allUnits);
// compilationUnits.clear();
// for (ICompilationUnit cu : cuList)
// compilationUnits.add(cu);
// }
sharedData.endCodeGen();
}