String contents = context.getContents();
if (contents == null) {
continue;
}
File file = context.file;
CompilationUnit unit = new CompilationUnit(contents.toCharArray(), file.getPath(),
UTF_8);
sources.add(unit);
mSourceUnits.put(file, unit);
}
List<String> classPath = computeClassPath(contexts);
mCompiled = Maps.newHashMapWithExpectedSize(mSourceUnits.size());
try {
parse(createCompilerOptions(), sources, classPath, mCompiled, mClient);
} catch (Throwable t) {
mClient.log(t, "ECJ compiler crashed");
}
if (DEBUG_DUMP_PARSE_ERRORS) {
for (CompilationUnitDeclaration unit : mCompiled.values()) {
// so maybe I don't need my map!!
CategorizedProblem[] problems = unit.compilationResult()
.getAllProblems();
if (problems != null) {
for (IProblem problem : problems) {
if (problem == null || !problem.isError()) {
continue;