### 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.93 diff -u -r1.93 ASTParser.java --- dom/org/eclipse/jdt/core/dom/ASTParser.java 30 Nov 2009 22:38:25 -0000 1.93 +++ dom/org/eclipse/jdt/core/dom/ASTParser.java 2 Dec 2009 17:53:15 -0000 @@ -242,24 +242,24 @@ this.compilerOptions = options; } - /** - * Requests that the compiler should perform bindings recovery. - * When bindings recovery is enabled the compiler returns incomplete bindings. - *
- * Default to false
.
- *
This should be set to true only if bindings are resolved. It has no effect if there is no binding - * resolution.
- * - * @param enabledtrue
if incomplete bindings are expected,
- * and false
if only complete bindings are expected.
- *
- * @see IBinding#isRecovered()
- * @since 3.3
- */
- public void setBindingsRecovery(boolean enabled) {
- this.bindingsRecovery = enabled;
- }
+ /**
+ * Requests that the compiler should perform bindings recovery.
+ * When bindings recovery is enabled the compiler returns incomplete bindings.
+ *
+ * Default to false
.
+ *
This should be set to true only if bindings are resolved. It has no effect if there is no binding + * resolution.
+ * + * @param enabledtrue
if incomplete bindings are expected,
+ * and false
if only complete bindings are expected.
+ *
+ * @see IBinding#isRecovered()
+ * @since 3.3
+ */
+ public void setBindingsRecovery(boolean enabled) {
+ this.bindingsRecovery = enabled;
+ }
/**
* Sets the compiler options to be used when parsing.
* @@ -350,14 +350,14 @@ } /** - * Requests an abridged abstract syntax tree. - * By default, complete ASTs are returned. - *
- * When true
the resulting AST does not have nodes for
- * the entire compilation unit. Rather, the AST is only fleshed out
- * for the node that include the given source position. This kind of limited
- * AST is sufficient for certain purposes but totally unsuitable for others.
- * In places where it can be used, the limited AST offers the advantage of
+ * Requests an abridged abstract syntax tree.
+ * By default, complete ASTs are returned.
+ *
+ * When true
the resulting AST does not have nodes for
+ * the entire compilation unit. Rather, the AST is only fleshed out
+ * for the node that include the given source position. This kind of limited
+ * AST is sufficient for certain purposes but totally unsuitable for others.
+ * In places where it can be used, the limited AST offers the advantage of
* being smaller and faster to construct.
*
@@ -383,6 +383,9 @@ * compilation unit. *
* + *This focal position is not used when the AST is built using + * {@link #createASTs(ICompilationUnit[], String[], ASTRequestor, IProgressMonitor)}.
+ * * @param position a position into the corresponding body declaration */ public void setFocalPosition(int position) { @@ -392,7 +395,7 @@ /** * Sets the kind of constructs to be parsed from the source. - * Defaults to an entire compilation unit. + * Defaults to an entire compilation unit. ** When the parse is successful the result returned includes the ASTs for the * requested source: @@ -426,7 +429,7 @@ * * The contrived nodes do not have source positions. Other aspects of the * {@link CompilationUnit CompilationUnit} node are unspecified, including - * the exact arrangment of intervening nodes. + * the exact arrangement of intervening nodes. *
** Lexical or syntax errors detected while parsing can result in @@ -453,9 +456,12 @@ *
*
* Binding information is only computed when kind
is
- * K_COMPILATION_UNIT
.
+ * K_COMPILATION_UNIT
.
*
This kind is not used the AST is built using + * {@link #createASTs(ICompilationUnit[], String[], ASTRequestor, IProgressMonitor)}.
+ * * @param kind the kind of construct to parse: one of * {@link #K_COMPILATION_UNIT}, * {@link #K_CLASS_BODY_DECLARATIONS}, @@ -473,11 +479,14 @@ } /** - * Sets the source code to be parsed. - * + * Sets the source code to be parsed. + * + *This source is not used the AST is built using + * {@link #createASTs(ICompilationUnit[], String[], ASTRequestor, IProgressMonitor)}.
+ * * @param source the source string to be parsed, - * ornull
if none
- */
+ * or null
if none
+ */
public void setSource(char[] source) {
this.rawSource = source;
// clear the type root
@@ -485,29 +494,35 @@
}
/**
- * Sets the source code to be parsed.
- * This method automatically sets the project (and compiler
- * options) based on the given compilation unit, in a manner
- * equivalent to setProject(source.getJavaProject())
- *
+ * Sets the source code to be parsed.
+ * This method automatically sets the project (and compiler
+ * options) based on the given compilation unit, in a manner
+ * equivalent to setProject(source.getJavaProject())
+ *
+ * This source is not used the AST is built using + * {@link #createASTs(ICompilationUnit[], String[], ASTRequestor, IProgressMonitor)}.
+ * * @param source the Java model compilation unit whose source code - * is to be parsed, ornull
if none
- */
+ * is to be parsed, or null
if none
+ */
public void setSource(ICompilationUnit source) {
setSource((ITypeRoot)source);
}
/**
- * Sets the source code to be parsed.
- * This method automatically sets the project (and compiler
- * options) based on the given compilation unit, in a manner
- * equivalent to setProject(source.getJavaProject())
.
If the given class file has no source attachment, the creation of the - * ast will fail with an IllegalStateException.
- * + * Sets the source code to be parsed. + *This method automatically sets the project (and compiler
+ * options) based on the given compilation unit, in a manner
+ * equivalent to setProject(source.getJavaProject())
.
If the given class file has no source attachment, the creation of the + * ast will fail with an IllegalStateException.
+ * + *This source is not used the AST is built using + * {@link #createASTs(ICompilationUnit[], String[], ASTRequestor, IProgressMonitor)}.
+ * * @param source the Java model class file whose corresponding source code - * is to be parsed, ornull
if none
- */
+ * is to be parsed, or null
if none
+ */
public void setSource(IClassFile source) {
setSource((ITypeRoot)source);
}
@@ -520,6 +535,9 @@
* If the source is a class file without source attachment, the creation of the * ast will fail with an IllegalStateException.
* + *This source is not used the AST is built using + * {@link #createASTs(ICompilationUnit[], String[], ASTRequestor, IProgressMonitor)}.
+ * * @param source the Java model compilation unit or class file whose corresponding source code * is to be parsed, ornull
if none
* @since 3.3
@@ -541,6 +559,9 @@
* By default, the entire source string will be parsed
* (offset
0 and length
-1).
*
+ * This range is not used the AST is built using + * {@link #createASTs(ICompilationUnit[], String[], ASTRequestor, IProgressMonitor)}.
+ * * @param offset the index of the first character to parse * @param length the number of characters to parse, or -1 if * the remainder of the source string is to be parsed @@ -600,10 +621,10 @@ } /** - * Sets the name of the compilation unit that would hypothetically contains - * the source string. This is used in conjunction with {@link #setSource(char[])} - * and {@link #setProject(IJavaProject) } to locate the compilation unit relative to a Java project. - * Defaults to none (null
).
+ * Sets the name of the compilation unit that would hypothetically contains
+ * the source string. This is used in conjunction with {@link #setSource(char[])}
+ * and {@link #setProject(IJavaProject) } to locate the compilation unit relative to a Java project.
+ * Defaults to none (null
).
* * The name of the compilation unit must be supplied for resolving bindings. * This name should be suffixed by a dot ('.') followed by one of the @@ -615,10 +636,13 @@ * of the compilation unit must be "/P/Foo.java". * If the source declares a public class name "Bar" in a package "p1.p2" in a project "P" in a source folder "src", * the name of the compilation unit must be "/P/src/p1/p2/Bar.java".
- * + * + *This source is not used the AST is built using + * {@link #createASTs(ICompilationUnit[], String[], ASTRequestor, IProgressMonitor)}.
+ * * @param unitName the name of the compilation unit that would contain the source * string, ornull
if none
- */
+ */
public void setUnitName(String unitName) {
this.unitName = unitName;
}