}
}
protected CompilationUnit getCompilationUnit(String unitName, char[] contents, boolean resolveBindings, IString javaVersion)
throws IOException {
ASTParser parser = ASTParser.newParser(AST.JLS4);
parser.setUnitName(unitName);
parser.setResolveBindings(resolveBindings);
parser.setSource(contents);
parser.setBindingsRecovery(true);
parser.setStatementsRecovery(true);
Hashtable<String, String> options = new Hashtable<String, String>();
options.put(JavaCore.COMPILER_SOURCE, javaVersion.getValue());
options.put(JavaCore.COMPILER_COMPLIANCE, javaVersion.getValue());
options.put(JavaCore.COMPILER_DOC_COMMENT_SUPPORT, "enabled");
parser.setCompilerOptions(options);
parser.setEnvironment(classPathEntries.toArray(new String[classPathEntries.size()]),
sourcePathEntries.toArray(new String[sourcePathEntries.size()]), null, true);
CompilationUnit cu = (CompilationUnit) parser.createAST(null);
return cu;
}