} else {
// Default to 1.5
settings.setTargetVersion("1.5");
}
CompilationResult result = javaCompiler.compile(resources, reader, store, classLoader, settings);
ArrayList<JavacErrorDetail> problemList = new ArrayList<JavacErrorDetail>();
CompilationProblem[] problems = result.getErrors();
if (problems != null) {
try {
for (int i = 0; i < problems.length; i++) {
CompilationProblem problem = problems[i];
problemList.add(ErrorDispatcher.createJavacError