in src/main/java/org/apache/sling/commons/compiler/impl/EclipseJavaCompiler.java [287:318]
public void acceptResult(org.eclipse.jdt.internal.compiler.CompilationResult result) {
if (result.hasProblems()) {
CategorizedProblem[] problems = result.getProblems();
for (int i = 0; i < problems.length; i++) {
CategorizedProblem problem = problems[i];
String msg = problem.getMessage();
String fileName = CharOperation.charToString(problem.getOriginatingFileName());
int line = problem.getSourceLineNumber();
int pos = problem.getSourceStart();
if (problem.isError()) {
this.errorHandler.onError(msg, fileName, line, pos);
} else if (problem.isWarning()) {
this.errorHandler.onWarning(msg, fileName, line, pos);
} else {
logger.debug("unknown problem category: {}", problem);
}
}
}
if (!result.hasErrors()) {
ClassFile[] classFiles = result.getClassFiles();
for (int i = 0; i < classFiles.length; i++) {
ClassFile classFile = classFiles[i];
String className = CharOperation.toString(classFile.getCompoundName());
try {
this.write(className, classFile.getBytes());
} catch (IOException e) {
this.errorHandler.onError("Unable to write class file: " + e.getMessage(), className, 0, 0);
}
}
}
}