### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: dom/org/eclipse/jdt/core/dom/ASTParser.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTParser.java,v retrieving revision 1.101 diff -u -r1.101 ASTParser.java --- dom/org/eclipse/jdt/core/dom/ASTParser.java 1 Jun 2010 06:10:53 -0000 1.101 +++ dom/org/eclipse/jdt/core/dom/ASTParser.java 1 Jun 2010 12:23:43 -0000 @@ -51,10 +51,8 @@ * parser.setSource(source); * // In order to parse 1.5 code, some compiler options need to be set to 1.5 * Map options = JavaCore.getOptions(); - * options.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_5); - * options.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_5); - * options.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_5); - * parset.setCompilerOptions(options); + * JavaCore.setComplianceOptions(JavaCore.VERSION_1_5, options); + * parser.setCompilerOptions(options); * CompilationUnit result = (CompilationUnit) parser.createAST(null); * * Once a configured parser instance has been used to create an AST, @@ -303,7 +301,7 @@ } /** - * Sets the environment that can be used when no {@link IJavaProject} are available. + * Sets the environment to be used when no {@link IJavaProject} is available. * *

The user has to make sure that all the required types are included either in the classpath or source paths. * All the paths containing binary types must be included in the classpathEntries whereas all paths containing @@ -574,6 +572,7 @@ * * @param source the source string to be parsed, * or null if none + * @see JavaCore#setComplianceOptions(String, Map) */ public void setSource(char[] source) { this.rawSource = source;