diff options
author | Stephan Herrmann | 2010-09-26 14:31:00 +0000 |
---|---|---|
committer | Stephan Herrmann | 2010-09-26 14:31:00 +0000 |
commit | ab1b97641d02b0fd330844d183218bd64c5b7c48 (patch) | |
tree | 34a49dcf54ed02e126d126a5a1f29813bda41358 /org.eclipse.jdt.core/dom/org | |
parent | 67cbf1c60b1857b0a30f5dd1524bb2b884688ced (diff) | |
download | org.eclipse.objectteams-ab1b97641d02b0fd330844d183218bd64c5b7c48.tar.gz org.eclipse.objectteams-ab1b97641d02b0fd330844d183218bd64c5b7c48.tar.xz org.eclipse.objectteams-ab1b97641d02b0fd330844d183218bd64c5b7c48.zip |
preparation for merging with v_B14a: cleanup remove trailing white space
Diffstat (limited to 'org.eclipse.jdt.core/dom/org')
153 files changed, 5853 insertions, 5797 deletions
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AST.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AST.java index 9c9f0967f..b0616a093 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AST.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AST.java @@ -37,12 +37,12 @@ import org.eclipse.text.edits.TextEdit; /** * Umbrella owner and abstract syntax tree node factory. * An <code>AST</code> instance serves as the common owner of any number of - * AST nodes, and as the factory for creating new AST nodes owned by that + * AST nodes, and as the factory for creating new AST nodes owned by that * instance. * <p> * Abstract syntax trees may be hand constructed by clients, using the * <code>new<i>TYPE</i></code> factory methods to create new nodes, and the - * various <code>set<i>CHILD</i></code> methods + * various <code>set<i>CHILD</i></code> methods * (see {@link org.eclipse.jdt.core.dom.ASTNode ASTNode} and its subclasses) * to connect them together. * </p> @@ -89,10 +89,10 @@ import org.eclipse.text.edits.TextEdit; * read-only AST. * </p> * <p> - * Clients may create instances of this class using {@link #newAST(int)}, + * Clients may create instances of this class using {@link #newAST(int)}, * but this class is not intended to be subclassed. * </p> - * + * * @see ASTParser * @see ASTNode * @since 2.0 @@ -114,7 +114,7 @@ public final class AST { * @deprecated Clients should use the {@link #JLS3} AST API instead. */ public static final int JLS2 = 2; - + /** * Internal synonym for {@link #JLS2}. Use to alleviate * deprecation warnings. @@ -130,37 +130,37 @@ public final class AST { * JLS3 is a superset of all earlier versions of the * Java language, and the JLS3 API can be used to manipulate * programs written in all versions of the Java language - * up to and including J2SE 5 (aka JDK 1.5). + * up to and including J2SE 5 (aka JDK 1.5). * * @since 3.1 */ public static final int JLS3 = 3; - + /** * The binding resolver for this AST. Initially a binding resolver that * does not resolve names at all. */ private BindingResolver resolver = new BindingResolver(); - + /** - * The event handler for this AST. + * The event handler for this AST. * Initially an event handler that does not nothing. * @since 3.0 */ private NodeEventHandler eventHandler = new NodeEventHandler(); - + /** * Level of AST API supported by this AST. * @since 3.0 */ int apiLevel; - + /** * Internal modification count; initially 0; increases monotonically * <b>by one or more</b> as the AST is successively modified. */ private long modificationCount = 0; - + /** * Internal original modification count; value is equals to <code> * modificationCount</code> at the end of the parse (<code>ASTParser @@ -320,7 +320,7 @@ public final class AST { IProgressMonitor monitor) { return null; } - + /** * Creates a new, empty abstract syntax tree using the given options. * <p> @@ -1234,8 +1234,8 @@ public final class AST { /** * Creates an unparented node of the given node class - * (non-abstract subclass of {@link ASTNode}). - * + * (non-abstract subclass of {@link ASTNode}). + * * @param nodeClass AST node class * @return a new unparented node owned by this AST * @exception IllegalArgumentException if <code>nodeClass</code> is @@ -1445,14 +1445,14 @@ public final class AST { * the binding be of kind VARIABLE. */ public SimpleName newResolvedVariableName(String name, Type type) { DefaultBindingResolver resolver = (DefaultBindingResolver)this.resolver; - org.eclipse.jdt.internal.compiler.ast.Expression givenCompilerNode = + org.eclipse.jdt.internal.compiler.ast.Expression givenCompilerNode = (org.eclipse.jdt.internal.compiler.ast.Expression)resolver.newAstToOldAst.get(type); long pos = ((long)givenCompilerNode.sourceStart << 32) + givenCompilerNode.sourceEnd; return createMappedVariableNode(name, givenCompilerNode.resolvedType, pos); } public SimpleName newResolvedVariableName(String name, TypeDeclaration type) { DefaultBindingResolver resolver = (DefaultBindingResolver)this.resolver; - org.eclipse.jdt.internal.compiler.ast.TypeDeclaration givenCompilerNode = + org.eclipse.jdt.internal.compiler.ast.TypeDeclaration givenCompilerNode = (org.eclipse.jdt.internal.compiler.ast.TypeDeclaration)resolver.newAstToOldAst.get(type); long pos = ((long)givenCompilerNode.sourceStart << 32) + givenCompilerNode.sourceEnd; return createMappedVariableNode(name, givenCompilerNode.binding, pos); @@ -1460,10 +1460,10 @@ public final class AST { private SimpleName createMappedVariableNode(String name, org.eclipse.jdt.internal.compiler.lookup.TypeBinding typeBinding, - long pos) + long pos) { - org.eclipse.jdt.internal.compiler.ast.SingleNameReference newCompilerNode - = new org.eclipse.jdt.internal.compiler.ast.SingleNameReference(name.toCharArray(), pos); + org.eclipse.jdt.internal.compiler.ast.SingleNameReference newCompilerNode + = new org.eclipse.jdt.internal.compiler.ast.SingleNameReference(name.toCharArray(), pos); newCompilerNode.resolvedType = typeBinding; newCompilerNode.binding = new LocalVariableBinding(name.toCharArray(), typeBinding, 0, false); SimpleName result = newSimpleName(name); @@ -1596,7 +1596,7 @@ public final class AST { return result; } // SH} - + /** * Creates and returns a new unparented qualified type node with * the given qualifier type and name. @@ -1638,7 +1638,7 @@ public final class AST { /** * Creates and returns a new unparented lifting type node with the given * type name. - * + * * @param typeName the name of the class or interface * @return a new unparented lifting type node * @exception IllegalArgumentException if: @@ -1712,29 +1712,29 @@ public final class AST { //{ObjectTeams: /** * Creates an unparented class declaration node owned by this AST. - * The name of the class is an unspecified, but legal, name; - * no modifiers; no doc comment; no superclass or superinterfaces; + * The name of the class is an unspecified, but legal, name; + * no modifiers; no doc comment; no superclass or superinterfaces; * and an empty class body. * <p> * To create an interface, use this method and then call * <code>RoleTypeDeclaration.setInterface(true)</code>. * </p> - * + * * @return a new unparented roleType declaration node */ public RoleTypeDeclaration newRoleTypeDeclaration() { RoleTypeDeclaration result = new RoleTypeDeclaration(this); return result; - } - + } + public PrecedenceDeclaration newPrecedenceDeclaration() { return new PrecedenceDeclaration(this); } - + public GuardPredicateDeclaration newGuardPredicateDeclaration () { return new GuardPredicateDeclaration(this); } -// km(merge) } +// km(merge) } /** * Creates an unparented method declaration node owned by this AST. @@ -1941,7 +1941,7 @@ public final class AST { if (Modifier.isVolatile(flags)) { result.add(newModifier(Modifier.ModifierKeyword.VOLATILE_KEYWORD)); } -//{ObjectTeams: OT-specific modifiers (any context): +//{ObjectTeams: OT-specific modifiers (any context): if (Modifier.isReplace(flags) || Modifier.isBefore(flags) || Modifier.isAfter(flags)) throw new IllegalArgumentException("not applicable for callin modifiers"); //$NON-NLS-1$ @@ -1957,7 +1957,7 @@ public final class AST { if (Modifier.isCallin(flags)) { result.add(newModifier(Modifier.ModifierKeyword.CALLIN_KEYWORD)); } -// SH} +// SH} return result; } @@ -1965,7 +1965,7 @@ public final class AST { /** * Creates an unparented callin mapping declaration node owned by this AST. * The binding kind is set to {@link MethodBindingOperator#KIND_CALLIN} - * + * * @return a new unparented callin mapping declaration node */ public CallinMappingDeclaration newCallinMappingDeclaration() @@ -1979,7 +1979,7 @@ public final class AST { * Creates an unparented callout mapping declaration node owned by this AST. * The binding kind is set to {@link MethodBindingOperator#KIND_CALLOUT}, * clients creating a callout override must change this property afterwards. - * + * * @return a new unparented callout mapping declaration node */ public CalloutMappingDeclaration newCalloutMappingDeclaration() @@ -1989,7 +1989,7 @@ public final class AST { return calloutMappingDeclaration; } - /** + /** * creates a new unparented method bidning operator node owned by this AST. * @param keyword one of before/replace/after (callin) or get/set (c-t-f) or null (regular callout) * @param bindingKind one of {@link MethodBindingOperator#KIND_CALLOUT}, {@link MethodBindingOperator#KIND_CALLOUT_OVERRIDE} or {@link MethodBindingOperator#KIND_CALLIN}. @@ -2008,21 +2008,21 @@ public final class AST { //{ObjectTeams: factory method for MethodSpec /** * Creates an unparented method spec declaration node owned by this AST. - * + * * @return a new unparented method spec declaration node - */ + */ public MethodSpec newMethodSpec() { return new MethodSpec(this); } //gbr} - + // {ObjectTeams: factory method for FieldAccessSpec /** * Creates an unparented method spec declaration node owned by this AST. - * + * * @return a new unparented method spec declaration node - */ + */ public FieldAccessSpec newFieldAccessSpec() { return new FieldAccessSpec(this); @@ -2476,29 +2476,29 @@ public final class AST { /** * Creates a new unparented within statement node owned by this AST, * for an empty list of statements. - * + * * @return a new unparented, empty within statement node - * + * */ public WithinStatement newWithinStatement() { return new WithinStatement(this); } //gbr} - + // {ObjectTeams: factory method for ParameterMapping /** * Creates a new unparented parameter mapping node owned by this AST - * + * * @return a new unparented, empty parameter mapping node - * + * */ public ParameterMapping newParameterMapping() { return new ParameterMapping(this); } //jsv} - + //=============================== EXPRESSIONS =========================== /** * Creates and returns a new unparented string literal node for @@ -2945,9 +2945,9 @@ public final class AST { //{ObjectTeams: factory methods for TSuperMessageSend, BaseConstructorMessageSend, BaseReference, BaseCallMessageSend /** - * Creates and returns a new unparented "tsuper" expression node + * Creates and returns a new unparented "tsuper" expression node * owned by this AST. By default, there is no qualifier. - * + * * @return a new unparented "tsuper" expression node */ public TSuperMessageSend newTSuperMessageSend() @@ -2956,9 +2956,9 @@ public final class AST { } /** - * Creates and returns a new unparented "tsuper" statement node + * Creates and returns a new unparented "tsuper" statement node * owned by this AST. By default, there is no qualifier. - * + * * @return a new unparented "tsuper" expression node */ public TSuperConstructorInvocation newTSuperConstructorInvocation() @@ -2966,33 +2966,33 @@ public final class AST { return new TSuperConstructorInvocation(this); } - - + + /** - * Creates and returns a new unparented "base" callout node + * Creates and returns a new unparented "base" callout node * owned by this AST. - * + * * @return a new unparented "base" callout node */ public BaseCallMessageSend newBaseCallMessageSend() { return new BaseCallMessageSend(this); } - - - + + + /** - * Creates and returns a new unparented "base" constructor expression node + * Creates and returns a new unparented "base" constructor expression node * owned by this AST. - * + * * @return a new unparented "base" constructor expression node */ public BaseConstructorInvocation newBaseConstructorInvocation() { return new BaseConstructorInvocation(this); - } + } //gbr,mkr} - + //=============================== ANNOTATIONS ==================== /** diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTConverter.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTConverter.java index e0f00f0d5..74ee60784 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTConverter.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTConverter.java @@ -95,7 +95,7 @@ class ASTConverter { // comments protected boolean insideComments; protected IProgressMonitor monitor; - protected Set pendingNameScopeResolution; + protected Set pendingNameScopeResolution; protected Set pendingThisExpressionScopeResolution; protected boolean resolveBindings; Scanner scanner; @@ -134,7 +134,7 @@ class ASTConverter { this.scanner.parseOTJonly = JavaCore.DISABLED.equals(option); // SH} } - + protected void adjustSourcePositionsForParent(org.eclipse.jdt.internal.compiler.ast.Expression expression) { int start = expression.sourceStart; int end = expression.sourceEnd; @@ -169,14 +169,14 @@ class ASTConverter { org.eclipse.jdt.internal.compiler.ast.TypeDeclaration[] members = typeDeclaration.memberTypes; org.eclipse.jdt.internal.compiler.ast.FieldDeclaration[] fields = typeDeclaration.fields; org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration[] methods = typeDeclaration.methods; - + int fieldsLength = fields == null? 0 : fields.length; int methodsLength = methods == null? 0 : methods.length; int membersLength = members == null ? 0 : members.length; int fieldsIndex = 0; int methodsIndex = 0; int membersIndex = 0; - + //{ObjectTeams: more setup before the loop: // members were sorted by inheritance, restore lexical order: if (typeDeclaration.isTeam() && members != null) @@ -185,26 +185,26 @@ class ASTConverter { org.eclipse.jdt.internal.compiler.ast.TypeDeclaration t2) { return (t1.sourceStart < t2.sourceStart) ? -1 : 1; }}); - + // method mapping declarations (callins, callouts) AbstractMethodMappingDeclaration[] callinCallouts = typeDeclaration.callinCallouts; int methodMappingsLength = callinCallouts == null ? 0 : callinCallouts.length; int methodMappingsIndex = 0; //gbr+SH} - + while ((fieldsIndex < fieldsLength) || (membersIndex < membersLength) || (methodsIndex < methodsLength) -//{ObjectTeams +//{ObjectTeams || (methodMappingsIndex < methodMappingsLength)) { -//gbr} +//gbr} org.eclipse.jdt.internal.compiler.ast.FieldDeclaration nextFieldDeclaration = null; org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration nextMethodDeclaration = null; org.eclipse.jdt.internal.compiler.ast.TypeDeclaration nextMemberDeclaration = null; //{ObjectTeams org.eclipse.objectteams.otdt.internal.core.compiler.ast.AbstractMethodMappingDeclaration nextMethodMappingDeclaration = null; -//gbr} - +//gbr} + int position = Integer.MAX_VALUE; int nextDeclarationType = -1; if (fieldsIndex < fieldsLength) { @@ -228,7 +228,7 @@ class ASTConverter { nextDeclarationType = 2; // MEMBER } } -//{ObjectTeams: case added for method mappings +//{ObjectTeams: case added for method mappings if (methodMappingsIndex < methodMappingsLength) { nextMethodMappingDeclaration = callinCallouts[methodMappingsIndex]; @@ -238,7 +238,7 @@ class ASTConverter { nextDeclarationType = 3; // METHOD_MAPPING } } -//gbr} +//gbr} switch (nextDeclarationType) { case 0 : //{ObjectTeams: skip generated: @@ -269,7 +269,7 @@ class ASTConverter { { typeDecl.bodyDeclarations().add(convert(nextMethodDeclaration)); } -//{ObjectTeams: convert reused abstract method declaration +//{ObjectTeams: convert reused abstract method declaration else if (isReusedAbstractMethodDeclaration(typeDeclaration,nextMethodDeclaration)) { typeDecl.bodyDeclarations().add(convertReusedAbstractMethodDeclaration(nextMethodDeclaration)); @@ -279,12 +279,12 @@ class ASTConverter { case 2 : membersIndex++; //{ObjectTeams: skip generated members and role files when visited via enclosing team - conditionally: - if ( nextMemberDeclaration.isGenerated + if ( nextMemberDeclaration.isGenerated || Flags.isSynthetic(nextMemberDeclaration.modifiers)) continue; if (!this.includeRoleFiles && nextMemberDeclaration.isRoleFile()) continue; -// SH, jwl} +// SH, jwl} ASTNode node = convert(nextMemberDeclaration); if (node == null) { typeDecl.setFlags(typeDecl.getFlags() | ASTNode.MALFORMED); @@ -299,33 +299,33 @@ class ASTConverter { { typeDecl.bodyDeclarations().add(convert(nextMethodMappingDeclaration)); } -//gbr} +//gbr} } } // Convert javadoc convert(typeDeclaration.javadoc, typeDecl); } - + protected void buildBodyDeclarations(org.eclipse.jdt.internal.compiler.ast.TypeDeclaration enumDeclaration2, EnumDeclaration enumDeclaration) { // add body declaration in the lexical order org.eclipse.jdt.internal.compiler.ast.TypeDeclaration[] members = enumDeclaration2.memberTypes; org.eclipse.jdt.internal.compiler.ast.FieldDeclaration[] fields = enumDeclaration2.fields; org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration[] methods = enumDeclaration2.methods; - + int fieldsLength = fields == null? 0 : fields.length; int methodsLength = methods == null? 0 : methods.length; int membersLength = members == null ? 0 : members.length; int fieldsIndex = 0; int methodsIndex = 0; int membersIndex = 0; - + while ((fieldsIndex < fieldsLength) || (membersIndex < membersLength) || (methodsIndex < methodsLength)) { org.eclipse.jdt.internal.compiler.ast.FieldDeclaration nextFieldDeclaration = null; org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration nextMethodDeclaration = null; org.eclipse.jdt.internal.compiler.ast.TypeDeclaration nextMemberDeclaration = null; - + int position = Integer.MAX_VALUE; int nextDeclarationType = -1; if (fieldsIndex < fieldsLength) { @@ -372,27 +372,27 @@ class ASTConverter { } convert(enumDeclaration2.javadoc, enumDeclaration); } - + protected void buildBodyDeclarations(org.eclipse.jdt.internal.compiler.ast.TypeDeclaration expression, AnonymousClassDeclaration anonymousClassDeclaration) { // add body declaration in the lexical order org.eclipse.jdt.internal.compiler.ast.TypeDeclaration[] members = expression.memberTypes; org.eclipse.jdt.internal.compiler.ast.FieldDeclaration[] fields = expression.fields; org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration[] methods = expression.methods; - + int fieldsLength = fields == null? 0 : fields.length; int methodsLength = methods == null? 0 : methods.length; int membersLength = members == null ? 0 : members.length; int fieldsIndex = 0; int methodsIndex = 0; int membersIndex = 0; - + while ((fieldsIndex < fieldsLength) || (membersIndex < membersLength) || (methodsIndex < methodsLength)) { org.eclipse.jdt.internal.compiler.ast.FieldDeclaration nextFieldDeclaration = null; org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration nextMethodDeclaration = null; org.eclipse.jdt.internal.compiler.ast.TypeDeclaration nextMemberDeclaration = null; - + int position = Integer.MAX_VALUE; int nextDeclarationType = -1; if (fieldsIndex < fieldsLength) { @@ -430,17 +430,17 @@ class ASTConverter { if (!nextMethodDeclaration.isDefaultConstructor() && !nextMethodDeclaration.isClinit() //{ObjectTeams: ignore generated and copied method declarations && !nextMethodDeclaration.isGenerated - && !nextMethodDeclaration.isCopied) + && !nextMethodDeclaration.isCopied) { -//jwl}) +//jwl}) anonymousClassDeclaration.bodyDeclarations().add(convert(nextMethodDeclaration)); } -//{ObjectTeams: convert reused abstract method declaration +//{ObjectTeams: convert reused abstract method declaration else if (isReusedAbstractMethodDeclaration(expression, nextMethodDeclaration)) { anonymousClassDeclaration.bodyDeclarations().add(convertReusedAbstractMethodDeclaration(nextMethodDeclaration)); } -//jsv} +//jsv} break; case 2 : membersIndex++; @@ -457,7 +457,7 @@ class ASTConverter { } } } - + /** * @param compilationUnit * @param comments @@ -481,14 +481,14 @@ class ASTConverter { } compilationUnit.setCommentTable(this.commentsTable); } - + protected void checkAndAddMultipleFieldDeclaration(org.eclipse.jdt.internal.compiler.ast.FieldDeclaration[] fields, int index, List bodyDeclarations) { -//{ObjecTeams: ignore generated field declarations +//{ObjecTeams: ignore generated field declarations if (Flags.isSynthetic(fields[index].modifiers) || fields[index].copyInheritanceSrc != null) { return; } -//jwl} +//jwl} if (fields[index] instanceof org.eclipse.jdt.internal.compiler.ast.Initializer) { org.eclipse.jdt.internal.compiler.ast.Initializer oldInitializer = (org.eclipse.jdt.internal.compiler.ast.Initializer) fields[index]; Initializer initializer = new Initializer(this.ast); @@ -550,7 +550,7 @@ class ASTConverter { } } } - + public ASTNode convert(org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration methodDeclaration) { checkCanceled(); if (methodDeclaration instanceof org.eclipse.jdt.internal.compiler.ast.AnnotationMethodDeclaration) { @@ -653,7 +653,7 @@ class ASTConverter { methodDecl.setSourceRange(startPosition, closingPosition - startPosition + 1); org.eclipse.jdt.internal.compiler.ast.Statement[] statements = methodDeclaration.statements; - + start = retrieveStartBlockPosition(methodHeaderEnd, methodDeclaration.bodyStart); if (start == -1) start = methodDeclaration.bodyStart; // use recovery position for body start end = retrieveRightBrace(methodDeclaration.bodyEnd, methodDeclaration.declarationSourceEnd); @@ -673,7 +673,7 @@ class ASTConverter { int statementsLength = statements == null ? 0 : statements.length; for (int i = 0; i < statementsLength; i++) { //{ObjectTeams: ignore generated local declarations within method declarations - if ((statements[i] instanceof org.eclipse.jdt.internal.compiler.ast.LocalDeclaration) + if ((statements[i] instanceof org.eclipse.jdt.internal.compiler.ast.LocalDeclaration) && ((org.eclipse.jdt.internal.compiler.ast.LocalDeclaration)statements[i]).isGenerated) { continue; } @@ -719,7 +719,7 @@ class ASTConverter { block.setSourceRange(start, end - start + 1); methodDecl.setBody(block); } - } + } } org.eclipse.jdt.internal.compiler.ast.TypeParameter[] typeParameters = methodDeclaration.typeParameters(); @@ -734,7 +734,7 @@ class ASTConverter { } } } - + // The javadoc comment is now got from list store in compilation unit declaration convert(methodDeclaration.javadoc, methodDecl); if (this.resolveBindings) { @@ -743,9 +743,9 @@ class ASTConverter { methodDecl.resolveBinding(); } return methodDecl; - } - -//{ObjectTeams: convert method for OT-specific internal type AbstractMethodMappingDeclaration + } + +//{ObjectTeams: convert method for OT-specific internal type AbstractMethodMappingDeclaration public org.eclipse.jdt.core.dom.AbstractMethodMappingDeclaration convert( AbstractMethodMappingDeclaration abstractMethodMapping) { @@ -759,7 +759,7 @@ class ASTConverter { } throw new IllegalArgumentException("There does not exist a method binding of type" + abstractMethodMapping.getClass()); //$NON-NLS-1$ } -//gbr} +//gbr} // {ObjectTeams: convert methods for OT-specific internal types CallinMappingDeclaration // and CalloutMappingDeclaration public CallinMappingDeclaration convert( @@ -768,7 +768,7 @@ class ASTConverter { .newCallinMappingDeclaration(); // annotations - setModifiers(result, callinMapping); + setModifiers(result, callinMapping); // name if (callinMapping.hasName()) { @@ -776,7 +776,7 @@ class ASTConverter { labelName.setSourceRange(callinMapping.sourceStart, callinMapping.sourceEnd - callinMapping.sourceStart + 1); result.setName(labelName); } - + // left side, role method if (callinMapping.roleMethodSpec != null) result.setRoleMappingElement(convert(callinMapping.roleMethodSpec)); @@ -825,7 +825,7 @@ class ASTConverter { modifierStart += 2; // skip "<-" modifierLength= 0; break; - } + } MethodBindingOperator bindingOperator = this.ast.newMethodBindingOperator(keyword, MethodBindingOperator.KIND_CALLIN); bindingOperator.setSourceRange(callinMapping.bindingTokenStart, callinMapping.modifierEnd-callinMapping.bindingTokenStart+1); bindingOperator.bindingModifier().setSourceRange(modifierStart, modifierLength); @@ -847,7 +847,7 @@ class ASTConverter { { org.eclipse.jdt.core.dom.CalloutMappingDeclaration result = this.ast .newCalloutMappingDeclaration(); - + // annotations setModifiers(result, calloutMapping); @@ -886,7 +886,7 @@ class ASTConverter { result.resolveBinding(); } result.setSignatureFlag(calloutMapping.hasSignature); - + // binding operator (kind and modifier) ModifierKeyword keyword = null; int modifierStart = calloutMapping.modifierStart; @@ -1003,7 +1003,7 @@ class ASTConverter { else result.setReturnType(returnType); } - + org.eclipse.jdt.internal.compiler.ast.Argument[] parameters = methodSpec.arguments; if (parameters != null) { int parametersLength = parameters.length; @@ -1011,7 +1011,7 @@ class ASTConverter { result.parameters().add(convert(parameters[idx])); } } - + org.eclipse.jdt.internal.compiler.ast.TypeParameter[] typeParameters = methodSpec.typeParameters; if (typeParameters != null) if (this.ast.apiLevel == AST.JLS3) @@ -1023,7 +1023,7 @@ class ASTConverter { methodSpec.declarationSourceEnd - methodSpec.declarationSourceStart + 1); - result.setSignatureFlag(methodSpec.hasSignature); + result.setSignatureFlag(methodSpec.hasSignature); result.setCovariantReturnFlag(methodSpec.covariantReturn); if (this.resolveBindings) { @@ -1033,9 +1033,9 @@ class ASTConverter { return result; } -//gbr} +//gbr} + - public ClassInstanceCreation convert(org.eclipse.jdt.internal.compiler.ast.AllocationExpression expression) { ClassInstanceCreation classInstanceCreation = new ClassInstanceCreation(this.ast); if (this.resolveBindings) { @@ -1104,10 +1104,10 @@ class ASTConverter { for (int i = 0; i < size - 1; i++) { Expression expr = temp; temp = new InfixExpression(this.ast); - + if (this.resolveBindings) { this.recordNodes(temp, expression); - } + } temp.setLeftOperand(expr); temp.setOperator(getOperatorFor(expressionOperatorID)); temp.setSourceRange(expr.getStartPosition(), expr.getLength()); @@ -1158,7 +1158,7 @@ class ASTConverter { typeName.setSourceRange(typeDeclaration.sourceStart, typeDeclaration.sourceEnd - typeDeclaration.sourceStart + 1); typeDecl.setName(typeName); typeDecl.setSourceRange(typeDeclaration.declarationSourceStart, typeDeclaration.bodyEnd - typeDeclaration.declarationSourceStart + 1); - + buildBodyDeclarations(typeDeclaration, typeDecl); // The javadoc comment is now got from list store in compilation unit declaration if (this.resolveBindings) { @@ -1168,7 +1168,7 @@ class ASTConverter { } return typeDecl; } - + public ASTNode convert(org.eclipse.jdt.internal.compiler.ast.AnnotationMethodDeclaration annotationTypeMemberDeclaration) { checkCanceled(); if (this.ast.apiLevel == AST.JLS2_INTERNAL) { @@ -1203,11 +1203,11 @@ class ASTConverter { } return annotationTypeMemberDeclaration2; } - + public SingleVariableDeclaration convert(org.eclipse.jdt.internal.compiler.ast.Argument argument) { SingleVariableDeclaration variableDecl = new SingleVariableDeclaration(this.ast); setModifiers(variableDecl, argument); -//{ObjectTeams: we have to check the variable name e.g. in a LiftingType +//{ObjectTeams: we have to check the variable name e.g. in a LiftingType String[] tokens = (new String(argument.name)).split("\\"+IOTConstants.JAVA_SEPARATOR); //$NON-NLS-1$ String realName = tokens[tokens.length-1]; final SimpleName name = new SimpleName(this.ast); @@ -1215,7 +1215,7 @@ class ASTConverter { /* orig: name.internalSetIdentifier(new String(argument.name)); :giro */ -//jsv} Original: +//jsv} Original: int start = argument.sourceStart; int nameEnd = argument.sourceEnd; name.setSourceRange(start, nameEnd - start + 1); @@ -1244,7 +1244,7 @@ class ASTConverter { setTypeForSingleVariableDeclaration(variableDecl, type, extraDimensions); } variableDecl.setSourceRange(argument.declarationSourceStart, rightEnd - argument.declarationSourceStart + 1); - + if (isVarArgs) { switch(this.ast.apiLevel) { case AST.JLS2_INTERNAL : @@ -1262,7 +1262,7 @@ class ASTConverter { return variableDecl; } - + public Annotation convert(org.eclipse.jdt.internal.compiler.ast.Annotation annotation) { if (annotation instanceof org.eclipse.jdt.internal.compiler.ast.SingleMemberAnnotation) { return convert((org.eclipse.jdt.internal.compiler.ast.SingleMemberAnnotation) annotation); @@ -1280,7 +1280,7 @@ class ASTConverter { } arrayCreation.setSourceRange(expression.sourceStart, expression.sourceEnd - expression.sourceStart + 1); org.eclipse.jdt.internal.compiler.ast.Expression[] dimensions = expression.dimensions; - + int dimensionsLength = dimensions.length; for (int i = 0; i < dimensionsLength; i++) { if (dimensions[i] != null) { @@ -1294,7 +1294,7 @@ class ASTConverter { Type type = convertType(expression.type); if (this.resolveBindings) { recordNodes(type, expression.type); - } + } ArrayType arrayType = null; if (type.isArrayType()) { arrayType = (ArrayType) type; @@ -1302,7 +1302,7 @@ class ASTConverter { arrayType = this.ast.newArrayType(type, dimensionsLength); if (this.resolveBindings) { completeRecord(arrayType, expression); - } + } int start = type.getStartPosition(); int end = type.getStartPosition() + type.getLength(); int previousSearchStart = end - 1; @@ -1316,7 +1316,7 @@ class ASTConverter { arrayCreation.setType(arrayType); if (this.resolveBindings) { recordNodes(arrayType, expression); - } + } if (expression.initializer != null) { arrayCreation.setInitializer(convert(expression.initializer)); } @@ -1375,7 +1375,7 @@ class ASTConverter { } return assertStatement; } - + public Assignment convert(org.eclipse.jdt.internal.compiler.ast.Assignment expression) { Assignment assignment = new Assignment(this.ast); if (this.resolveBindings) { @@ -1428,7 +1428,7 @@ class ASTConverter { if (!nextMethodDeclaration.isDefaultConstructor() && !nextMethodDeclaration.isClinit()) { //{ObjectTeams: ignore generated and copied method declarations if (!nextMethodDeclaration.isGenerated && !nextMethodDeclaration.isCopied) -//jwl} +//jwl} typeDecl.bodyDeclarations().add(convert(nextMethodDeclaration)); } } else if(node instanceof org.eclipse.jdt.internal.compiler.ast.TypeDeclaration) { @@ -1446,7 +1446,7 @@ class ASTConverter { } return typeDecl; } - + public Expression convert(org.eclipse.jdt.internal.compiler.ast.BinaryExpression expression) { InfixExpression infixExpression = new InfixExpression(this.ast); if (this.resolveBindings) { @@ -1512,7 +1512,7 @@ class ASTConverter { case org.eclipse.jdt.internal.compiler.ast.OperatorIds.LESS : infixExpression.setOperator(InfixExpression.Operator.LESS); } - + if (expression.left instanceof org.eclipse.jdt.internal.compiler.ast.BinaryExpression && ((expression.left.bits & org.eclipse.jdt.internal.compiler.ast.ASTNode.ParenthesizedMASK) == 0)) { // create an extended string literal equivalent => use the extended operands list @@ -1539,10 +1539,10 @@ class ASTConverter { for (int i = 0; i < size - 1; i++) { Expression expr = temp; temp = new InfixExpression(this.ast); - + if (this.resolveBindings) { this.recordNodes(temp, expression); - } + } temp.setLeftOperand(expr); temp.setOperator(getOperatorFor(expressionOperatorID)); temp.setSourceRange(expr.getStartPosition(), expr.getLength()); @@ -1608,19 +1608,19 @@ class ASTConverter { if (statements[i] instanceof org.eclipse.jdt.internal.compiler.ast.LocalDeclaration //{ObjectTeams: ignore generated local declarations within blocs && !((org.eclipse.jdt.internal.compiler.ast.LocalDeclaration)statements[i]).isGenerated) { -//jwl} +//jwl} checkAndAddMultipleLocalDeclaration(statements, i, block.statements()); } else { Statement statement2 = convert(statements[i]); if (statement2 != null) { block.statements().add(statement2); } - } + } } } return block; } - + // {ObjectTeams: convert method for OT-specific internal type WithinStatement /** * Converts internal compiler type WithinStatement to dom type WithinStatement. @@ -1646,7 +1646,7 @@ class ASTConverter { * _OT$team$206.deactivate(_OT$level206); * } * </code> - */ + */ public org.eclipse.jdt.core.dom.WithinStatement convert(WithinStatement statement) { org.eclipse.jdt.core.dom.WithinStatement result = this.ast.newWithinStatement(); @@ -1657,7 +1657,7 @@ class ASTConverter { } result.setTeamExpression(convert(statement.getTeamExpression())); - + org.eclipse.jdt.internal.compiler.ast.Statement[] statements = statement.statements; if (statements != null) { @@ -1666,20 +1666,20 @@ class ASTConverter { if (statements[idx] instanceof org.eclipse.jdt.internal.compiler.ast.TryStatement) { org.eclipse.jdt.internal.compiler.ast.TryStatement tryStatement = - (org.eclipse.jdt.internal.compiler.ast.TryStatement)statements[idx]; - Block tryBlock = convert(tryStatement.tryBlock); + (org.eclipse.jdt.internal.compiler.ast.TryStatement)statements[idx]; + Block tryBlock = convert(tryStatement.tryBlock); tryBlock.setParent(null, null); result.setBody(tryBlock); break; } } } - + return result; } //mkr} - - + + public BreakStatement convert(org.eclipse.jdt.internal.compiler.ast.BreakStatement statement) { BreakStatement breakStatement = new BreakStatement(this.ast); breakStatement.setSourceRange(statement.sourceStart, statement.sourceEnd - statement.sourceStart + 1); @@ -1691,8 +1691,8 @@ class ASTConverter { } return breakStatement; } - - + + public SwitchCase convert(org.eclipse.jdt.internal.compiler.ast.CaseStatement statement) { SwitchCase switchCase = new SwitchCase(this.ast); org.eclipse.jdt.internal.compiler.ast.Expression constantExpression = statement.constantExpression; @@ -1724,7 +1724,7 @@ class ASTConverter { } public CharacterLiteral convert(org.eclipse.jdt.internal.compiler.ast.CharLiteral expression) { - int length = expression.sourceEnd - expression.sourceStart + 1; + int length = expression.sourceEnd - expression.sourceStart + 1; int sourceStart = expression.sourceStart; CharacterLiteral literal = new CharacterLiteral(this.ast); if (this.resolveBindings) { @@ -1744,7 +1744,7 @@ class ASTConverter { typeLiteral.setType(convertType(expression.type)); return typeLiteral; } - + public CompilationUnit convert(org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration unit, char[] source) { try { if(unit.compilationResult.recoveryScannerData != null) { @@ -1757,13 +1757,13 @@ class ASTConverter { this.scanner.setSource(source, unit.compilationResult); CompilationUnit compilationUnit = new CompilationUnit(this.ast); compilationUnit.setStatementsRecoveryData(unit.compilationResult.recoveryScannerData); - + // Parse comments int[][] comments = unit.comments; if (comments != null) { buildCommentsTable(compilationUnit, comments); } - + // handle the package declaration immediately // There is no node corresponding to the package declaration if (this.resolveBindings) { @@ -1780,7 +1780,7 @@ class ASTConverter { compilationUnit.imports().add(convertImport(imports[i])); } } - + org.eclipse.jdt.internal.compiler.ast.TypeDeclaration[] types = unit.types; if (types != null) { int typesLength = types.length; @@ -1801,7 +1801,7 @@ class ASTConverter { } } compilationUnit.setSourceRange(unit.sourceStart, unit.sourceEnd - unit.sourceStart + 1); - + int problemLength = unit.compilationResult.problemCount; if (problemLength != 0) { CategorizedProblem[] resizedProblems = null; @@ -1910,7 +1910,7 @@ class ASTConverter { } return continueStatement; } - + public DoStatement convert(org.eclipse.jdt.internal.compiler.ast.DoStatement statement) { DoStatement doStatement = new DoStatement(this.ast); doStatement.setSourceRange(statement.sourceStart, statement.sourceEnd - statement.sourceStart + 1); @@ -1922,7 +1922,7 @@ class ASTConverter { } public NumberLiteral convert(org.eclipse.jdt.internal.compiler.ast.DoubleLiteral expression) { - int length = expression.sourceEnd - expression.sourceStart + 1; + int length = expression.sourceEnd - expression.sourceStart + 1; int sourceStart = expression.sourceStart; NumberLiteral literal = new NumberLiteral(this.ast); literal.internalSetToken(new String(this.compilationUnitSource, sourceStart, length)); @@ -1933,13 +1933,13 @@ class ASTConverter { removeLeadingAndTrailingCommentsFromLiteral(literal); return literal; } - + public EmptyStatement convert(org.eclipse.jdt.internal.compiler.ast.EmptyStatement statement) { EmptyStatement emptyStatement = new EmptyStatement(this.ast); emptyStatement.setSourceRange(statement.sourceStart, statement.sourceEnd - statement.sourceStart + 1); return emptyStatement; } - + // field is an enum constant public EnumConstantDeclaration convert(org.eclipse.jdt.internal.compiler.ast.FieldDeclaration enumConstant) { checkCanceled(); @@ -2011,9 +2011,9 @@ class ASTConverter { infixExpression.setOperator(InfixExpression.Operator.NOT_EQUALS); } return infixExpression; - + } - + public Statement convert(org.eclipse.jdt.internal.compiler.ast.ExplicitConstructorCall statement) { Statement newStatement; int sourceStart = statement.sourceStart; @@ -2033,7 +2033,7 @@ class ASTConverter { } newStatement = result; } else -//mkr} +//mkr} if (statement.isSuperAccess() || statement.isSuper()) { SuperConstructorInvocation superConstructorInvocation = new SuperConstructorInvocation(this.ast); if (statement.qualification != null) { @@ -2105,7 +2105,7 @@ class ASTConverter { } if (expression instanceof org.eclipse.jdt.internal.compiler.ast.Annotation) { return convert((org.eclipse.jdt.internal.compiler.ast.Annotation) expression); - } + } if (expression instanceof org.eclipse.jdt.internal.compiler.ast.CastExpression) { return convert((org.eclipse.jdt.internal.compiler.ast.CastExpression) expression); } @@ -2163,7 +2163,7 @@ class ASTConverter { } if (expression instanceof org.eclipse.jdt.internal.compiler.ast.LongLiteralMinValue) { return convert((org.eclipse.jdt.internal.compiler.ast.LongLiteralMinValue) expression); - } + } if (expression instanceof org.eclipse.jdt.internal.compiler.ast.LongLiteral) { return convert((org.eclipse.jdt.internal.compiler.ast.LongLiteral) expression); } @@ -2172,34 +2172,34 @@ class ASTConverter { } if (expression instanceof org.eclipse.jdt.internal.compiler.ast.ExtendedStringLiteral) { return convert((org.eclipse.jdt.internal.compiler.ast.ExtendedStringLiteral) expression); - } + } if (expression instanceof org.eclipse.jdt.internal.compiler.ast.StringLiteral) { return convert((org.eclipse.jdt.internal.compiler.ast.StringLiteral) expression); - } + } if (expression instanceof org.eclipse.jdt.internal.compiler.ast.AND_AND_Expression) { return convert((org.eclipse.jdt.internal.compiler.ast.AND_AND_Expression) expression); - } + } if (expression instanceof org.eclipse.jdt.internal.compiler.ast.OR_OR_Expression) { return convert((org.eclipse.jdt.internal.compiler.ast.OR_OR_Expression) expression); - } + } if (expression instanceof org.eclipse.jdt.internal.compiler.ast.EqualExpression) { return convert((org.eclipse.jdt.internal.compiler.ast.EqualExpression) expression); - } + } if (expression instanceof org.eclipse.jdt.internal.compiler.ast.BinaryExpression) { return convert((org.eclipse.jdt.internal.compiler.ast.BinaryExpression) expression); - } + } if (expression instanceof org.eclipse.jdt.internal.compiler.ast.InstanceOfExpression) { return convert((org.eclipse.jdt.internal.compiler.ast.InstanceOfExpression) expression); - } + } if (expression instanceof org.eclipse.jdt.internal.compiler.ast.UnaryExpression) { return convert((org.eclipse.jdt.internal.compiler.ast.UnaryExpression) expression); - } + } if (expression instanceof org.eclipse.jdt.internal.compiler.ast.ConditionalExpression) { return convert((org.eclipse.jdt.internal.compiler.ast.ConditionalExpression) expression); - } + } if (expression instanceof org.eclipse.jdt.internal.compiler.ast.MessageSend) { return convert((org.eclipse.jdt.internal.compiler.ast.MessageSend) expression); - } + } if (expression instanceof org.eclipse.jdt.internal.compiler.ast.Reference) { return convert((org.eclipse.jdt.internal.compiler.ast.Reference) expression); } @@ -2220,11 +2220,11 @@ class ASTConverter { return convert(((org.eclipse.objectteams.otdt.internal.core.compiler.ast.PotentialTranslationExpression)expression).expression); } org.eclipse.jdt.internal.compiler.ast.Expression unwrapped = Lowering.unwrapExpression(expression); - if (unwrapped != null) + if (unwrapped != null) { return convert(unwrapped); - } -//gbr} + } +//gbr} return null; } @@ -2246,9 +2246,9 @@ class ASTConverter { this.recordNodes(literal, expression); } literal.setSourceRange(expression.sourceStart, expression.sourceEnd - expression.sourceStart + 1); - return literal; + return literal; } - + public Expression convert(org.eclipse.jdt.internal.compiler.ast.FieldReference reference) { if (reference.receiver.isSuper()) { final SuperFieldAccess superFieldAccess = new SuperFieldAccess(this.ast); @@ -2295,7 +2295,7 @@ class ASTConverter { } public NumberLiteral convert(org.eclipse.jdt.internal.compiler.ast.FloatLiteral expression) { - int length = expression.sourceEnd - expression.sourceStart + 1; + int length = expression.sourceEnd - expression.sourceStart + 1; int sourceStart = expression.sourceStart; NumberLiteral literal = new NumberLiteral(this.ast); literal.internalSetToken(new String(this.compilationUnitSource, sourceStart, length)); @@ -2306,7 +2306,7 @@ class ASTConverter { removeLeadingAndTrailingCommentsFromLiteral(literal); return literal; } - + public Statement convert(ForeachStatement statement) { switch(this.ast.apiLevel) { case AST.JLS2_INTERNAL : @@ -2328,7 +2328,7 @@ class ASTConverter { return createFakeEmptyStatement(statement); } } - + public ForStatement convert(org.eclipse.jdt.internal.compiler.ast.ForStatement statement) { ForStatement forStatement = new ForStatement(this.ast); forStatement.setSourceRange(statement.sourceStart, statement.sourceEnd - statement.sourceStart + 1); @@ -2368,7 +2368,7 @@ class ASTConverter { if (increments != null) { int incrementsLength = increments.length; for (int i = 0; i < incrementsLength; i++) { - forStatement.updaters().add(convertToExpression(increments[i])); + forStatement.updaters().add(convertToExpression(increments[i])); } } final Statement action = convert(statement.action); @@ -2376,7 +2376,7 @@ class ASTConverter { forStatement.setBody(action); return forStatement; } - + public IfStatement convert(org.eclipse.jdt.internal.compiler.ast.IfStatement statement) { IfStatement ifStatement = new IfStatement(this.ast); ifStatement.setSourceRange(statement.sourceStart, statement.sourceEnd - statement.sourceStart + 1); @@ -2393,7 +2393,7 @@ class ASTConverter { } return ifStatement; } - + public InstanceofExpression convert(org.eclipse.jdt.internal.compiler.ast.InstanceOfExpression expression) { InstanceofExpression instanceOfExpression = new InstanceofExpression(this.ast); if (this.resolveBindings) { @@ -2410,7 +2410,7 @@ class ASTConverter { } public NumberLiteral convert(org.eclipse.jdt.internal.compiler.ast.IntLiteral expression) { - int length = expression.sourceEnd - expression.sourceStart + 1; + int length = expression.sourceEnd - expression.sourceStart + 1; int sourceStart = expression.sourceStart; final NumberLiteral literal = new NumberLiteral(this.ast); literal.internalSetToken(new String(this.compilationUnitSource, sourceStart, length)); @@ -2423,7 +2423,7 @@ class ASTConverter { } public NumberLiteral convert(org.eclipse.jdt.internal.compiler.ast.IntLiteralMinValue expression) { - int length = expression.sourceEnd - expression.sourceStart + 1; + int length = expression.sourceEnd - expression.sourceStart + 1; int sourceStart = expression.sourceStart; NumberLiteral literal = new NumberLiteral(this.ast); literal.internalSetToken(new String(this.compilationUnitSource, sourceStart, length)); @@ -2480,7 +2480,7 @@ class ASTConverter { } } } - + public LabeledStatement convert(org.eclipse.jdt.internal.compiler.ast.LabeledStatement statement) { LabeledStatement labeledStatement = new LabeledStatement(this.ast); final int sourceStart = statement.sourceStart; @@ -2496,7 +2496,7 @@ class ASTConverter { } public NumberLiteral convert(org.eclipse.jdt.internal.compiler.ast.LongLiteral expression) { - int length = expression.sourceEnd - expression.sourceStart + 1; + int length = expression.sourceEnd - expression.sourceStart + 1; int sourceStart = expression.sourceStart; final NumberLiteral literal = new NumberLiteral(this.ast); literal.internalSetToken(new String(this.compilationUnitSource, sourceStart, length)); @@ -2509,7 +2509,7 @@ class ASTConverter { } public NumberLiteral convert(org.eclipse.jdt.internal.compiler.ast.LongLiteralMinValue expression) { - int length = expression.sourceEnd - expression.sourceStart + 1; + int length = expression.sourceEnd - expression.sourceStart + 1; int sourceStart = expression.sourceStart; final NumberLiteral literal = new NumberLiteral(this.ast); literal.internalSetToken(new String(this.compilationUnitSource, sourceStart, length)); @@ -2534,14 +2534,14 @@ class ASTConverter { { org.eclipse.jdt.core.dom.TSuperMessageSend result = this.ast.newTSuperMessageSend(); result.setSourceRange(expression.sourceStart, expression.sourceEnd - expression.sourceStart + 1); - - org.eclipse.objectteams.otdt.internal.core.compiler.ast.TSuperMessageSend send = + + org.eclipse.objectteams.otdt.internal.core.compiler.ast.TSuperMessageSend send = (org.eclipse.objectteams.otdt.internal.core.compiler.ast.TSuperMessageSend)expression; org.eclipse.objectteams.otdt.internal.core.compiler.ast.TsuperReference tsuperRef = send.tsuperReference; TypeReference typeReference = tsuperRef.qualification; if (typeReference != null) { Name qualification = null; - if (typeReference instanceof QualifiedTypeReference) + if (typeReference instanceof QualifiedTypeReference) { long[] poss = ((QualifiedTypeReference)typeReference).sourcePositions; qualification = setQualifiedNameNameAndSourceRanges(typeReference.getTypeName(), poss, tsuperRef); @@ -2549,10 +2549,10 @@ class ASTConverter { qualification = this.ast.newSimpleName(new String(((SingleTypeReference)typeReference).token)); qualification.setSourceRange(typeReference.sourceStart, typeReference.sourceEnd); } - result.setQualification(qualification); + result.setQualification(qualification); } - - + + SimpleName name = this.ast.newSimpleName(new String(expression.selector)); int start = (int)(expression.nameSourcePosition >>> 32); int end = (int)(expression.nameSourcePosition & 0xFFFFFFFF); @@ -2563,7 +2563,7 @@ class ASTConverter { recordNodes(result, expression); } result.setName(name); - + org.eclipse.jdt.internal.compiler.ast.Expression[] arguments = expression.arguments; if (arguments != null) { @@ -2579,9 +2579,9 @@ class ASTConverter { result.getArguments().add(argExpr); } } - return result; + return result; } -//mkr} +//mkr} if (expression.isSuperAccess()) { // returns a SuperMethodInvocation final SuperMethodInvocation superMethodInvocation = new SuperMethodInvocation(this.ast); @@ -2607,7 +2607,7 @@ class ASTConverter { } if (qualifier != null) { sourceStart = qualifier.getStartPosition(); - } + } } org.eclipse.jdt.internal.compiler.ast.Expression[] arguments = expression.arguments; if (arguments != null) { @@ -2693,7 +2693,7 @@ class ASTConverter { } expr = methodInvocation; } - expr.setSourceRange(sourceStart, expression.sourceEnd - sourceStart + 1); + expr.setSourceRange(sourceStart, expression.sourceEnd - sourceStart + 1); removeTrailingCommentFromExpressionEndingWithAParen(expr); return expr; } @@ -2724,12 +2724,12 @@ class ASTConverter { start = memberValuePair.sourceStart; end = value.getStartPosition() + value.getLength() - 1; pair.setSourceRange(start, end - start + 1); - + if (memberValuePair.value instanceof SingleNameReference && ((SingleNameReference)memberValuePair.value).token == RecoveryScanner.FAKE_IDENTIFIER) { pair.setFlags(pair.getFlags() | ASTNode.RECOVERED); } - + if (this.resolveBindings) { recordNodes(simpleName, memberValuePair); recordNodes(pair, memberValuePair); @@ -2761,14 +2761,14 @@ class ASTConverter { infixExpression.setSourceRange(expression.sourceStart, expression.sourceEnd - expression.sourceStart + 1); return infixExpression; } - + public NormalAnnotation convert(org.eclipse.jdt.internal.compiler.ast.NormalAnnotation annotation) { final NormalAnnotation normalAnnotation = new NormalAnnotation(this.ast); setTypeNameForAnnotation(annotation, normalAnnotation); - + int start = annotation.sourceStart; int end = annotation.declarationSourceEnd; - + org.eclipse.jdt.internal.compiler.ast.MemberValuePair[] memberValuePairs = annotation.memberValuePairs; if (memberValuePairs != null) { for (int i = 0, max = memberValuePairs.length; i < max; i++) { @@ -2780,7 +2780,7 @@ class ASTConverter { normalAnnotation.values().add(memberValuePair); } } - + normalAnnotation.setSourceRange(start, end - start + 1); if (this.resolveBindings) { recordNodes(normalAnnotation, annotation); @@ -2795,7 +2795,7 @@ class ASTConverter { this.recordNodes(literal, expression); } literal.setSourceRange(expression.sourceStart, expression.sourceEnd - expression.sourceStart + 1); - return literal; + return literal; } public Expression convert(org.eclipse.jdt.internal.compiler.ast.OR_OR_Expression expression) { @@ -2831,10 +2831,10 @@ class ASTConverter { for (int i = 0; i < size - 1; i++) { Expression expr = temp; temp = new InfixExpression(this.ast); - + if (this.resolveBindings) { this.recordNodes(temp, expression); - } + } temp.setLeftOperand(expr); temp.setOperator(getOperatorFor(expressionOperatorID)); temp.setSourceRange(expr.getStartPosition(), expr.getLength()); @@ -2943,7 +2943,7 @@ class ASTConverter { for (int i = 0, max = allocation.typeArguments.length; i < max; i++) { classInstanceCreation.typeArguments().add(convertType(allocation.typeArguments[i])); } - } + } } if (allocation.anonymousType != null) { int declarationSourceStart = allocation.sourceStart; @@ -2958,7 +2958,7 @@ class ASTConverter { recordNodes(anonymousClassDeclaration, allocation.anonymousType); anonymousClassDeclaration.resolveBinding(); } - return classInstanceCreation; + return classInstanceCreation; } else { final int start = allocation.sourceStart; classInstanceCreation.setSourceRange(start, allocation.sourceEnd - start + 1); @@ -3066,7 +3066,7 @@ public BaseConstructorInvocation convert( } return thisExpression; } - + public Expression convert(org.eclipse.jdt.internal.compiler.ast.Reference reference) { if (reference instanceof org.eclipse.jdt.internal.compiler.ast.NameReference) { return convert((org.eclipse.jdt.internal.compiler.ast.NameReference) reference); @@ -3093,16 +3093,16 @@ public BaseConstructorInvocation convert( } return null; // cannot be reached } - + public ReturnStatement convert(org.eclipse.jdt.internal.compiler.ast.ReturnStatement statement) { final ReturnStatement returnStatement = new ReturnStatement(this.ast); - returnStatement.setSourceRange(statement.sourceStart, statement.sourceEnd - statement.sourceStart + 1); + returnStatement.setSourceRange(statement.sourceStart, statement.sourceEnd - statement.sourceStart + 1); if (statement.expression != null) { returnStatement.setExpression(convert(statement.expression)); } return returnStatement; } - + public SingleMemberAnnotation convert(org.eclipse.jdt.internal.compiler.ast.SingleMemberAnnotation annotation) { final SingleMemberAnnotation singleMemberAnnotation = new SingleMemberAnnotation(this.ast); setTypeNameForAnnotation(annotation, singleMemberAnnotation); @@ -3152,7 +3152,7 @@ public BaseConstructorInvocation convert( if (statement instanceof org.eclipse.objectteams.otdt.internal.core.compiler.ast.BaseAllocationExpression) { return convert((org.eclipse.objectteams.otdt.internal.core.compiler.ast.BaseAllocationExpression) statement); } -//carp} +//carp} if (statement instanceof org.eclipse.jdt.internal.compiler.ast.Block) { return convert((org.eclipse.jdt.internal.compiler.ast.Block) statement); } @@ -3235,7 +3235,7 @@ public BaseConstructorInvocation convert( switch(this.ast.apiLevel) { case AST.JLS2_INTERNAL : TypeDeclaration typeDecl = typeDeclarationStatement.internalGetTypeDeclaration(); - typeDeclarationStatement.setSourceRange(typeDecl.getStartPosition(), typeDecl.getLength()); + typeDeclarationStatement.setSourceRange(typeDecl.getStartPosition(), typeDecl.getLength()); break; case AST.JLS3 : AbstractTypeDeclaration typeDeclAST3 = typeDeclarationStatement.getDeclaration(); @@ -3265,7 +3265,7 @@ public BaseConstructorInvocation convert( if (expression instanceof StringLiteralConcatenation) { return convert((StringLiteralConcatenation) expression); } - int length = expression.sourceEnd - expression.sourceStart + 1; + int length = expression.sourceEnd - expression.sourceStart + 1; int sourceStart = expression.sourceStart; StringLiteral literal = new StringLiteral(this.ast); if (this.resolveBindings) { @@ -3275,10 +3275,10 @@ public BaseConstructorInvocation convert( literal.setSourceRange(expression.sourceStart, expression.sourceEnd - expression.sourceStart + 1); return literal; } - + public SwitchStatement convert(org.eclipse.jdt.internal.compiler.ast.SwitchStatement statement) { SwitchStatement switchStatement = new SwitchStatement(this.ast); - switchStatement.setSourceRange(statement.sourceStart, statement.sourceEnd - statement.sourceStart + 1); + switchStatement.setSourceRange(statement.sourceStart, statement.sourceEnd - statement.sourceStart + 1); switchStatement.setExpression(convert(statement.expression)); org.eclipse.jdt.internal.compiler.ast.Statement[] statements = statement.statements; if (statements != null) { @@ -3296,15 +3296,15 @@ public BaseConstructorInvocation convert( } return switchStatement; } - + public SynchronizedStatement convert(org.eclipse.jdt.internal.compiler.ast.SynchronizedStatement statement) { SynchronizedStatement synchronizedStatement = new SynchronizedStatement(this.ast); - synchronizedStatement.setSourceRange(statement.sourceStart, statement.sourceEnd - statement.sourceStart + 1); + synchronizedStatement.setSourceRange(statement.sourceStart, statement.sourceEnd - statement.sourceStart + 1); synchronizedStatement.setBody(convert(statement.block)); synchronizedStatement.setExpression(convert(statement.expression)); return synchronizedStatement; } - + public Expression convert(org.eclipse.jdt.internal.compiler.ast.ThisReference reference) { if (reference.isImplicitThis()) { // There is no source associated with an implicit this @@ -3323,14 +3323,14 @@ public BaseConstructorInvocation convert( return thisExpression; } } - + public ThrowStatement convert(org.eclipse.jdt.internal.compiler.ast.ThrowStatement statement) { final ThrowStatement throwStatement = new ThrowStatement(this.ast); - throwStatement.setSourceRange(statement.sourceStart, statement.sourceEnd - statement.sourceStart + 1); + throwStatement.setSourceRange(statement.sourceStart, statement.sourceEnd - statement.sourceStart + 1); throwStatement.setExpression(convert(statement.exception)); return throwStatement; } - + public BooleanLiteral convert(org.eclipse.jdt.internal.compiler.ast.TrueLiteral expression) { final BooleanLiteral literal = new BooleanLiteral(this.ast); literal.setBooleanValue(true); @@ -3338,12 +3338,12 @@ public BaseConstructorInvocation convert( this.recordNodes(literal, expression); } literal.setSourceRange(expression.sourceStart, expression.sourceEnd - expression.sourceStart + 1); - return literal; + return literal; } - + public TryStatement convert(org.eclipse.jdt.internal.compiler.ast.TryStatement statement) { final TryStatement tryStatement = new TryStatement(this.ast); - tryStatement.setSourceRange(statement.sourceStart, statement.sourceEnd - statement.sourceStart + 1); + tryStatement.setSourceRange(statement.sourceStart, statement.sourceEnd - statement.sourceStart + 1); tryStatement.setBody(convert(statement.tryBlock)); org.eclipse.jdt.internal.compiler.ast.Argument[] catchArguments = statement.catchArguments; @@ -3354,7 +3354,7 @@ public BaseConstructorInvocation convert( for (int i = 0; i < catchArgumentsLength; i++) { CatchClause catchClause = new CatchClause(this.ast); int catchClauseSourceStart = retrieveStartingCatchPosition(start, catchArguments[i].sourceStart); - catchClause.setSourceRange(catchClauseSourceStart, catchBlocks[i].sourceEnd - catchClauseSourceStart + 1); + catchClause.setSourceRange(catchClauseSourceStart, catchBlocks[i].sourceEnd - catchClauseSourceStart + 1); catchClause.setBody(convert(catchBlocks[i])); catchClause.setException(convert(catchArguments[i])); tryStatement.catchClauses().add(catchClause); @@ -3390,7 +3390,7 @@ public BaseConstructorInvocation convert( TypeDeclaration typeDecl; if (!typeDeclaration.isRole()) { -//ike} +//ike} typeDecl = new TypeDeclaration(this.ast); if (typeDeclaration.modifiersSourceStart != -1) { setModifiers(typeDecl, typeDeclaration); @@ -3399,13 +3399,13 @@ public BaseConstructorInvocation convert( //{ObjectTeams: type declaration can be a team class or a role class, too typeDecl.setTeam(typeDeclaration.isTeam()); typeDecl.setRole(typeDeclaration.isSourceRole()); -//gbr} +//gbr} final SimpleName typeName = new SimpleName(this.ast); typeName.internalSetIdentifier(new String(typeDeclaration.name)); typeName.setSourceRange(typeDeclaration.sourceStart, typeDeclaration.sourceEnd - typeDeclaration.sourceStart + 1); typeDecl.setName(typeName); typeDecl.setSourceRange(typeDeclaration.declarationSourceStart, typeDeclaration.bodyEnd - typeDeclaration.declarationSourceStart + 1); - + // need to set the superclass and super interfaces here since we cannot distinguish them at // the type references level. if (typeDeclaration.superclass != null) { @@ -3418,7 +3418,7 @@ public BaseConstructorInvocation convert( break; } } - + org.eclipse.jdt.internal.compiler.ast.TypeReference[] superInterfaces = typeDeclaration.superInterfaces; if (superInterfaces != null) { switch(this.ast.apiLevel) { @@ -3431,7 +3431,7 @@ public BaseConstructorInvocation convert( for (int index = 0, length = superInterfaces.length; index < length; index++) { typeDecl.superInterfaceTypes().add(convertType(superInterfaces[index])); } - } + } } org.eclipse.jdt.internal.compiler.ast.TypeParameter[] typeParameters = typeDeclaration.typeParameters; if (typeParameters != null) { @@ -3451,7 +3451,7 @@ public BaseConstructorInvocation convert( recordNodes(typeName, typeDeclaration); typeDecl.resolveBinding(); } -//{ObjectTeams: do OT-specific stuff +//{ObjectTeams: do OT-specific stuff } else { @@ -3463,7 +3463,7 @@ public BaseConstructorInvocation convert( if (typeDeclaration.precedences != null) for (org.eclipse.objectteams.otdt.internal.core.compiler.ast.PrecedenceDeclaration aPrecedence : typeDeclaration.precedences) typeDecl.precedences().add(convertPrecedence(aPrecedence)); -//ike} +//ike} return typeDecl; } @@ -3485,54 +3485,54 @@ public BaseConstructorInvocation convert( } roleTypeDecl.setRoleFile(true); } - + //km: modifers are handled differently in JLS3 - switch(this.ast.apiLevel) { + switch(this.ast.apiLevel) { case AST.JLS2_INTERNAL: { int modifiers = typeDeclaration.modifiers; modifiers &= ~ClassFileConstants.AccInterface; // remove AccInterface flags // also allow additional flag to be passed: (how about deprecated?) - modifiers &= ExtraCompilerModifiers.AccOTTypeJustFlag; + modifiers &= ExtraCompilerModifiers.AccOTTypeJustFlag; roleTypeDecl.setModifiers(modifiers); - + if (typeDeclaration.baseclass != null) roleTypeDecl.setBaseClass(convert(typeDeclaration.baseclass)); - + // need to set the superclass and super interfaces here since we cannot distinguish them at // the type references level. if (typeDeclaration.superclass != null) roleTypeDecl.setSuperclass(convert(typeDeclaration.superclass)); - + } break; case AST.JLS3: this.setModifiers(roleTypeDecl, typeDeclaration); - + if ( typeDeclaration.baseclass != null && !typeDeclaration.baseclass.isGenerated()) roleTypeDecl.setBaseClassType(convertType(typeDeclaration.baseclass)); - + // need to set the superclass and super interfaces here since we cannot distinguish them at // the type references level. if ( typeDeclaration.superclass != null && !typeDeclaration.superclass.isGenerated()) roleTypeDecl.setSuperclassType(convertType(typeDeclaration.superclass)); - + break; } - + roleTypeDecl.setInterface(typeDeclaration.isInterface()); roleTypeDecl.setTeam(typeDeclaration.isTeam()); roleTypeDecl.setRole(typeDeclaration.isSourceRole()); - + SimpleName typeName = this.ast.newSimpleName( getRealName(typeDeclaration.name) ); - + typeName.setSourceRange(typeDeclaration.sourceStart, typeDeclaration.sourceEnd - typeDeclaration.sourceStart + 1); roleTypeDecl.setName(typeName); roleTypeDecl.setSourceRange(typeDeclaration.declarationSourceStart, typeDeclaration.bodyEnd - typeDeclaration.declarationSourceStart + 1); - + // fetch superInterfaces from the interface part of the role: org.eclipse.jdt.internal.compiler.ast.TypeReference[] superInterfaces = null; RoleModel roleModel = typeDeclaration.getRoleModel(); @@ -3549,17 +3549,17 @@ public BaseConstructorInvocation convert( for (int index = 0, length = superInterfaces.length; index < length; index++) if (!superInterfaces[index].isGenerated()) roleTypeDecl.superInterfaceTypes().add(convertType(superInterfaces[index])); - + org.eclipse.objectteams.otdt.internal.core.compiler.ast.GuardPredicateDeclaration guard = typeDeclaration.predicate; if (guard != null) roleTypeDecl.setGuardPredicate(convertGuardPredicate(guard)); - + buildBodyDeclarations(typeDeclaration, roleTypeDecl); - + SimpleName teamClassName = null; if (typeDeclaration.enclosingType!=null) { - org.eclipse.jdt.internal.compiler.ast.TypeDeclaration teamDecl + org.eclipse.jdt.internal.compiler.ast.TypeDeclaration teamDecl = typeDeclaration.enclosingType; teamClassName = this.ast.newSimpleName(new String(teamDecl.name)); teamClassName.setSourceRange(teamDecl.sourceStart, teamDecl.sourceEnd - teamDecl.sourceStart + 1); @@ -3571,7 +3571,7 @@ public BaseConstructorInvocation convert( else roleTypeDecl.setTeamClass(teamClassName); } - + if (this.resolveBindings) { recordNodes(roleTypeDecl, typeDeclaration); @@ -3588,25 +3588,25 @@ public BaseConstructorInvocation convert( } } } - + /** Retrieve the sibling type declaration corresponding to superIfcBinding. */ private TypeReference[] getInterfacePartInterfaces( - org.eclipse.jdt.internal.compiler.ast.TypeDeclaration typeDeclaration, + org.eclipse.jdt.internal.compiler.ast.TypeDeclaration typeDeclaration, TypeBinding superIfcBinding) { org.eclipse.jdt.internal.compiler.ast.TypeDeclaration enclosing = typeDeclaration.enclosingType; - if (enclosing == null) + if (enclosing == null) return null; if (enclosing.memberTypes == null) return null; - for (org.eclipse.jdt.internal.compiler.ast.TypeDeclaration memberType : enclosing.memberTypes) + for (org.eclipse.jdt.internal.compiler.ast.TypeDeclaration memberType : enclosing.memberTypes) if (memberType.binding == superIfcBinding) return memberType.superInterfaces; - + return null; } - private String getRealName(char[] name) + private String getRealName(char[] name) { if (name == null || name.length == 0) { @@ -3616,20 +3616,20 @@ public BaseConstructorInvocation convert( String[] nameTokens = new String (name).split(IOTConstants.OT_DELIM); realName = nameTokens[nameTokens.length-1]; return realName; - } - + } + private PrecedenceDeclaration convertPrecedence(org.eclipse.objectteams.otdt.internal.core.compiler.ast.PrecedenceDeclaration aPrecedence) { PrecedenceDeclaration newPrecedence = this.ast.newPrecedenceDeclaration(); newPrecedence.setSourceRange(aPrecedence.declarationSourceStart, aPrecedence.sourceEnd - aPrecedence.declarationSourceStart + 1); for (org.eclipse.jdt.internal.compiler.ast.NameReference nameRef: aPrecedence.bindingNames) { - newPrecedence.elements().add(convert(nameRef)); + newPrecedence.elements().add(convert(nameRef)); } if (aPrecedence.isAfter) newPrecedence.setAfter(true); return newPrecedence; } - + private GuardPredicateDeclaration convertGuardPredicate(org.eclipse.objectteams.otdt.internal.core.compiler.ast.GuardPredicateDeclaration guard) { GuardPredicateDeclaration newGuard = this.ast.newGuardPredicateDeclaration(); newGuard.setSourceRange(guard.declarationSourceStart, guard.declarationSourceEnd - guard.declarationSourceStart + 1); @@ -3642,7 +3642,7 @@ public BaseConstructorInvocation convert( } //ike+SH} - + public TypeParameter convert(org.eclipse.jdt.internal.compiler.ast.TypeParameter typeParameter) { final TypeParameter typeParameter2 = new TypeParameter(this.ast); @@ -3686,7 +3686,7 @@ public BaseConstructorInvocation convert( } return typeParameter2; } - + public Name convert(org.eclipse.jdt.internal.compiler.ast.TypeReference typeReference) { char[][] typeName = typeReference.getTypeName(); int length = typeName.length; @@ -3695,7 +3695,7 @@ public BaseConstructorInvocation convert( // TODO (SH): we probably need information about both names in a lifting type?? if (typeReference instanceof LiftingTypeReference) typeReference = ((LiftingTypeReference)typeReference).baseReference; -// SH} +// SH} // QualifiedName org.eclipse.jdt.internal.compiler.ast.QualifiedTypeReference qualifiedTypeReference = (org.eclipse.jdt.internal.compiler.ast.QualifiedTypeReference) typeReference; final long[] positions = qualifiedTypeReference.sourcePositions; @@ -3711,7 +3711,7 @@ public BaseConstructorInvocation convert( return name; } } - + public PrefixExpression convert(org.eclipse.jdt.internal.compiler.ast.UnaryExpression expression) { final PrefixExpression prefixExpression = new PrefixExpression(this.ast); if (this.resolveBindings) { @@ -3734,7 +3734,7 @@ public BaseConstructorInvocation convert( } return prefixExpression; } - + public WhileStatement convert(org.eclipse.jdt.internal.compiler.ast.WhileStatement statement) { final WhileStatement whileStatement = new WhileStatement(this.ast); whileStatement.setSourceRange(statement.sourceStart, statement.sourceEnd - statement.sourceStart + 1); @@ -3744,7 +3744,7 @@ public BaseConstructorInvocation convert( whileStatement.setBody(action); return whileStatement; } - + public ImportDeclaration convertImport(org.eclipse.jdt.internal.compiler.ast.ImportReference importReference) { final ImportDeclaration importDeclaration = new ImportDeclaration(this.ast); final boolean onDemand = (importReference.bits & org.eclipse.jdt.internal.compiler.ast.ASTNode.OnDemand) != 0; @@ -3834,7 +3834,7 @@ public BaseConstructorInvocation convert( convert(compilationUnitDeclaration.javadoc, packageDeclaration); return packageDeclaration; } - + private EnumDeclaration convertToEnumDeclaration(org.eclipse.jdt.internal.compiler.ast.TypeDeclaration typeDeclaration) { checkCanceled(); // enum declaration cannot be built if the source is not >= 1.5, since enum is then seen as an identifier @@ -3845,12 +3845,12 @@ public BaseConstructorInvocation convert( typeName.setSourceRange(typeDeclaration.sourceStart, typeDeclaration.sourceEnd - typeDeclaration.sourceStart + 1); enumDeclaration2.setName(typeName); enumDeclaration2.setSourceRange(typeDeclaration.declarationSourceStart, typeDeclaration.bodyEnd - typeDeclaration.declarationSourceStart + 1); - + org.eclipse.jdt.internal.compiler.ast.TypeReference[] superInterfaces = typeDeclaration.superInterfaces; if (superInterfaces != null) { for (int index = 0, length = superInterfaces.length; index < length; index++) { enumDeclaration2.superInterfaceTypes().add(convertType(superInterfaces[index])); - } + } } buildBodyDeclarations(typeDeclaration, enumDeclaration2); if (this.resolveBindings) { @@ -3899,7 +3899,7 @@ public BaseConstructorInvocation convert( parenthesizedExpression.setExpression(convert(expression)); return parenthesizedExpression; } - + public Type convertToType(org.eclipse.jdt.internal.compiler.ast.NameReference reference) { Name name = convert(reference); final SimpleType type = new SimpleType(this.ast); @@ -3910,7 +3910,7 @@ public BaseConstructorInvocation convert( } return type; } - + protected VariableDeclarationExpression convertToVariableDeclarationExpression(org.eclipse.jdt.internal.compiler.ast.LocalDeclaration localDeclaration) { final VariableDeclarationFragment variableDeclarationFragment = convertToVariableDeclarationFragment(localDeclaration); final VariableDeclarationExpression variableDeclarationExpression = new VariableDeclarationExpression(this.ast); @@ -3954,7 +3954,7 @@ public BaseConstructorInvocation convert( } return variableDecl; } - + protected VariableDeclarationFragment convertToVariableDeclarationFragment(org.eclipse.jdt.internal.compiler.ast.FieldDeclaration fieldDeclaration) { final VariableDeclarationFragment variableDeclarationFragment = new VariableDeclarationFragment(this.ast); final SimpleName name = new SimpleName(this.ast); @@ -3999,7 +3999,7 @@ public BaseConstructorInvocation convert( name.internalSetIdentifier(new String(localDeclaration.name)); name.setSourceRange(localDeclaration.sourceStart, localDeclaration.sourceEnd - localDeclaration.sourceStart + 1); variableDeclarationFragment.setName(name); - int start = localDeclaration.sourceEnd; + int start = localDeclaration.sourceEnd; org.eclipse.jdt.internal.compiler.ast.Expression initialization = localDeclaration.initialization; int extraDimension = retrieveExtraDimension(localDeclaration.sourceEnd + 1, this.compilationUnitSourceLength); variableDeclarationFragment.setExtraDimensions(extraDimension); @@ -4081,7 +4081,7 @@ public BaseConstructorInvocation convert( { return convertType((TypeAnchorReference)typeReference); } -//gbr+SH} +//gbr+SH} if (typeReference instanceof org.eclipse.jdt.internal.compiler.ast.SingleTypeReference) { // this is either an ArrayTypeReference or a SingleTypeReference char[] name = ((org.eclipse.jdt.internal.compiler.ast.SingleTypeReference) typeReference).getTypeName()[0]; @@ -4092,7 +4092,7 @@ public BaseConstructorInvocation convert( int end = retrieveEndOfElementTypeNamePosition(sourceStart, sourceStart + length); if (end == -1) { end = sourceStart + length - 1; - } + } final PrimitiveType primitiveType = new PrimitiveType(this.ast); primitiveType.setPrimitiveTypeCode(getPrimitiveTypeCode(name)); primitiveType.setSourceRange(sourceStart, end - sourceStart + 1); @@ -4270,7 +4270,7 @@ public BaseConstructorInvocation convert( recordPendingNameScopeResolution(simpleName); QualifiedType qualifiedType = new QualifiedType(this.ast); qualifiedType.setQualifier(currentType); - qualifiedType.setName(simpleName); + qualifiedType.setName(simpleName); if (this.resolveBindings) { recordNodes(simpleName, typeReference); recordNodes(qualifiedType, typeReference); @@ -4294,7 +4294,7 @@ public BaseConstructorInvocation convert( } end = retrieveClosingAngleBracketPosition(end + 1); length = end + 1; - parameterizedType2.setSourceRange(start, end - start + 1); + parameterizedType2.setSourceRange(start, end - start + 1); currentType = parameterizedType2; } else { currentType = qualifiedType; @@ -4312,7 +4312,7 @@ public BaseConstructorInvocation convert( } else { char[][] name = ((org.eclipse.jdt.internal.compiler.ast.QualifiedTypeReference) typeReference).getTypeName(); //{ObjectTeams: revert anchored types like in MyTeam.this._OT$base.R => base.R - org.eclipse.jdt.internal.compiler.lookup.TypeBinding typeBinding = + org.eclipse.jdt.internal.compiler.lookup.TypeBinding typeBinding = ((org.eclipse.jdt.internal.compiler.ast.QualifiedTypeReference) typeReference).resolvedType; if (typeBinding != null) { typeBinding = typeBinding.leafComponentType(); @@ -4321,12 +4321,12 @@ public BaseConstructorInvocation convert( if (rtb.hasExplicitAnchor()) { char[][] newName = CharOperation.splitOn('.', rtb.optimalName()); // refuse to use best name which is longer than source name. - if (name.length >= newName.length) + if (name.length >= newName.length) name = newName; } - } - } -// SH} + } + } +// SH} int nameLength = name.length; long[] positions = ((org.eclipse.jdt.internal.compiler.ast.QualifiedTypeReference) typeReference).sourcePositions; sourceStart = (int)(positions[0]>>>32); @@ -4373,7 +4373,7 @@ public BaseConstructorInvocation convert( Name name = convert(typeReference); LiftingType result = this.ast.newLiftingType(name); result.setSourceRange(typeReference.sourceStart, typeReference.sourceEnd - typeReference.sourceStart + 1); - + // convert base type org.eclipse.jdt.internal.compiler.ast.TypeReference baseTypeReference = typeReference.baseReference; if (baseTypeReference != null) @@ -4381,7 +4381,7 @@ public BaseConstructorInvocation convert( Type baseType = convertType(baseTypeReference); result.setBaseType(baseType); } - + // convert role type org.eclipse.jdt.internal.compiler.ast.TypeReference roleTypeReference = typeReference.roleReference; if (roleTypeReference != null) @@ -4389,11 +4389,11 @@ public BaseConstructorInvocation convert( Type roleType = convertType(roleTypeReference); result.setRoleType(roleType); } - + if (this.resolveBindings) { this.recordNodes(result, typeReference); - } + } return result; } // Type Anchor @@ -4409,7 +4409,7 @@ public BaseConstructorInvocation convert( result.setSourceRange(start, end-start+1); return result; } -//gbr+SH} +//gbr+SH} protected Comment createComment(int[] positions) { // Create comment node @@ -4439,7 +4439,7 @@ public BaseConstructorInvocation convert( } return comment; } - + protected Statement createFakeEmptyStatement(org.eclipse.jdt.internal.compiler.ast.Statement statement) { if (statement == null) return null; EmptyStatement emptyStatement = new EmptyStatement(this.ast); @@ -4460,7 +4460,7 @@ public BaseConstructorInvocation convert( modifier.setSourceRange(start, end - start + 1); return modifier; } - + protected InfixExpression.Operator getOperatorFor(int operatorID) { switch (operatorID) { case org.eclipse.jdt.internal.compiler.ast.OperatorIds.EQUAL_EQUAL : @@ -4504,7 +4504,7 @@ public BaseConstructorInvocation convert( } return null; } - + protected PrimitiveType.Code getPrimitiveTypeCode(char[] name) { switch(name[0]) { case 'i' : @@ -4580,7 +4580,7 @@ public BaseConstructorInvocation convert( } return null; // cannot be reached } - + protected boolean isPrimitiveType(char[] name) { switch(name[0]) { case 'i' : @@ -4657,7 +4657,7 @@ public BaseConstructorInvocation convert( } return false; } - + private void lookupForScopes() { if (this.pendingNameScopeResolution != null) { for (Iterator iterator = this.pendingNameScopeResolution.iterator(); iterator.hasNext(); ) { @@ -4671,9 +4671,9 @@ public BaseConstructorInvocation convert( this.ast.getBindingResolver().recordScope(thisExpression, lookupScope(thisExpression)); } } - + } - + private BlockScope lookupScope(ASTNode node) { ASTNode currentNode = node; while(currentNode != null @@ -4737,11 +4737,11 @@ public BaseConstructorInvocation convert( } } } - + protected void recordNodes(ASTNode node, org.eclipse.jdt.internal.compiler.ast.ASTNode oldASTNode) { this.ast.getBindingResolver().store(node, oldASTNode); } - + protected void recordNodes(org.eclipse.jdt.internal.compiler.ast.Javadoc javadoc, TagElement tagElement) { Iterator fragments = tagElement.fragments().listIterator(); while (fragments.hasNext()) { @@ -4764,7 +4764,7 @@ public BaseConstructorInvocation convert( if (expression instanceof org.eclipse.jdt.internal.compiler.ast.TypeReference) { typeRef = (org.eclipse.jdt.internal.compiler.ast.TypeReference) expression; } - } + } else if (compilerNode instanceof JavadocMessageSend) { org.eclipse.jdt.internal.compiler.ast.Expression expression = ((JavadocMessageSend)compilerNode).receiver; if (expression instanceof org.eclipse.jdt.internal.compiler.ast.TypeReference) { @@ -4803,7 +4803,7 @@ public BaseConstructorInvocation convert( if (compilerNode instanceof org.eclipse.jdt.internal.compiler.ast.JavadocAllocationExpression) { typeRef = ((org.eclipse.jdt.internal.compiler.ast.JavadocAllocationExpression)compilerNode).type; if (typeRef != null) recordNodes(name, compilerNode); - } + } else if (compilerNode instanceof org.eclipse.jdt.internal.compiler.ast.JavadocMessageSend) { org.eclipse.jdt.internal.compiler.ast.Expression expression = ((org.eclipse.jdt.internal.compiler.ast.JavadocMessageSend)compilerNode).receiver; if (expression instanceof org.eclipse.jdt.internal.compiler.ast.TypeReference) { @@ -4851,24 +4851,24 @@ public BaseConstructorInvocation convert( } } } - + protected void recordPendingNameScopeResolution(Name name) { if (this.pendingNameScopeResolution == null) { this.pendingNameScopeResolution = new HashSet(); } this.pendingNameScopeResolution.add(name); } - + protected void recordPendingThisExpressionScopeResolution(ThisExpression thisExpression) { if (this.pendingThisExpressionScopeResolution == null) { this.pendingThisExpressionScopeResolution = new HashSet(); } this.pendingThisExpressionScopeResolution.add(thisExpression); } - + /** * Remove whitespaces and comments before and after the expression. - */ + */ private void trimWhiteSpacesAndComments(org.eclipse.jdt.internal.compiler.ast.Expression expression) { int start = expression.sourceStart; int end = expression.sourceEnd; @@ -4906,7 +4906,7 @@ public BaseConstructorInvocation convert( * source end. */ trimRightPosition = removeBlankScanner.currentPosition - 1; - first = false; + first = false; } } } catch (InvalidInputException e){ @@ -4945,7 +4945,7 @@ public BaseConstructorInvocation convert( // ignore } } - + /** * Remove potential trailing comment by settings the source end on the closing parenthesis */ @@ -5037,7 +5037,7 @@ public BaseConstructorInvocation convert( // ignore } return -1; - + } /** * This method is used to retrieve the end position of the block. @@ -5214,7 +5214,7 @@ public BaseConstructorInvocation convert( // ignore } } - + /** * This method is used to retrieve the start position of the block. * @return int the dimension found, -1 if none @@ -5227,7 +5227,7 @@ public BaseConstructorInvocation convert( switch(token) { //{ObjectTeams: treat like an Identifier: case TerminalTokens.TokenNamewhen: -//SH} +//SH} case TerminalTokens.TokenNameIdentifier://110 return this.scanner.getCurrentTokenEndPosition(); } @@ -5236,7 +5236,7 @@ public BaseConstructorInvocation convert( // ignore } return -1; - } + } /** * This method is used to retrieve position before the next comma or semi-colon. @@ -5339,7 +5339,7 @@ public BaseConstructorInvocation convert( } return -1; } - + /** * This method is used to retrieve the position of the right bracket. * @return int the dimension found, -1 if none @@ -5405,7 +5405,7 @@ public BaseConstructorInvocation convert( } return -1; } - + //{ObjectTeams: /** * This method is used to retrieve the starting position of a '<-' token @@ -5427,12 +5427,12 @@ public BaseConstructorInvocation convert( return -1; } // SH} - + public void setAST(AST ast) { //{ObjectTeams: transfer scanner mode if (ast.scanner != null && this.scanner != null) ast.scanner.copyOTFlags(this.scanner); -// SH} +// SH} this.ast = ast; this.docParser = new DocCommentParser(this.ast, this.scanner, this.insideComments); } @@ -5441,7 +5441,7 @@ public BaseConstructorInvocation convert( this.scanner.resetTo(typeDeclaration.declarationSourceStart, typeDeclaration.sourceStart); this.setModifiers(typeDecl, typeDeclaration.annotations, typeDeclaration.sourceStart); } - + protected void setModifiers(AnnotationTypeMemberDeclaration annotationTypeMemberDecl, org.eclipse.jdt.internal.compiler.ast.AnnotationMethodDeclaration annotationTypeMemberDeclaration) { this.scanner.resetTo(annotationTypeMemberDeclaration.declarationSourceStart, annotationTypeMemberDeclaration.sourceStart); this.setModifiers(annotationTypeMemberDecl, annotationTypeMemberDeclaration.annotations, annotationTypeMemberDeclaration.sourceStart); @@ -5476,14 +5476,14 @@ public BaseConstructorInvocation convert( case TerminalTokens.TokenNamefinal: modifier = createModifier(Modifier.ModifierKeyword.FINAL_KEYWORD); break; -//{ObjectTeams: callin team +//{ObjectTeams: callin team case TerminalTokens.TokenNamecallin: modifier = createModifier(Modifier.ModifierKeyword.CALLIN_KEYWORD); break; case TerminalTokens.TokenNameteam: modifier = createModifier(Modifier.ModifierKeyword.TEAM_KEYWORD); break; -// SH} +// SH} case TerminalTokens.TokenNamenative: modifier = createModifier(Modifier.ModifierKeyword.NATIVE_KEYWORD); break; @@ -5528,7 +5528,7 @@ public BaseConstructorInvocation convert( this.scanner.resetTo(enumDeclaration2.declarationSourceStart, enumDeclaration2.sourceStart); this.setModifiers(enumDeclaration, enumDeclaration2.annotations, enumDeclaration2.sourceStart); } - + protected void setModifiers(EnumConstantDeclaration enumConstantDeclaration, org.eclipse.jdt.internal.compiler.ast.FieldDeclaration fieldDeclaration) { switch(this.ast.apiLevel) { case AST.JLS2_INTERNAL : @@ -5542,7 +5542,7 @@ public BaseConstructorInvocation convert( this.setModifiers(enumConstantDeclaration, fieldDeclaration.annotations, fieldDeclaration.sourceStart); } } - + /** * @param fieldDeclaration * @param fieldDecl @@ -5560,14 +5560,14 @@ public BaseConstructorInvocation convert( this.setModifiers(fieldDeclaration, fieldDecl.annotations, fieldDecl.sourceStart); } } - + /** * @param initializer * @param oldInitializer */ protected void setModifiers(Initializer initializer, org.eclipse.jdt.internal.compiler.ast.Initializer oldInitializer) { switch(this.ast.apiLevel) { - case AST.JLS2_INTERNAL: + case AST.JLS2_INTERNAL: initializer.internalSetModifiers(oldInitializer.modifiers & ExtraCompilerModifiers.AccJustFlag); if (oldInitializer.annotations != null) { initializer.setFlags(initializer.getFlags() | ASTNode.MALFORMED); @@ -5600,7 +5600,7 @@ public BaseConstructorInvocation convert( * @param methodDecl * @param methodDeclaration */ - protected void setModifiers(org.eclipse.jdt.core.dom.AbstractMethodMappingDeclaration mappingDecl, + protected void setModifiers(org.eclipse.jdt.core.dom.AbstractMethodMappingDeclaration mappingDecl, AbstractMethodMappingDeclaration mappingDeclaration) { switch(this.ast.apiLevel) { case AST.JLS2_INTERNAL : @@ -5612,8 +5612,8 @@ public BaseConstructorInvocation convert( this.scanner.resetTo(mappingDeclaration.declarationSourceStart, mappingDeclaration.sourceStart); this.setModifiers(mappingDecl, mappingDeclaration.annotations, mappingDeclaration.sourceStart); } - } -// SH} + } +// SH} /** * @param variableDecl * @param argument @@ -5692,7 +5692,7 @@ public BaseConstructorInvocation convert( } } } - + protected void setModifiers(SingleVariableDeclaration variableDecl, LocalDeclaration localDeclaration) { switch(this.ast.apiLevel) { case AST.JLS2_INTERNAL : @@ -5773,7 +5773,7 @@ public BaseConstructorInvocation convert( * @param typeDeclaration */ protected void setModifiers(TypeDeclaration typeDecl, org.eclipse.jdt.internal.compiler.ast.TypeDeclaration typeDeclaration) { - switch(this.ast.apiLevel) { + switch(this.ast.apiLevel) { case AST.JLS2_INTERNAL : int modifiers = typeDeclaration.modifiers; modifiers &= ~ClassFileConstants.AccInterface; // remove AccInterface flags @@ -5788,7 +5788,7 @@ public BaseConstructorInvocation convert( this.setModifiers(typeDecl, typeDeclaration.annotations, typeDeclaration.sourceStart); } } - + /** * @param variableDeclarationExpression * @param localDeclaration @@ -5867,7 +5867,7 @@ public BaseConstructorInvocation convert( } catch(InvalidInputException e) { // ignore } - } + } } /** @@ -5948,7 +5948,7 @@ public BaseConstructorInvocation convert( } catch(InvalidInputException e) { // ignore } - } + } } protected QualifiedName setQualifiedNameNameAndSourceRanges(char[][] typeName, long[] positions, org.eclipse.jdt.internal.compiler.ast.ASTNode node) { @@ -5995,7 +5995,7 @@ public BaseConstructorInvocation convert( qualifiedName.setSourceRange(start0, end - start0 + 1); if (this.resolveBindings) { recordNodes(qualifiedName, node); - recordNodes(newPart, node); + recordNodes(newPart, node); recordPendingNameScopeResolution(qualifiedName); recordPendingNameScopeResolution(newPart); } @@ -6007,7 +6007,7 @@ public BaseConstructorInvocation convert( } return name; } - + protected QualifiedName setQualifiedNameNameAndSourceRanges(char[][] typeName, long[] positions, int endingIndex, org.eclipse.jdt.internal.compiler.ast.ASTNode node) { int length = endingIndex + 1; final SimpleName firstToken = new SimpleName(this.ast); @@ -6052,7 +6052,7 @@ public BaseConstructorInvocation convert( qualifiedName.setSourceRange(start0, end - start0 + 1); if (this.resolveBindings) { recordNodes(qualifiedName, node); - recordNodes(newPart, node); + recordNodes(newPart, node); recordPendingNameScopeResolution(qualifiedName); recordPendingNameScopeResolution(newPart); } @@ -6063,7 +6063,7 @@ public BaseConstructorInvocation convert( } return qualifiedName; } - + protected void setTypeNameForAnnotation(org.eclipse.jdt.internal.compiler.ast.Annotation compilerAnnotation, Annotation annotation) { TypeReference typeReference = compilerAnnotation.type; if (typeReference instanceof QualifiedTypeReference) { @@ -6086,7 +6086,7 @@ public BaseConstructorInvocation convert( } } } - + protected void setTypeForField(FieldDeclaration fieldDeclaration, Type type, int extraDimension) { if (extraDimension != 0) { if (type.isArrayType()) { @@ -6127,7 +6127,7 @@ public BaseConstructorInvocation convert( fieldDeclaration.setType(type); } } - + protected void setTypeForMethodDeclaration(MethodDeclaration methodDeclaration, Type type, int extraDimension) { if (extraDimension != 0) { if (type.isArrayType()) { @@ -6191,7 +6191,7 @@ public BaseConstructorInvocation convert( } } } - + protected void setTypeForMethodDeclaration(AnnotationTypeMemberDeclaration annotationTypeMemberDeclaration, Type type, int extraDimension) { annotationTypeMemberDeclaration.setType(type); } @@ -6316,18 +6316,18 @@ public BaseConstructorInvocation convert( currentComponentType.setSourceRange(start, rightBracketEndPosition - start + 1); currentComponentType = ((ArrayType) currentComponentType).getComponentType(); searchedDimension--; - } + } } } -//{ObjectTeams: convert reused abstract methode declaration +//{ObjectTeams: convert reused abstract methode declaration private boolean isReusedAbstractMethodDeclaration(org.eclipse.jdt.internal.compiler.ast.TypeDeclaration typeDeclaration, org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration methodDeclaration) { return (methodDeclaration.isReusingSourceMethod && methodDeclaration.sourceStart > 0 ); } - + public MethodDeclaration convertReusedAbstractMethodDeclaration( - org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration methodDeclaration) + org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration methodDeclaration) { MethodDeclaration methodDecl = (MethodDeclaration) convert(methodDeclaration); if(methodDecl.ast.apiLevel() == AST.JLS2) diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTMatcher.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTMatcher.java index 2fb2bc9df..c531e5bf5 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTMatcher.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTMatcher.java @@ -19,8 +19,8 @@ import java.util.List; /** * Concrete superclass and default implementation of an AST subtree matcher. * <p> - * For example, to compute whether two ASTs subtrees are structurally - * isomorphic, use <code>n1.subtreeMatch(new ASTMatcher(), n2)</code> where + * For example, to compute whether two ASTs subtrees are structurally + * isomorphic, use <code>n1.subtreeMatch(new ASTMatcher(), n2)</code> where * <code>n1</code> and <code>n2</code> are the AST root nodes of the subtrees. * </p> * <p> @@ -29,37 +29,37 @@ import java.util.List; * that matches the given node against another object (typically another * AST node, although this is not essential). The default implementations * provided by this class tests whether the other object is a node of the - * same type with structurally isomorphic child subtrees. For nodes with + * same type with structurally isomorphic child subtrees. For nodes with * list-valued properties, the child nodes within the list are compared in * order. For nodes with multiple properties, the child nodes are compared * in the order that most closely corresponds to the lexical reading order - * of the source program. For instance, for a type declaration node, the - * child ordering is: name, superclass, superinterfaces, and body + * of the source program. For instance, for a type declaration node, the + * child ordering is: name, superclass, superinterfaces, and body * declarations. * </p> * <p> - * Subclasses may override (extend or reimplement) some or all of the + * Subclasses may override (extend or reimplement) some or all of the * <code>match</code> methods in order to define more specialized subtree * matchers. * </p> - * + * * @see org.eclipse.jdt.core.dom.ASTNode#subtreeMatch(ASTMatcher, Object) * @since 2.0 */ @SuppressWarnings("unchecked") public class ASTMatcher { - + /** * Indicates whether doc tags should be matched. * @since 3.0 */ private boolean matchDocTags; - + /** * Creates a new AST matcher instance. * <p> * For backwards compatibility, the matcher ignores tag - * elements below doc comments by default. Use + * elements below doc comments by default. Use * {@link #ASTMatcher(boolean) ASTMatcher(true)} * for a matcher that compares doc tags by default. * </p> @@ -70,7 +70,7 @@ public class ASTMatcher { /** * Creates a new AST matcher instance. - * + * * @param matchDocTags <code>true</code> if doc comment tags are * to be compared by default, and <code>false</code> otherwise * @see #match(Javadoc,Object) @@ -87,13 +87,13 @@ public class ASTMatcher { * Note that this is a convenience method, useful for writing recursive * subtree matchers. * </p> - * + * * @param list1 the first list of AST nodes * (element type: <code>ASTNode</code>) * @param list2 the second list of AST nodes * (element type: <code>ASTNode</code>) * @return <code>true</code> if the lists have the same number of elements - * and match pair-wise according to <code>ASTNode.subtreeMatch</code> + * and match pair-wise according to <code>ASTNode.subtreeMatch</code> * @see ASTNode#subtreeMatch(ASTMatcher matcher, Object other) */ public final boolean safeSubtreeListMatch(List list1, List list2) { @@ -121,13 +121,13 @@ public class ASTMatcher { * Note that this is a convenience method, useful for writing recursive * subtree matchers. * </p> - * + * * @param node1 the first AST node, or <code>null</code>; must be an * instance of <code>ASTNode</code> * @param node2 the second AST node, or <code>null</code>; must be an * instance of <code>ASTNode</code> * @return <code>true</code> if the nodes match according - * to <code>AST.subtreeMatch</code> or both are <code>null</code>, and + * to <code>AST.subtreeMatch</code> or both are <code>null</code>, and * <code>false</code> otherwise * @see ASTNode#subtreeMatch(ASTMatcher, Object) */ @@ -146,11 +146,11 @@ public class ASTMatcher { * Returns whether the given objects are equal according to * <code>equals</code>. Returns <code>false</code> if either * node is <code>null</code>. - * + * * @param o1 the first object, or <code>null</code> * @param o2 the second object, or <code>null</code> * @return <code>true</code> if the nodes are equal according to - * <code>equals</code> or both <code>null</code>, and + * <code>equals</code> or both <code>null</code>, and * <code>false</code> otherwise */ public static boolean safeEquals(Object o1, Object o2) { @@ -170,10 +170,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> * @since 3.1 @@ -197,10 +197,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> * @since 3.1 @@ -225,10 +225,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -247,10 +247,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -271,10 +271,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -296,10 +296,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -318,10 +318,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -340,10 +340,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -364,10 +364,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -389,10 +389,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -416,10 +416,10 @@ public class ASTMatcher { * only be called if a client goes out of their way to visit this * kind of node explicitly. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> * @since 3.0 @@ -438,10 +438,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -460,10 +460,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -482,10 +482,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -506,10 +506,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -530,10 +530,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -552,10 +552,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -578,7 +578,7 @@ public class ASTMatcher { return false; } } - return + return safeSubtreeMatch(node.getExpression(), o.getExpression()) && safeSubtreeListMatch(node.arguments(), o.arguments()) && safeSubtreeMatch( @@ -593,10 +593,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -618,10 +618,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -643,10 +643,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -670,10 +670,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -692,10 +692,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -708,7 +708,7 @@ public class ASTMatcher { safeSubtreeMatch(node.getExpression(), o.getExpression()) && safeSubtreeMatch(node.getBody(), o.getBody())); } - + /** * Returns whether the given node and the other object match. * <p> @@ -716,10 +716,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -737,10 +737,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> * @since 3.1 @@ -763,10 +763,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> * @since 3.1 @@ -785,7 +785,7 @@ public class ASTMatcher { node.getAnonymousClassDeclaration(), o.getAnonymousClassDeclaration())); } - + /** * Returns whether the given node and the other object match. * <p> @@ -793,10 +793,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> * @since 3.1 @@ -816,7 +816,7 @@ public class ASTMatcher { node.bodyDeclarations(), o.bodyDeclarations())); } - + /** * Returns whether the given node and the other object match. * <p> @@ -824,10 +824,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -846,10 +846,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -870,10 +870,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -893,7 +893,7 @@ public class ASTMatcher { return false; } } - return + return safeSubtreeMatch(node.getJavadoc(), o.getJavadoc()) && safeSubtreeMatch(node.getType(), o.getType()) && safeSubtreeListMatch(node.fragments(), o.fragments()); @@ -906,10 +906,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -932,10 +932,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -957,10 +957,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -986,10 +986,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -1020,10 +1020,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -1044,10 +1044,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -1077,22 +1077,22 @@ public class ASTMatcher { * <p> * Unlike other node types, the behavior of the default * implementation is controlled by a constructor-supplied - * parameter {@link #ASTMatcher(boolean) ASTMatcher(boolean)} - * which is <code>false</code> if not specified. + * parameter {@link #ASTMatcher(boolean) ASTMatcher(boolean)} + * which is <code>false</code> if not specified. * When this parameter is <code>true</code>, the implementation * tests whether the other object is also a <code>Javadoc</code> - * with structurally isomorphic child subtrees; the comment string + * with structurally isomorphic child subtrees; the comment string * (<code>Javadoc.getComment()</code>) is ignored. * Conversely, when the parameter is <code>false</code>, the * implementation tests whether the other object is also a - * <code>Javadoc</code> with exactly the same comment string; + * <code>Javadoc</code> with exactly the same comment string; * the tag elements ({@link Javadoc#tags() Javadoc.tags} are * ignored. Subclasses may reimplement. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> * @see #ASTMatcher() @@ -1131,10 +1131,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -1160,10 +1160,10 @@ public class ASTMatcher { * only be called if a client goes out of their way to visit this * kind of node explicitly. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> * @since 3.0 @@ -1174,7 +1174,7 @@ public class ASTMatcher { } return true; } - + /** * Returns whether the given node and the other object match. * <p> @@ -1182,10 +1182,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> * @since 3.1 @@ -1205,10 +1205,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> * @since 3.0 @@ -1222,7 +1222,7 @@ public class ASTMatcher { safeSubtreeMatch(node.getQualifier(), o.getQualifier()) && safeSubtreeMatch(node.getName(), o.getName())); } - + /** * Returns whether the given node and the other object match. * <p> @@ -1230,10 +1230,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> * @since 3.1 @@ -1254,10 +1254,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> * @since 3.0 @@ -1280,10 +1280,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> * @since 3.0 @@ -1303,7 +1303,7 @@ public class ASTMatcher { safeSubtreeMatch(node.getType(), o.getType()) && safeSubtreeMatch(node.getName(), o.getName())); } - + /** * Returns whether the given node and the other object match. * <p> @@ -1319,10 +1319,10 @@ public class ASTMatcher { * Note that the method return types are compared even for constructor * declarations. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -1359,7 +1359,7 @@ public class ASTMatcher { && safeSubtreeListMatch(node.parameters(), o.parameters()) && node.getExtraDimensions() == o.getExtraDimensions() && safeSubtreeListMatch(node.thrownExceptions(), o.thrownExceptions()) -//{ObjectTeams: +//{ObjectTeams: && safeSubtreeMatch(node.getGuardPredicate(), o.getGuardPredicate()) // SH} && safeSubtreeMatch(node.getBody(), o.getBody())); @@ -1372,10 +1372,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -1402,10 +1402,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> * @since 3.1 @@ -1425,10 +1425,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> * @since 3.1 @@ -1449,10 +1449,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -1470,10 +1470,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -1492,10 +1492,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -1522,10 +1522,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> * @since 3.1 @@ -1546,10 +1546,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -1568,10 +1568,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -1592,10 +1592,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -1616,10 +1616,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -1638,10 +1638,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -1662,10 +1662,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> * @since 3.1 @@ -1687,10 +1687,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -1709,10 +1709,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -1731,10 +1731,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -1753,10 +1753,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> * @since 3.1 @@ -1778,13 +1778,13 @@ public class ASTMatcher { * child subtrees. Subclasses may override this method as needed. * </p> * <p> - * Note that extra array dimensions and the variable arity flag + * Note that extra array dimensions and the variable arity flag * are compared since they are both important parts of the declaration. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -1807,7 +1807,7 @@ public class ASTMatcher { return false; } } - return + return safeSubtreeMatch(node.getType(), o.getType()) && safeSubtreeMatch(node.getName(), o.getName()) && node.getExtraDimensions() == o.getExtraDimensions() @@ -1821,10 +1821,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -1843,10 +1843,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -1872,10 +1872,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -1896,10 +1896,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -1926,10 +1926,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -1948,10 +1948,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -1972,10 +1972,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -1996,10 +1996,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> * @since 3.0 @@ -2021,10 +2021,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> * @since 3.0 @@ -2044,10 +2044,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -2066,10 +2066,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -2088,10 +2088,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -2113,10 +2113,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -2156,7 +2156,7 @@ public class ASTMatcher { if (node.isRole() != o.isRole()) return false; if (!safeSubtreeListMatch(node.precedences(), o.precedences())) - return false; + return false; // SH} } return ( @@ -2173,10 +2173,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -2195,10 +2195,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -2217,10 +2217,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> * @since 3.1 @@ -2245,10 +2245,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -2283,10 +2283,10 @@ public class ASTMatcher { * Note that extra array dimensions are compared since they are an * important part of the type of the variable. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -2307,10 +2307,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -2341,10 +2341,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -2365,10 +2365,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> * @since 3.1 @@ -2381,8 +2381,8 @@ public class ASTMatcher { return node.isUpperBound() == o.isUpperBound() && safeSubtreeMatch(node.getBound(), o.getBound()); } - -//{ObjectTeams: match methods for OT-specific types + +//{ObjectTeams: match methods for OT-specific types /** * Returns whether the given node and the other object match. * <p> @@ -2390,10 +2390,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -2424,7 +2424,7 @@ public class ASTMatcher { && (node.hasSignature() == otherMethodSpec.hasSignature()) && (node.hasCovariantReturn() == otherMethodSpec.hasCovariantReturn()); } - + /** * Returns whether the given node and the other object match. * <p> @@ -2432,10 +2432,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -2447,7 +2447,7 @@ public class ASTMatcher { } CallinMappingDeclaration node2 = (CallinMappingDeclaration)other; int level = node.getAST().apiLevel; - + if (level == AST.JLS3) { if (!safeSubtreeMatch(node.getName(), node2.getName())) @@ -2467,14 +2467,14 @@ public class ASTMatcher { node2.getBaseMappingElements())) { return false; - } + } if (!safeSubtreeListMatch(node.getParameterMappings(), node2.getParameterMappings())) { return false; } } - if (level >= AST.JLS2) + if (level >= AST.JLS2) { node.setFlags(ASTNode.MALFORMED); } @@ -2489,10 +2489,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -2504,7 +2504,7 @@ public class ASTMatcher { } CalloutMappingDeclaration otherCalloutMappingDecl = (CalloutMappingDeclaration) other; int level = node.getAST().apiLevel; - + if (level == AST.JLS3) { if (!safeSubtreeMatch(node.getRoleMappingElement(), @@ -2523,7 +2523,7 @@ public class ASTMatcher { return false; } } - if (level >= AST.JLS2) + if (level >= AST.JLS2) { node.setFlags(ASTNode.MALFORMED); } @@ -2539,10 +2539,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -2566,10 +2566,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -2590,10 +2590,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -2604,7 +2604,7 @@ public class ASTMatcher { return false; } WithinStatement node2 = (WithinStatement) other; - + return (safeSubtreeMatch(node.getBody(), node2.getBody()) && safeSubtreeMatch(node.getTeamExpression(), node2.getTeamExpression()) ); @@ -2617,10 +2617,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -2643,10 +2643,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -2661,7 +2661,7 @@ public class ASTMatcher { otherExpression.getArguments()) ); } - + /** * Returns whether the given node and the other object match. * <p> @@ -2669,10 +2669,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -2687,7 +2687,7 @@ public class ASTMatcher { && safeSubtreeListMatch(node.getArguments(), otherExpression.getArguments()) ); } - + /** * Returns whether the given node and the other object match. * <p> @@ -2695,10 +2695,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -2720,10 +2720,10 @@ public class ASTMatcher { * other object is a node of the same type with structurally isomorphic * child subtrees. Subclasses may override this method as needed. * </p> - * + * * @param node the node * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match or the other object has a * different node type or is <code>null</code> */ @@ -2736,13 +2736,13 @@ public class ASTMatcher { (org.eclipse.jdt.core.dom.ParameterMapping) other; return safeSubtreeMatch(node.getExpression(), otherParameterMapping.getExpression()); } - + public boolean match(org.eclipse.jdt.core.dom.RoleTypeDeclaration node, Object other) { if (!(other instanceof org.eclipse.jdt.core.dom.RoleTypeDeclaration)) { return false; } - + RoleTypeDeclaration o = (RoleTypeDeclaration) other; int level = node.getAST().apiLevel; if (level == AST.JLS2) @@ -2798,7 +2798,7 @@ public class ASTMatcher { if (node.isRoleFile() != o.isRoleFile()) return false; if (!safeSubtreeListMatch(node.precedences(), o.precedences())) - return false; + return false; } return ( (node.isInterface() == o.isInterface()) @@ -2806,8 +2806,8 @@ public class ASTMatcher { && safeSubtreeMatch(node.getName(), o.getName()) && safeSubtreeMatch(node.getGuardPredicate(), o.getGuardPredicate()) && safeSubtreeListMatch(node.bodyDeclarations(), o.bodyDeclarations())); - } - + } + public boolean match(FieldAccessSpec node, Object other) { if (!(other instanceof FieldAccessSpec)) { return false; @@ -2817,11 +2817,11 @@ public class ASTMatcher { if (!safeSubtreeMatch(node.getFieldType(), otherFieldAccessSpec.getFieldType())) { return false; } - + return ((node.hasSignature() == otherFieldAccessSpec.hasSignature()) && safeSubtreeMatch(node.getName(), otherFieldAccessSpec.getName())); } - + public boolean match(PrecedenceDeclaration node, Object other) { if (!(other instanceof PrecedenceDeclaration)) { return false; @@ -2831,7 +2831,7 @@ public class ASTMatcher { return node.isAfter() == otherPrecedence.isAfter() && safeSubtreeMatch(node.elements(), otherPrecedence.elements()); } - + public boolean match(GuardPredicateDeclaration node, Object other) { if (!(other instanceof GuardPredicateDeclaration)) return false; @@ -2840,5 +2840,5 @@ public class ASTMatcher { node.isBase() == otherPredicate.isBase() && safeSubtreeMatch(node.getExpression(), otherPredicate.getExpression()); } -//gbr, jsv, SH} +//gbr, jsv, SH} } diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTNode.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTNode.java index 974d92f15..812bbee0d 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTNode.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTNode.java @@ -39,14 +39,14 @@ import org.eclipse.jdt.internal.core.dom.NaiveASTFlattener; * <p> * When an AST node is part of an AST, it has a unique parent node. * Clients can navigate upwards, from child to parent, as well as downwards, - * from parent to child. Newly created nodes are unparented. When an - * unparented node is set as a child of a node (using a + * from parent to child. Newly created nodes are unparented. When an + * unparented node is set as a child of a node (using a * <code>set<i>CHILD</i></code> method), its parent link is set automatically * and the parent link of the former child is set to <code>null</code>. * For nodes with properties that include a list of children (for example, * <code>Block</code> whose <code>statements</code> property is a list * of statements), adding or removing an element to/for the list property - * automatically updates the parent links. These lists support the + * automatically updates the parent links. These lists support the * <code>List.set</code> method; however, the constraint that the same * node cannot appear more than once means that this method cannot be used * to swap elements without first removing the node. @@ -58,7 +58,7 @@ import org.eclipse.jdt.internal.core.dom.NaiveASTFlattener; * <p> * ASTs do not contain "holes" (missing subtrees). If a node is required to * have a certain property, a syntactically plausible initial value is - * always supplied. + * always supplied. * </p> * <p> * The hierarchy of AST node types has some convenient groupings marked @@ -91,7 +91,7 @@ import org.eclipse.jdt.internal.core.dom.NaiveASTFlattener; * </p> * <p> * Each AST node is capable of carrying an open-ended collection of - * client-defined properties. Newly created nodes have none. + * client-defined properties. Newly created nodes have none. * <code>getProperty</code> and <code>setProperty</code> are used to access * these properties. * </p> @@ -101,7 +101,7 @@ import org.eclipse.jdt.internal.core.dom.NaiveASTFlattener; * existing ones, it is <b>not</b> safe for another thread to read, visit, * write, create, or clone <em>any</em> of the nodes on the same AST. * When synchronization is required, consider using the common AST - * object that owns the node; that is, use + * object that owns the node; that is, use * <code>synchronize (node.getAST()) {...}</code>. * </p> * <p> @@ -112,13 +112,13 @@ import org.eclipse.jdt.internal.core.dom.NaiveASTFlattener; * <p> * Compilation units created by <code>ASTParser</code> from a * source document can be serialized after arbitrary modifications - * with minimal loss of original formatting. See + * with minimal loss of original formatting. See * {@link CompilationUnit#recordModifications()} for details. * See also {@link org.eclipse.jdt.core.dom.rewrite.ASTRewrite} for * an alternative way to describe and serialize changes to a * read-only AST. * </p> - * + * * @see ASTParser * @see ASTVisitor * @see NodeFinder @@ -128,475 +128,475 @@ import org.eclipse.jdt.internal.core.dom.NaiveASTFlattener; public abstract class ASTNode { /* * INSTRUCTIONS FOR ADDING NEW CONCRETE AST NODE TYPES - * + * * There are several things that need to be changed when a * new concrete AST node type (call it "FooBar"): - * + * * 1. Create the FooBar AST node type class. * The most effective way to do this is to copy a similar * existing concrete node class to get a template that * includes all the framework methods that must be implemented. - * + * * 2. Add node type constant ASTNode.FOO_BAR. * Node constants are numbered consecutively. Add the * constant after the existing ones. - * + * * 3. Add entry to ASTNode.nodeClassForType(int). - * + * * 4. Add AST.newFooBar() factory method. - * + * * 5. Add ASTVisitor.visit(FooBar) and endVisit(FooBar) methods. - * + * * 6. Add ASTMatcher.match(FooBar,Object) method. - * + * * 7. Ensure that SimpleName.isDeclaration() covers FooBar * nodes if required. - * + * * 8. Add NaiveASTFlattener.visit(FooBar) method to illustrate * how these nodes should be serialized. - * + * * 9. Update the AST test suites. - * + * * The next steps are to update AST.parse* to start generating * the new type of nodes, and ASTRewrite to serialize them back out. */ - + /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>AnonymousClassDeclaration</code>. * @see AnonymousClassDeclaration */ public static final int ANONYMOUS_CLASS_DECLARATION = 1; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>ArrayAccess</code>. * @see ArrayAccess */ public static final int ARRAY_ACCESS = 2; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>ArrayCreation</code>. * @see ArrayCreation */ public static final int ARRAY_CREATION = 3; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>ArrayInitializer</code>. * @see ArrayInitializer */ public static final int ARRAY_INITIALIZER = 4; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>ArrayType</code>. * @see ArrayType */ public static final int ARRAY_TYPE = 5; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>AssertStatement</code>. * @see AssertStatement */ public static final int ASSERT_STATEMENT = 6; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>Assignment</code>. * @see Assignment */ public static final int ASSIGNMENT = 7; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>Block</code>. * @see Block */ public static final int BLOCK = 8; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>BooleanLiteral</code>. * @see BooleanLiteral */ public static final int BOOLEAN_LITERAL = 9; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>BreakStatement</code>. * @see BreakStatement */ public static final int BREAK_STATEMENT = 10; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>CastExpression</code>. * @see CastExpression */ public static final int CAST_EXPRESSION = 11; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>CatchClause</code>. * @see CatchClause */ public static final int CATCH_CLAUSE = 12; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>CharacterLiteral</code>. * @see CharacterLiteral */ public static final int CHARACTER_LITERAL = 13; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>ClassInstanceCreation</code>. * @see ClassInstanceCreation */ public static final int CLASS_INSTANCE_CREATION = 14; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>CompilationUnit</code>. * @see CompilationUnit */ public static final int COMPILATION_UNIT = 15; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>ConditionalExpression</code>. * @see ConditionalExpression */ public static final int CONDITIONAL_EXPRESSION = 16; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>ConstructorInvocation</code>. * @see ConstructorInvocation */ public static final int CONSTRUCTOR_INVOCATION = 17; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>ContinueStatement</code>. * @see ContinueStatement */ public static final int CONTINUE_STATEMENT = 18; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>DoStatement</code>. * @see DoStatement */ public static final int DO_STATEMENT = 19; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>EmptyStatement</code>. * @see EmptyStatement */ public static final int EMPTY_STATEMENT = 20; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>ExpressionStatement</code>. * @see ExpressionStatement */ public static final int EXPRESSION_STATEMENT = 21; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>FieldAccess</code>. * @see FieldAccess */ public static final int FIELD_ACCESS = 22; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>FieldDeclaration</code>. * @see FieldDeclaration */ public static final int FIELD_DECLARATION = 23; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>ForStatement</code>. * @see ForStatement */ public static final int FOR_STATEMENT = 24; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>IfStatement</code>. * @see IfStatement */ public static final int IF_STATEMENT = 25; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>ImportDeclaration</code>. * @see ImportDeclaration */ public static final int IMPORT_DECLARATION = 26; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>InfixExpression</code>. * @see InfixExpression */ public static final int INFIX_EXPRESSION = 27; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>Initializer</code>. * @see Initializer */ public static final int INITIALIZER = 28; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>Javadoc</code>. * @see Javadoc */ public static final int JAVADOC = 29; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>LabeledStatement</code>. * @see LabeledStatement */ public static final int LABELED_STATEMENT = 30; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>MethodDeclaration</code>. * @see MethodDeclaration */ public static final int METHOD_DECLARATION = 31; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>MethodInvocation</code>. * @see MethodInvocation */ public static final int METHOD_INVOCATION = 32; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>NullLiteral</code>. * @see NullLiteral */ public static final int NULL_LITERAL = 33; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>NumberLiteral</code>. * @see NumberLiteral */ public static final int NUMBER_LITERAL = 34; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>PackageDeclaration</code>. * @see PackageDeclaration */ public static final int PACKAGE_DECLARATION = 35; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>ParenthesizedExpression</code>. * @see ParenthesizedExpression */ public static final int PARENTHESIZED_EXPRESSION = 36; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>PostfixExpression</code>. * @see PostfixExpression */ public static final int POSTFIX_EXPRESSION = 37; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>PrefixExpression</code>. * @see PrefixExpression */ public static final int PREFIX_EXPRESSION = 38; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>PrimitiveType</code>. * @see PrimitiveType */ public static final int PRIMITIVE_TYPE = 39; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>QualifiedName</code>. * @see QualifiedName */ public static final int QUALIFIED_NAME = 40; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>ReturnStatement</code>. * @see ReturnStatement */ public static final int RETURN_STATEMENT = 41; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>SimpleName</code>. * @see SimpleName */ public static final int SIMPLE_NAME = 42; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>SimpleType</code>. * @see SimpleType */ public static final int SIMPLE_TYPE = 43; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>SingleVariableDeclaration</code>. * @see SingleVariableDeclaration */ public static final int SINGLE_VARIABLE_DECLARATION = 44; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>StringLiteral</code>. * @see StringLiteral */ public static final int STRING_LITERAL = 45; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>SuperConstructorInvocation</code>. * @see SuperConstructorInvocation */ public static final int SUPER_CONSTRUCTOR_INVOCATION = 46; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>SuperFieldAccess</code>. * @see SuperFieldAccess */ public static final int SUPER_FIELD_ACCESS = 47; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>SuperMethodInvocation</code>. * @see SuperMethodInvocation */ public static final int SUPER_METHOD_INVOCATION = 48; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>SwitchCase</code>. * @see SwitchCase */ public static final int SWITCH_CASE = 49; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>SwitchStatement</code>. * @see SwitchStatement */ public static final int SWITCH_STATEMENT = 50; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>SynchronizedStatement</code>. * @see SynchronizedStatement */ public static final int SYNCHRONIZED_STATEMENT = 51; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>ThisExpression</code>. * @see ThisExpression */ public static final int THIS_EXPRESSION = 52; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>ThrowStatement</code>. * @see ThrowStatement */ public static final int THROW_STATEMENT = 53; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>TryStatement</code>. * @see TryStatement */ public static final int TRY_STATEMENT = 54; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>TypeDeclaration</code>. * @see TypeDeclaration */ public static final int TYPE_DECLARATION = 55; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>TypeDeclarationStatement</code>. * @see TypeDeclarationStatement */ public static final int TYPE_DECLARATION_STATEMENT = 56; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>TypeLiteral</code>. * @see TypeLiteral */ public static final int TYPE_LITERAL = 57; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>VariableDeclarationExpression</code>. * @see VariableDeclarationExpression */ public static final int VARIABLE_DECLARATION_EXPRESSION = 58; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>VariableDeclarationFragment</code>. * @see VariableDeclarationFragment */ public static final int VARIABLE_DECLARATION_FRAGMENT = 59; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>VariableDeclarationStatement</code>. * @see VariableDeclarationStatement */ public static final int VARIABLE_DECLARATION_STATEMENT = 60; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>WhileStatement</code>. * @see WhileStatement */ public static final int WHILE_STATEMENT = 61; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>InstanceofExpression</code>. * @see InstanceofExpression */ public static final int INSTANCEOF_EXPRESSION = 62; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>LineComment</code>. * @see LineComment * @since 3.0 @@ -604,7 +604,7 @@ public abstract class ASTNode { public static final int LINE_COMMENT = 63; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>BlockComment</code>. * @see BlockComment * @since 3.0 @@ -612,7 +612,7 @@ public abstract class ASTNode { public static final int BLOCK_COMMENT = 64; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>TagElement</code>. * @see TagElement * @since 3.0 @@ -620,7 +620,7 @@ public abstract class ASTNode { public static final int TAG_ELEMENT = 65; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>TextElement</code>. * @see TextElement * @since 3.0 @@ -628,7 +628,7 @@ public abstract class ASTNode { public static final int TEXT_ELEMENT = 66; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>MemberRef</code>. * @see MemberRef * @since 3.0 @@ -636,7 +636,7 @@ public abstract class ASTNode { public static final int MEMBER_REF = 67; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>MethodRef</code>. * @see MethodRef * @since 3.0 @@ -644,7 +644,7 @@ public abstract class ASTNode { public static final int METHOD_REF = 68; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>MethodRefParameter</code>. * @see MethodRefParameter * @since 3.0 @@ -652,7 +652,7 @@ public abstract class ASTNode { public static final int METHOD_REF_PARAMETER = 69; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>EnhancedForStatement</code>. * @see EnhancedForStatement * @since 3.1 @@ -660,23 +660,23 @@ public abstract class ASTNode { public static final int ENHANCED_FOR_STATEMENT = 70; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>EnumDeclaration</code>. * @see EnumDeclaration * @since 3.1 */ public static final int ENUM_DECLARATION = 71; - + /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>EnumConstantDeclaration</code>. * @see EnumConstantDeclaration * @since 3.1 */ public static final int ENUM_CONSTANT_DECLARATION = 72; - + /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>TypeParameter</code>. * @see TypeParameter * @since 3.1 @@ -684,7 +684,7 @@ public abstract class ASTNode { public static final int TYPE_PARAMETER = 73; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>ParameterizedType</code>. * @see ParameterizedType * @since 3.1 @@ -692,179 +692,179 @@ public abstract class ASTNode { public static final int PARAMETERIZED_TYPE = 74; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>QualifiedType</code>. * @see QualifiedType * @since 3.1 */ public static final int QUALIFIED_TYPE = 75; - + /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>WildcardType</code>. * @see WildcardType * @since 3.1 */ public static final int WILDCARD_TYPE = 76; - + /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>NormalAnnotation</code>. * @see NormalAnnotation * @since 3.1 */ public static final int NORMAL_ANNOTATION = 77; - + /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>MarkerAnnotation</code>. * @see MarkerAnnotation * @since 3.1 */ public static final int MARKER_ANNOTATION = 78; - + /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>SingleMemberAnnotation</code>. * @see SingleMemberAnnotation * @since 3.1 */ public static final int SINGLE_MEMBER_ANNOTATION = 79; - + /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>MemberValuePair</code>. * @see MemberValuePair * @since 3.1 */ public static final int MEMBER_VALUE_PAIR = 80; - + /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>AnnotationTypeDeclaration</code>. * @see AnnotationTypeDeclaration * @since 3.1 */ public static final int ANNOTATION_TYPE_DECLARATION = 81; - + /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>AnnotationTypeMemberDeclaration</code>. * @see AnnotationTypeMemberDeclaration * @since 3.1 */ public static final int ANNOTATION_TYPE_MEMBER_DECLARATION = 82; - + /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>Modifier</code>. * @see Modifier * @since 3.1 */ public static final int MODIFIER = 83; - + //{ObjectTeams: required OT specific node type constants added - + /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>MethodSpec</code>. * @see MethodSpec */ public static final int METHOD_SPEC = 84; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>CallinMappingDeclaration</code>. * @see CallinMappingDeclaration */ public static final int CALLIN_MAPPING_DECLARATION = 85; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>CalloutMappingDeclaration</code>. * @see CalloutMappingDeclaration */ public static final int CALLOUT_MAPPING_DECLARATION = 86; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>LiftingType</code>. * @see LiftingType */ public static final int LIFTING_TYPE = 87; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>WithinStatement</code>. * @see WithinStatement */ public static final int WITHIN_STATEMENT = 88; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>BaseConstructorMessageSend</code>. * @see BaseConstructorMessageSend */ public static final int BASE_CONSTRUCTOR_INVOCATION = 89; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>ParameterMapping</code>. * @see ParameterMapping - */ + */ public static final int PARAMETER_MAPPING = 90; - + /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>BaseCallMessageSend</code>. * @see BaseCallMessageSend */ public static final int BASE_CALL_MESSAGE_SEND = 91; - + /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>FieldAccessSpec</code>. * @see FieldAccessSpec */ public static final int FIELD_ACCESS_SPEC = 92; - + /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>RoleTypeDelaration</code>. * @see RoleTypeDelaration */ public static final int ROLE_TYPE_DECLARATION = 93; - + /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>TSuperCallMessageSend</code>. * @see TSuperCallMessageSend */ public static final int TSUPER_MESSAGE_SEND = 94; /** - * Node type constant indicating a node of type + * Node type constant indicating a node of type * <code>TSuperCallMessageSend</code>. * @see TSuperCallMessageSend */ public static final int TSUPER_CONSTRUCTOR_INVOCATION = 95; - + public static final int TYPE_ANCHOR = 96; - + public static final int PRECEDENCE_DECLARATION = 97; - + public static final int GUARD_PREDICATE_DECLARATION = 98; /** @since 1.3.1 */ - public static final int METHOD_BINDING_OPERATOR = 99; + public static final int METHOD_BINDING_OPERATOR = 99; //gbr} /** * Returns the node class for the corresponding node type. - * + * * @param nodeType AST node type * @return the corresponding <code>ASTNode</code> subclass - * @exception IllegalArgumentException if <code>nodeType</code> is + * @exception IllegalArgumentException if <code>nodeType</code> is * not a legal AST node type * @see #getNodeType() * @since 3.0 @@ -1037,7 +1037,7 @@ public abstract class ASTNode { return WhileStatement.class; case WILDCARD_TYPE : return WildcardType.class; -//{ObjectTeams: entries for OT specific node types added +//{ObjectTeams: entries for OT specific node types added case METHOD_SPEC : return MethodSpec.class; case CALLIN_MAPPING_DECLARATION : @@ -1074,7 +1074,7 @@ public abstract class ASTNode { } throw new IllegalArgumentException(); } - + /** * Owning AST. * <p> @@ -1083,19 +1083,19 @@ public abstract class ASTNode { * </p> */ final AST ast; - + /** * Parent AST node, or <code>null</code> if this node is a root. * Initially <code>null</code>. */ private ASTNode parent = null; - + /** * An unmodifiable empty map (used to implement <code>properties()</code>). */ private static final Map UNMODIFIABLE_EMPTY_MAP = Collections.unmodifiableMap(new HashMap(1)); - + /** * Primary field used in representing node properties efficiently. * If <code>null</code>, this node has no properties. @@ -1105,20 +1105,20 @@ public abstract class ASTNode { * mappings; <code>property2</code>, if non-null is its unmodifiable * equivalent. * Initially <code>null</code>. - * + * * @see #property2 */ private Object property1 = null; - + /** * Auxillary field used in representing node properties efficiently. - * + * * @see #property1 */ private Object property2 = null; - + /** - * A character index into the original source string, + * A character index into the original source string, * or <code>-1</code> if no source position information is available * for this node; <code>-1</code> by default. */ @@ -1129,7 +1129,7 @@ public abstract class ASTNode { * information is recorded for this node; <code>0</code> by default. */ private int length = 0; - + /** * Flag constant (bit mask, value 1) indicating that there is something * not quite right with this AST node. @@ -1182,7 +1182,7 @@ public abstract class ASTNode { * @since 3.2 */ public static final int RECOVERED = 8; - + /** * int containing the node type in the top 16 bits and * flags in the bottom 16 bits; none set by default. @@ -1190,46 +1190,46 @@ public abstract class ASTNode { * N.B. This is a private field, but declared as package-visible * for more efficient access from inner classes. * </p> - * + * * @see #MALFORMED */ int typeAndFlags = 0; - + /** * Property of parent in which this node is a child, or <code>null</code> * if this node is a root. Initially <code>null</code>. - * + * * @see #getLocationInParent * @since 3.0 */ private StructuralPropertyDescriptor location = null; - + /** Internal convenience constant indicating that there is definite risk of cycles. * @since 3.0 - */ + */ static final boolean CYCLE_RISK = true; - + /** Internal convenience constant indicating that there is no risk of cycles. * @since 3.0 - */ + */ static final boolean NO_CYCLE_RISK = false; - + /** Internal convenience constant indicating that a structural property is mandatory. * @since 3.0 - */ + */ static final boolean MANDATORY = true; - + /** Internal convenience constant indicating that a structural property is optional. * @since 3.0 - */ + */ static final boolean OPTIONAL = false; - + /** * A specialized implementation of a list of ASTNodes. The * implementation is based on an ArrayList. - */ + */ class NodeList extends AbstractList { - + /** * The underlying list in which the nodes of this list are * stored (element type: <code>ASTNode</code>). @@ -1243,12 +1243,12 @@ public abstract class ASTNode { * </p> */ ArrayList store = new ArrayList(0); - + /** * The property descriptor for this list. */ ChildListPropertyDescriptor propertyDescriptor; - + /** * A cursor for iterating over the elements of the list. * Does not lose its position if the list is changed during @@ -1262,14 +1262,14 @@ public abstract class ASTNode { * list. */ private int position = 0; - + /* (non-Javadoc) * Method declared on <code>Iterator</code>. */ public boolean hasNext() { return this.position < NodeList.this.store.size(); } - + /* (non-Javadoc) * Method declared on <code>Iterator</code>. */ @@ -1278,18 +1278,18 @@ public abstract class ASTNode { this.position++; return result; } - + /* (non-Javadoc) * Method declared on <code>Iterator</code>. */ public void remove() { throw new UnsupportedOperationException(); } - + /** * Adjusts this cursor to accomodate an add/remove at the given * index. - * + * * @param index the position at which the element was added * or removed * @param delta +1 for add, and -1 for remove @@ -1310,7 +1310,7 @@ public abstract class ASTNode { * It is important for storage considerations to maintain the * null-means-empty invariant; otherwise, every NodeList instance * will waste a lot of space. A cursor is needed only for the duration - * of a visit to the child nodes. Under normal circumstances, only a + * of a visit to the child nodes. Under normal circumstances, only a * single cursor is needed; multiple cursors are only required if there * are multiple visits going on at the same time. * </p> @@ -1319,9 +1319,9 @@ public abstract class ASTNode { /** * Creates a new empty list of nodes owned by this node. - * This node will be the common parent of all nodes added to + * This node will be the common parent of all nodes added to * this list. - * + * * @param property the property descriptor * @since 3.0 */ @@ -1329,21 +1329,21 @@ public abstract class ASTNode { super(); this.propertyDescriptor = property; } - + /* (non-javadoc) * @see java.util.AbstractCollection#size() */ public int size() { return this.store.size(); } - + /* (non-javadoc) * @see AbstractList#get(int) */ public Object get(int index) { return this.store.get(index); } - + /* (non-javadoc) * @see List#set(int, java.lang.Object) */ @@ -1367,7 +1367,7 @@ public abstract class ASTNode { } ASTNode.checkNewChild(ASTNode.this, newChild, this.propertyDescriptor.cycleRisk, this.propertyDescriptor.elementType); ASTNode.this.ast.preReplaceChildEvent(ASTNode.this, oldChild, newChild, this.propertyDescriptor); - + Object result = this.store.set(index, newChild); // n.b. setParent will call ast.modifying() oldChild.setParent(null, null); @@ -1375,7 +1375,7 @@ public abstract class ASTNode { ASTNode.this.ast.postReplaceChildEvent(ASTNode.this, oldChild, newChild, this.propertyDescriptor); return result; } - + /* (non-javadoc) * @see List#add(int, java.lang.Object) */ @@ -1391,15 +1391,15 @@ public abstract class ASTNode { ASTNode newChild = (ASTNode) element; ASTNode.checkNewChild(ASTNode.this, newChild, this.propertyDescriptor.cycleRisk, this.propertyDescriptor.elementType); ASTNode.this.ast.preAddChildEvent(ASTNode.this, newChild, this.propertyDescriptor); - - + + this.store.add(index, element); updateCursors(index, +1); // n.b. setParent will call ast.modifying() newChild.setParent(ASTNode.this, this.propertyDescriptor); ASTNode.this.ast.postAddChildEvent(ASTNode.this, newChild, this.propertyDescriptor); } - + /* (non-javadoc) * @see List#remove(int) */ @@ -1414,7 +1414,7 @@ public abstract class ASTNode { // old child is protected => cannot be unparented throw new IllegalArgumentException("AST node cannot be modified"); //$NON-NLS-1$ } - + ASTNode.this.ast.preRemoveChildEvent(ASTNode.this, oldChild, this.propertyDescriptor); // n.b. setParent will call ast.modifying() oldChild.setParent(null, null); @@ -1424,7 +1424,7 @@ public abstract class ASTNode { return result; } - + /** * Allocate a cursor to use for a visit. The client must call * <code>releaseCursor</code> when done. @@ -1432,8 +1432,8 @@ public abstract class ASTNode { * This method is internally synchronized on this NodeList. * It is thread-safe to create a cursor. * </p> - * - * @return a new cursor positioned before the first element + * + * @return a new cursor positioned before the first element * of the list */ Cursor newCursor() { @@ -1448,14 +1448,14 @@ public abstract class ASTNode { return result; } } - + /** * Releases the given cursor at the end of a visit. * <p> * This method is internally synchronized on this NodeList. * It is thread-safe to release a cursor. * </p> - * + * * @param cursor the cursor */ void releaseCursor(Cursor cursor) { @@ -1477,7 +1477,7 @@ public abstract class ASTNode { * This method is only used when the list is being modified. * The AST is not thread-safe if any of the clients are modifying it. * </p> - * + * * @param index the position at which the element was added * or removed * @param delta +1 for add, and -1 for remove @@ -1492,9 +1492,9 @@ public abstract class ASTNode { c.update(index, delta); } } - + /** - * Returns an estimate of the memory footprint of this node list + * Returns an estimate of the memory footprint of this node list * instance in bytes. * <ul> * <li>1 object header for the NodeList instance</li> @@ -1505,7 +1505,7 @@ public abstract class ASTNode { * <li>1 object header for an Object[] instance</li> * <li>4 bytes in array for each element</li> * </ul> - * + * * @return the size of this node list in bytes */ int memSize() { @@ -1518,7 +1518,7 @@ public abstract class ASTNode { /** * Returns an estimate of the memory footprint in bytes of this node * list and all its subtrees. - * + * * @return the size of this list of subtrees in bytes */ int listSize() { @@ -1537,37 +1537,37 @@ public abstract class ASTNode { * over the lifetime of the node. The new node has no parent node, * and no properties. * <p> - * N.B. This constructor is package-private; all subclasses my be - * declared in the same package; clients are unable to declare + * N.B. This constructor is package-private; all subclasses my be + * declared in the same package; clients are unable to declare * additional subclasses. * </p> - * + * * @param ast the AST that is to own this node */ ASTNode(AST ast) { if (ast == null) { throw new IllegalArgumentException(); } - + this.ast = ast; setNodeType(getNodeType0()); setFlags(ast.getDefaultNodeFlag()); // setFlags calls modifying(); } - + /** * Returns this node's AST. * <p> * Note that the relationship between an AST node and its owing AST does * not change over the lifetime of a node. * </p> - * + * * @return the AST that owns this node - */ + */ public final AST getAST() { return this.ast; } - + /** * Returns this node's parent node, or <code>null</code> if this is the * root node. @@ -1575,13 +1575,13 @@ public abstract class ASTNode { * Note that the relationship between an AST node and its parent node * may change over the lifetime of a node. * </p> - * + * * @return the parent of this node, or <code>null</code> if none - */ + */ public final ASTNode getParent() { return this.parent; } - + /** * Returns the location of this node within its parent, * or <code>null</code> if this is a root node. @@ -1601,21 +1601,21 @@ public abstract class ASTNode { * Note that the relationship between an AST node and its parent node * may change over the lifetime of a node. * </p> - * - * @return the location of this node in its parent, + * + * @return the location of this node in its parent, * or <code>null</code> if this node has no parent * @since 3.0 - */ + */ public final StructuralPropertyDescriptor getLocationInParent() { return this.location; } - + /** - * Returns the root node at or above this node; returns this node if + * Returns the root node at or above this node; returns this node if * it is a root. - * + * * @return the root node at or above this node - */ + */ public final ASTNode getRoot() { ASTNode candidate = this; while (true) { @@ -1627,7 +1627,7 @@ public abstract class ASTNode { candidate = p; } } - + /** * Returns the value of the given structural property for this node. The value * returned depends on the kind of property: @@ -1638,7 +1638,7 @@ public abstract class ASTNode { * or <code>null</code> if none</li> * <li>{@link ChildListPropertyDescriptor} - the list (element type: {@link ASTNode})</li> * </ul> - * + * * @param property the property * @return the value, or <code>null</code> if none * @exception RuntimeException if this node does not have the given property @@ -1665,7 +1665,7 @@ public abstract class ASTNode { } throw new IllegalArgumentException(); } - + /** * Sets the value of the given structural property for this node. The value * passed depends on the kind of property: @@ -1676,7 +1676,7 @@ public abstract class ASTNode { * or <code>null</code> if none</li> * <li>{@link ChildListPropertyDescriptor} - not allowed</li> * </ul> - * + * * @param property the property * @param value the property value * @exception RuntimeException if this node does not have the @@ -1722,57 +1722,57 @@ public abstract class ASTNode { * that this node does not have such a property. This method should be * extended in subclasses that have at leasy one simple property whose value * type is int. - * + * * @param property the property - * @param get <code>true</code> for a get operation, and + * @param get <code>true</code> for a get operation, and * <code>false</code> for a set operation * @param value the new property value; ignored for get operations * @return the value; always returns * <code>0</code> for set operations - * @exception RuntimeException if this node does not have the + * @exception RuntimeException if this node does not have the * given property, or if the given value cannot be set as specified * @since 3.0 */ int internalGetSetIntProperty(SimplePropertyDescriptor property, boolean get, int value) { throw new RuntimeException("Node does not have this property"); //$NON-NLS-1$ } - + /** * Sets the value of the given boolean-valued property for this node. * The default implementation of this method throws an exception explaining * that this node does not have such a property. This method should be * extended in subclasses that have at leasy one simple property whose value * type is boolean. - * + * * @param property the property - * @param get <code>true</code> for a get operation, and + * @param get <code>true</code> for a get operation, and * <code>false</code> for a set operation * @param value the new property value; ignored for get operations * @return the value; always returns * <code>false</code> for set operations - * @exception RuntimeException if this node does not have the + * @exception RuntimeException if this node does not have the * given property, or if the given value cannot be set as specified * @since 3.0 */ boolean internalGetSetBooleanProperty(SimplePropertyDescriptor property, boolean get, boolean value) { throw new RuntimeException("Node does not have this property"); //$NON-NLS-1$ } - + /** * Sets the value of the given property for this node. * The default implementation of this method throws an exception explaining * that this node does not have such a property. This method should be * extended in subclasses that have at leasy one simple property whose value * type is a reference type. - * + * * @param property the property - * @param get <code>true</code> for a get operation, and + * @param get <code>true</code> for a get operation, and * <code>false</code> for a set operation * @param value the new property value, or <code>null</code> if none; * ignored for get operations * @return the value, or <code>null</code> if none; always returns * <code>null</code> for set operations - * @exception RuntimeException if this node does not have the + * @exception RuntimeException if this node does not have the * given property, or if the given value cannot be set as specified * @since 3.0 */ @@ -1785,9 +1785,9 @@ public abstract class ASTNode { * The default implementation of this method throws an exception explaining * that this node does not have such a property. This method should be * extended in subclasses that have at leasy one child property. - * + * * @param property the property - * @param get <code>true</code> for a get operation, and + * @param get <code>true</code> for a get operation, and * <code>false</code> for a set operation * @param child the new child value, or <code>null</code> if none; * always <code>null</code> for get operations @@ -1800,13 +1800,13 @@ public abstract class ASTNode { ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) { throw new RuntimeException("Node does not have this property"); //$NON-NLS-1$ } - + /** * Returns the list value of the given property for this node. * The default implementation of this method throws an exception explaining * that this noed does not have such a property. This method should be * extended in subclasses that have at leasy one child list property. - * + * * @param property the property * @return the list (element type: {@link ASTNode}) * @exception RuntimeException if the given node does not have the @@ -1816,7 +1816,7 @@ public abstract class ASTNode { List internalGetChildListProperty(ChildListPropertyDescriptor property) { throw new RuntimeException("Node does not have this property"); //$NON-NLS-1$ } - + /** * Returns a list of structural property descriptors for nodes of the * same type as this node. Clients must not modify the result. @@ -1825,15 +1825,15 @@ public abstract class ASTNode { * for manipulating ASTNodes in a generic way. They are * unrelated to <code>get/setProperty</code>. * </p> - * - * @return a list of property descriptors (element type: + * + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public final List structuralPropertiesForType() { return internalStructuralPropertiesForType(this.ast.apiLevel); } - + /** * Returns a list of property descriptors for this node type. * Clients must not modify the result. This abstract method @@ -1843,18 +1843,18 @@ public abstract class ASTNode { * of this method in each of the concrete AST node types do not * clutter up the API doc. * </p> - * + * * @param apiLevel the API level; one of the <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ abstract List internalStructuralPropertiesForType(int apiLevel); - + /** * Internal helper method that starts the building a list of * property descriptors for the given node type. - * + * * @param nodeClass the class for a concrete node type * @param propertyList empty list */ @@ -1862,10 +1862,10 @@ public abstract class ASTNode { // stuff nodeClass at head of list for future ref propertyList.add(nodeClass); } - + /** * Internal helper method that adding a property descriptor. - * + * * @param property the structural property descriptor * @param propertyList list beginning with the AST node class * followed by accumulated structural property descriptors @@ -1878,11 +1878,11 @@ public abstract class ASTNode { } propertyList.add(property); } - + /** * Internal helper method that completes the building of * a node type's structural property descriptor list. - * + * * @param propertyList list beginning with the AST node class * followed by accumulated structural property descriptors * @return unmodifiable list of structural property descriptors @@ -1892,10 +1892,10 @@ public abstract class ASTNode { propertyList.remove(0); // remove nodeClass // compact ArrayList a = new ArrayList(propertyList.size()); - a.addAll(propertyList); + a.addAll(propertyList); return Collections.unmodifiableList(a); } - + /** * Checks that this AST operation is not used when * building JLS2 level ASTs. @@ -1930,32 +1930,32 @@ public abstract class ASTNode { * removing the node as a child of another node. This method calls * <code>ast.modifying()</code>. * </p> - * + * * @param parent the new parent of this node, or <code>null</code> if none - * @param property the location of this node in its parent, + * @param property the location of this node in its parent, * or <code>null</code> if <code>parent</code> is <code>null</code> * @see #getLocationInParent * @see #getParent * @since 3.0 - */ + */ final void setParent(ASTNode parent, StructuralPropertyDescriptor property) { this.ast.modifying(); this.parent = parent; this.location = property; } - + /** * Removes this node from its parent. Has no effect if this node * is unparented. If this node appears as an element of a child list * property of its parent, then this node is removed from the * list using <code>List.remove</code>. * If this node appears as the value of a child property of its - * parent, then this node is detached from its parent + * parent, then this node is detached from its parent * by passing <code>null</code> to the appropriate setter method; * this operation fails if this node is in a mandatory property. - * + * * @since 3.0 - */ + */ public final void delete() { StructuralPropertyDescriptor p = getLocationInParent(); if (p == null) { @@ -1973,16 +1973,16 @@ public abstract class ASTNode { } /** - * Checks whether the given new child node is a node + * Checks whether the given new child node is a node * in a different AST from its parent-to-be, whether it is * already has a parent, whether adding it to its * parent-to-be would create a cycle, and whether the child is of * the right type. The parent-to-be is the enclosing instance. - * + * * @param node the parent-to-be node * @param newChild the new child of the parent - * @param cycleCheck <code>true</code> if cycles are possible and need - * to be checked, <code>false</code> if cycles are impossible and do + * @param cycleCheck <code>true</code> if cycles are possible and need + * to be checked, <code>false</code> if cycles are impossible and do * not need to be checked * @param nodeType a type constraint on child nodes, or <code>null</code> * if no special check is required @@ -1994,13 +1994,13 @@ public abstract class ASTNode { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ static void checkNewChild(ASTNode node, ASTNode newChild, boolean cycleCheck, Class nodeType) { if (newChild.ast != node.ast) { // new child is from a different AST throw new IllegalArgumentException(); - } + } if (newChild.getParent() != null) { // new child currently has a different parent throw new IllegalArgumentException(); @@ -2043,7 +2043,7 @@ public abstract class ASTNode { * <p> * This method calls <code>ast.modifying()</code> for the nodes affected. * </p> - * + * * @param oldChild the old child of this node, or <code>null</code> if * there was no old child to replace * @param newChild the new child of this node, or <code>null</code> if @@ -2058,7 +2058,7 @@ public abstract class ASTNode { * <li>any of the nodes involved are unmodifiable</li> * </ul> * @since 3.0 - */ + */ final void preReplaceChild(ASTNode oldChild, ASTNode newChild, ChildPropertyDescriptor property) { if ((this.typeAndFlags & PROTECT) != 0) { // this node is protected => cannot gain or lose children @@ -2097,7 +2097,7 @@ public abstract class ASTNode { * See {@link #preReplaceChild(ASTNode, ASTNode, ChildPropertyDescriptor)} * for details. * @since 3.0 - */ + */ final void postReplaceChild(ASTNode oldChild, ASTNode newChild, ChildPropertyDescriptor property) { // link new child to parent if (newChild != null) { @@ -2110,7 +2110,7 @@ public abstract class ASTNode { this.ast.postRemoveChildEvent(this, oldChild, property); } } - + /** * Prelude portion of the "3 step program" for changing the * value of a simple property of this node. @@ -2129,14 +2129,14 @@ public abstract class ASTNode { * <p> * This method calls <code>ast.modifying()</code> for the node affected. * </p> - * - * @param property the property descriptor of this node + * + * @param property the property descriptor of this node * @exception RuntimeException if: * <ul> * <li>this node is unmodifiable</li> * </ul> * @since 3.0 - */ + */ final void preValueChange(SimplePropertyDescriptor property) { if ((this.typeAndFlags & PROTECT) != 0) { // this node is protected => cannot change valure of properties @@ -2151,11 +2151,11 @@ public abstract class ASTNode { * old child of this node with another node. * See {@link #preValueChange(SimplePropertyDescriptor)} for details. * @since 3.0 - */ + */ final void postValueChange(SimplePropertyDescriptor property) { this.ast.postValueChangeEvent(this, property); } - + /** * Ensures that this node is modifiable (that is, not marked PROTECTED). * If successful, calls ast.modifying(). @@ -2167,7 +2167,7 @@ public abstract class ASTNode { } this.ast.modifying(); } - + /** * Begin lazy initialization of this node. * Here is the code pattern found in all AST @@ -2192,10 +2192,10 @@ public abstract class ASTNode { this.ast.disableEvents(); // will turn events back on in postLasyInit } - + /** * End lazy initialization of this node. - * + * * @param newChild the new child of this node, or <code>null</code> if * there is no replacement child * @param property the property descriptor of this node describing @@ -2213,7 +2213,7 @@ public abstract class ASTNode { /** * Returns the named property of this node, or <code>null</code> if none. - * + * * @param propertyName the property name * @return the property value, or <code>null</code> if none * @see #setProperty(String,Object) @@ -2238,7 +2238,7 @@ public abstract class ASTNode { Map m = (Map) this.property1; return m.get(propertyName); } - + /** * Sets the named property of this node to the given value, * or to <code>null</code> to clear it. @@ -2248,12 +2248,12 @@ public abstract class ASTNode { * setting properties on the same node. * </p> * <p> - * Note that modifying a property is not considered a modification to the - * AST itself. This is to allow clients to decorate existing nodes with - * their own properties without jeopardizing certain things (like the + * Note that modifying a property is not considered a modification to the + * AST itself. This is to allow clients to decorate existing nodes with + * their own properties without jeopardizing certain things (like the * validity of bindings), which rely on the underlying tree remaining static. * </p> - * + * * @param propertyName the property name * @param data the new property value, or <code>null</code> if none * @see #getProperty(String) @@ -2301,7 +2301,7 @@ public abstract class ASTNode { this.property2 = null; return; } - + // node has two or more properties HashMap m = (HashMap) this.property1; if (data == null) { @@ -2322,9 +2322,9 @@ public abstract class ASTNode { } /** - * Returns an unmodifiable table of the properties of this node with + * Returns an unmodifiable table of the properties of this node with * non-<code>null</code> values. - * + * * @return the table of property values keyed by property name * (key type: <code>String</code>; value type: <code>Object</code>) */ @@ -2332,12 +2332,12 @@ public abstract class ASTNode { if (this.property1 == null) { // node has no properties at all return UNMODIFIABLE_EMPTY_MAP; - } + } if (this.property1 instanceof String) { // node has a single property return Collections.singletonMap(this.property1, this.property2); } - + // node has two or more properties if (this.property2 == null) { this.property2 = Collections.unmodifiableMap((Map) this.property1); @@ -2345,7 +2345,7 @@ public abstract class ASTNode { // property2 is unmodifiable wrapper for map in property1 return (Map) this.property2; } - + /** * Returns the flags associated with this node. * <p> @@ -2355,7 +2355,7 @@ public abstract class ASTNode { * The flags are the bitwise-or of individual flags. * The following flags are currently defined: * <ul> - * <li>{@link #MALFORMED} - indicates node is syntactically + * <li>{@link #MALFORMED} - indicates node is syntactically * malformed</li> * <li>{@link #ORIGINAL} - indicates original node * created by ASTParser</li> @@ -2366,21 +2366,21 @@ public abstract class ASTNode { * </ul> * Other bit positions are reserved for future use. * </p> - * + * * @return the bitwise-or of individual flags * @see #setFlags(int) */ public final int getFlags() { return this.typeAndFlags & 0xFFFF; } - + /** * Sets the flags associated with this node to the given value. * <p> * The flags are the bitwise-or of individual flags. * The following flags are currently defined: * <ul> - * <li>{@link #MALFORMED} - indicates node is syntactically + * <li>{@link #MALFORMED} - indicates node is syntactically * malformed</li> * <li>{@link #ORIGINAL} - indicates original node * created by ASTParser</li> @@ -2396,7 +2396,7 @@ public abstract class ASTNode { * property of the node, and can be changed even if the * node is marked as protected. * </p> - * + * * @param flags the bitwise-or of individual flags * @see #getFlags() */ @@ -2411,43 +2411,43 @@ public abstract class ASTNode { * The values are small positive integers, suitable for use in switch statements. * <p> * For each concrete node type there is a unique node type constant (name - * and value). The unique node type constant for a concrete node type such as + * and value). The unique node type constant for a concrete node type such as * <code>CastExpression</code> is <code>ASTNode.CAST_EXPRESSION</code>. * </p> - * + * * @return one of the node type constants */ public final int getNodeType() { return this.typeAndFlags >>> 16; } - + /** * Sets the integer value identifying the type of this concrete AST node. * The values are small positive integers, suitable for use in switch statements. - * + * * @param nodeType one of the node type constants */ private void setNodeType(int nodeType) { int old = this.typeAndFlags & 0xFFFF0000; this.typeAndFlags = old | (nodeType << 16); } - + /** * Returns an integer value identifying the type of this concrete AST node. * <p> * This internal method is implemented in each of the * concrete node subclasses. * </p> - * + * * @return one of the node type constants */ abstract int getNodeType0(); - + /** * The <code>ASTNode</code> implementation of this <code>Object</code> * method uses object identity (==). Use <code>subtreeMatch</code> to * compare two subtrees for equality. - * + * * @param obj {@inheritDoc} * @return {@inheritDoc} * @see #subtreeMatch(ASTMatcher matcher, Object other) @@ -2455,7 +2455,7 @@ public abstract class ASTNode { public final boolean equals(Object obj) { return this == obj; // equivalent to Object.equals } - + /* * (non-Javadoc) * This makes it consistent with the fact that a equals methods has been provided. @@ -2468,16 +2468,16 @@ public abstract class ASTNode { /** * Returns whether the subtree rooted at the given node matches the * given other object as decided by the given matcher. - * + * * @param matcher the matcher * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match */ public final boolean subtreeMatch(ASTMatcher matcher, Object other) { return subtreeMatch0(matcher, other); } - + /** * Returns whether the subtree rooted at the given node matches the * given other object as decided by the given matcher. @@ -2485,18 +2485,18 @@ public abstract class ASTNode { * This internal method is implemented in each of the * concrete node subclasses. * </p> - * + * * @param matcher the matcher * @param other the other object, or <code>null</code> - * @return <code>true</code> if the subtree matches, or + * @return <code>true</code> if the subtree matches, or * <code>false</code> if they do not match */ abstract boolean subtreeMatch0(ASTMatcher matcher, Object other); - + /** * Returns a deep copy of the subtree of AST nodes rooted at the * given node. The resulting nodes are owned by the given AST, - * which may be different from the ASTs of the given node. + * which may be different from the ASTs of the given node. * Even if the given node has a parent, the result node will be unparented. * <p> * Source range information on the original nodes is automatically copied to the new @@ -2506,7 +2506,7 @@ public abstract class ASTNode { * The node's <code>AST</code> and the target <code>AST</code> must support * the same API level. * </p> - * + * * @param target the AST that is to own the nodes in the result * @param node the node to copy, or <code>null</code> if none * @return the copied node, or <code>null</code> if <code>node</code> @@ -2529,14 +2529,14 @@ public abstract class ASTNode { /** * Returns a deep copy of the subtrees of AST nodes rooted at the * given list of nodes. The resulting nodes are owned by the given AST, - * which may be different from the ASTs of the nodes in the list. + * which may be different from the ASTs of the nodes in the list. * Even if the nodes in the list have parents, the nodes in the result * will be unparented. * <p> * Source range information on the original nodes is automatically copied to the new * nodes. Client properties (<code>properties</code>) are not carried over. * </p> - * + * * @param target the AST that is to own the nodes in the result * @param nodes the list of nodes to copy * (element type: <code>ASTNode</code>) @@ -2556,13 +2556,13 @@ public abstract class ASTNode { /** * Returns a deep copy of the subtree of AST nodes rooted at this node. * The resulting nodes are owned by the given AST, which may be different - * from the AST of this node. Even if this node has a parent, the + * from the AST of this node. Even if this node has a parent, the * result node will be unparented. * <p> * This method reports pre- and post-clone events, and dispatches * to <code>clone0(AST)</code> which is reimplemented in node subclasses. * </p> - * + * * @param target the AST that is to own the nodes in the result * @return the root node of the copies subtree */ @@ -2576,7 +2576,7 @@ public abstract class ASTNode { /** * Returns a deep copy of the subtree of AST nodes rooted at this node. * The resulting nodes are owned by the given AST, which may be different - * from the AST of this node. Even if this node has a parent, the + * from the AST of this node. Even if this node has a parent, the * result node will be unparented. * <p> * This method must be implemented in subclasses. @@ -2589,17 +2589,17 @@ public abstract class ASTNode { * <p> * N.B. This method is package-private, so that the implementations * of this method in each of the concrete AST node types do not - * clutter up the API doc. + * clutter up the API doc. * </p> - * + * * @param target the AST that is to own the nodes in the result * @return the root node of the copies subtree */ abstract ASTNode clone0(AST target); - + /** * Accepts the given visitor on a visit of the current node. - * + * * @param visitor the visitor object * @exception IllegalArgumentException if the visitor is null */ @@ -2636,7 +2636,7 @@ public abstract class ASTNode { * Note that the caller (<code>accept</code>) take cares of invoking * <code>visitor.preVisit(this)</code> and <code>visitor.postVisit(this)</code>. * </p> - * + * * @param visitor the visitor object */ abstract void accept0(ASTVisitor visitor); @@ -2649,7 +2649,7 @@ public abstract class ASTNode { * to <code>child.accept(visitor)</code> if <code>child</code> * is not <code>null</code>. * </p> - * + * * @param visitor the visitor object * @param child the child AST node to dispatch too, or <code>null</code> * if none @@ -2663,13 +2663,13 @@ public abstract class ASTNode { /** * Accepts the given visitor on a visit of the given live list of - * child nodes. + * child nodes. * <p> * This method must be used by the concrete implementations of * <code>accept</code> to traverse list-values properties; it * encapsulates the proper handling of on-the-fly changes to the list. * </p> - * + * * @param visitor the visitor object * @param children the child AST node to dispatch too, or <code>null</code> * if none @@ -2698,7 +2698,7 @@ public abstract class ASTNode { * See {@link ASTParser#setKind(int)} for details * on precisely where source ranges begin and end. * </p> - * + * * @return the 0-based character index, or <code>-1</code> * if no source position information is recorded for this node * @see #getLength() @@ -2716,7 +2716,7 @@ public abstract class ASTNode { * See {@link ASTParser#setKind(int)} methods for details * on precisely where source ranges begin and end. * </p> - * + * * @return a (possibly 0) length, or <code>0</code> * if no source position information is recorded for this node * @see #getStartPosition() @@ -2733,12 +2733,12 @@ public abstract class ASTNode { * See {@link ASTParser#setKind(int)} for details * on precisely where source ranges are supposed to begin and end. * </p> - * - * @param startPosition a 0-based character index, - * or <code>-1</code> if no source position information is + * + * @param startPosition a 0-based character index, + * or <code>-1</code> if no source position information is * available for this node - * @param length a (possibly 0) length, - * or <code>0</code> if no source position information is recorded + * @param length a (possibly 0) length, + * or <code>0</code> if no source position information is recorded * for this node * @see #getStartPosition() * @see #getLength() @@ -2757,12 +2757,12 @@ public abstract class ASTNode { this.startPosition = startPosition; this.length = length; } - + /** * Returns a string representation of this node suitable for debugging * purposes only. - * - * @return a debug string + * + * @return a debug string */ public final String toString() { StringBuffer buffer = new StringBuffer(); @@ -2778,35 +2778,35 @@ public abstract class ASTNode { } return buffer.toString(); } - + /** * Returns the string representation of this node produced by the standard * <code>Object.toString</code> method. - * - * @return a debug string + * + * @return a debug string */ final String standardToString() { return super.toString(); } - + /** * Appends a debug representation of this node to the given string buffer. * <p> - * The <code>ASTNode</code> implementation of this method prints out the entire + * The <code>ASTNode</code> implementation of this method prints out the entire * subtree. Subclasses may override to provide a more succinct representation. * </p> - * + * * @param buffer the string buffer to append to */ void appendDebugString(StringBuffer buffer) { // print the subtree by default appendPrintString(buffer); } - + /** * Appends a standard Java source code representation of this subtree to the given * string buffer. - * + * * @param buffer the string buffer to append to */ final void appendPrintString(StringBuffer buffer) { @@ -2814,23 +2814,23 @@ public abstract class ASTNode { accept(printer); buffer.append(printer.getResult()); } - + /** * Estimate of size of an object header in bytes. */ static final int HEADERS = 12; - + /** - * Approximate base size of an AST node instance in bytes, + * Approximate base size of an AST node instance in bytes, * including object header and instance fields. * That is, HEADERS + (# instance vars in ASTNode)*4. */ static final int BASE_NODE_SIZE = HEADERS + 7 * 4; - + /** * Returns an estimate of the memory footprint, in bytes, * of the given string. - * + * * @param string the string to measure, or <code>null</code> * @return the size of this string object in bytes, or * 0 if the string is <code>null</code> @@ -2846,26 +2846,26 @@ public abstract class ASTNode { } return size; } - + /** - * Returns an estimate of the memory footprint in bytes of the entire + * Returns an estimate of the memory footprint in bytes of the entire * subtree rooted at this node. - * + * * @return the size of this subtree in bytes */ public final int subtreeBytes() { return treeSize(); } - + /** - * Returns an estimate of the memory footprint in bytes of the entire + * Returns an estimate of the memory footprint in bytes of the entire * subtree rooted at this node. * <p> * N.B. This method is package-private, so that the implementations * of this method in each of the concrete AST node types do not * clutter up the API doc. * </p> - * + * * @return the size of this subtree in bytes */ abstract int treeSize(); @@ -2873,7 +2873,7 @@ public abstract class ASTNode { /** * Returns an estimate of the memory footprint of this node in bytes. * The estimate does not include the space occupied by child nodes. - * + * * @return the size of this node in bytes */ abstract int memSize(); diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTParser.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTParser.java index 06664eb1e..d68178a15 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTParser.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTParser.java @@ -144,7 +144,7 @@ public class ASTParser { * Compiler options. Defaults to JavaCore.getOptions(). */ private Map compilerOptions; - + /** * The focal point for a partial AST request. * Only used when <code>partial</code> is <code>true</code>. @@ -191,7 +191,7 @@ public class ASTParser { * <code>null</code> if none. Defaults to none. */ private String unitName = null; - + /** * Classpath entries to use to resolve bindings when no java project are available. */ @@ -201,12 +201,12 @@ public class ASTParser { * Sourcepath entries to use to resolve bindings when no java project are available. */ private String[] sourcepaths; - + /** * Encoding of the given sourcepaths entries. */ private String[] sourcepathsEncodings; - + /** * Bits used to set the different values from CompilationUnitResolver values. */ @@ -304,19 +304,19 @@ public class ASTParser { this.bits &= ~CompilationUnitResolver.BINDING_RECOVERY; } } - + /** * Sets the environment to be used when no {@link IJavaProject} is available. - * - * <p>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 <code>classpathEntries</code> whereas all paths containing + * + * <p>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 <code>classpathEntries</code> whereas all paths containing * source types must be included in the <code>sourcepathEntries</code>.</p> * <p>All paths in the <code>classpathEntries</code> and <code>sourcepathEntries</code> are absolute paths.</p> * <p>If the source paths contain units using a specific encoding (other than the platform encoding), then the * given <code>encodings</code> must be set. When the <code>encodings</code> is set to non <code>null</code>, its length must * match the length of <code>sourcepathEntries</code> or an IllegalArgumentException will be thrown.</p> * <p>If <code>encodings</code> is not <code>null</code>, the given <code>sourcepathEntries</code> must not be <code>null</code>.</p> - * + * * @param classpathEntries the given classpath entries to be used to resolve bindings * @param sourcepathEntries the given sourcepath entries to be used to resolve bindings * @param encodings the encodings of the corresponding sourcepath entries or <code>null</code> if the platform encoding @@ -333,7 +333,7 @@ public class ASTParser { this.sourcepathsEncodings = encodings; if (encodings != null) { if (sourcepathEntries == null || sourcepathEntries.length != encodings.length) { - throw new IllegalArgumentException(); + throw new IllegalArgumentException(); } } this.bits |= CompilationUnitResolver.INCLUDE_RUNNING_VM_BOOTCLASSPATH; @@ -416,7 +416,7 @@ public class ASTParser { * or {@link #setSource(IClassFile) setSource(IClassFile)}. * When source is supplied by {@link #setSource(char[]) setSource(char[])}, * the location must be established explicitly by setting an environment using - * {@link #setProject(IJavaProject)} or {@link #setEnvironment(String[], String[], String[], boolean)} + * {@link #setProject(IJavaProject)} or {@link #setEnvironment(String[], String[], String[], boolean)} * and a unit name {@link #setUnitName(String)}. * Note that the compiler options that affect doc comment checking may also * affect whether any bindings are resolved for nodes within doc comments. @@ -437,7 +437,7 @@ public class ASTParser { * Requests an abridged abstract syntax tree. * By default, complete ASTs are returned. * <p> - * When the given <code>position</code> is a valid position within the source code of + * When the given <code>position</code> is a valid position within the source code of * the compilation unit, 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 @@ -468,9 +468,9 @@ public class ASTParser { * compilation unit. * </p> * - * <p>This focal position is not used when the AST is built using + * <p>This focal position is not used when the AST is built using * {@link #createASTs(ICompilationUnit[], String[], ASTRequestor, IProgressMonitor)}.</p> - * + * * @param position a position into the corresponding body declaration */ public void setFocalPosition(int position) { @@ -543,10 +543,10 @@ public class ASTParser { * Binding information is only computed when <code>kind</code> is * {@link #K_COMPILATION_UNIT}. * </p> - * + * * <p>This kind is not used when the AST is built using * {@link #createASTs(ICompilationUnit[], String[], ASTRequestor, IProgressMonitor)}.</p> - * + * * @param kind the kind of construct to parse: one of * {@link #K_COMPILATION_UNIT}, * {@link #K_CLASS_BODY_DECLARATIONS}, @@ -566,7 +566,7 @@ public class ASTParser { /** * Sets the source code to be parsed. * - * <p>This source is not used when the AST is built using + * <p>This source is not used when the AST is built using * {@link #createASTs(ICompilationUnit[], String[], ASTRequestor, IProgressMonitor)}.</p> * * <p>If this method is used, the user needs to specify compiler options explicitly using @@ -587,14 +587,14 @@ public class ASTParser { /** * Sets the source code to be parsed. - * + * * <p>This method automatically sets the project (and compiler * options) based on the given compilation unit, in a manner * equivalent to {@link #setProject(IJavaProject) setProject(source.getJavaProject())}.</p> * - * <p>This source is not used when the AST is built using + * <p>This source is not used when the AST is built using * {@link #createASTs(ICompilationUnit[], String[], ASTRequestor, IProgressMonitor)}.</p> - * + * * @param source the Java model compilation unit whose source code * is to be parsed, or <code>null</code> if none */ @@ -611,9 +611,9 @@ public class ASTParser { * <p>If the given class file has no source attachment, the creation of the * ast will fail with an {@link IllegalStateException}.</p> * - * <p>This source is not used when the AST is built using + * <p>This source is not used when the AST is built using * {@link #createASTs(ICompilationUnit[], String[], ASTRequestor, IProgressMonitor)}.</p> - * + * * @param source the Java model class file whose corresponding source code * is to be parsed, or <code>null</code> if none */ @@ -630,7 +630,7 @@ public class ASTParser { * <p>If the source is a class file without source attachment, the creation of the * ast will fail with an {@link IllegalStateException}.</p> * - * <p>This source is not used when the AST is built using + * <p>This source is not used when the AST is built using * {@link #createASTs(ICompilationUnit[], String[], ASTRequestor, IProgressMonitor)}.</p> * * @param source the Java model compilation unit or class file whose corresponding source code @@ -654,7 +654,7 @@ public class ASTParser { * By default, the entire source string will be parsed * (<code>offset</code> 0 and <code>length</code> -1). * - * <p>This range is not used when the AST is built using + * <p>This range is not used when the AST is built using * {@link #createASTs(ICompilationUnit[], String[], ASTRequestor, IProgressMonitor)}.</p> * * @param offset the index of the first character to parse @@ -689,14 +689,14 @@ public class ASTParser { this.bits &= ~CompilationUnitResolver.STATEMENT_RECOVERY; } } - + /** - * Requests an abstract syntax tree without method bodies. - * + * Requests an abstract syntax tree without method bodies. + * * <p>When ignore method bodies is enabled, all method bodies are discarded. * This has no impact on the binding resolution.</p> * - * <p>This setting is not used when the kind used in {@link #setKind(int)} is either + * <p>This setting is not used when the kind used in {@link #setKind(int)} is either * {@link #K_EXPRESSION} or {@link #K_STATEMENTS}.</p> * @since 3.5.2 */ @@ -726,7 +726,7 @@ public class ASTParser { /** * Sets the name of the compilation unit that would hypothetically contains the * source string. - * + * * <p>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 (<code>null</code>).</p> @@ -742,7 +742,7 @@ public class ASTParser { * 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".</p> * - * <p>This unit name is not used when the AST is built using + * <p>This unit name is not used when the AST is built using * {@link #createASTs(ICompilationUnit[], String[], ASTRequestor, IProgressMonitor)}.</p> * * @param unitName the name of the compilation unit that would contain the source @@ -754,7 +754,7 @@ public class ASTParser { /** * Sets the Java project used when resolving bindings. - * + * * <p>This method automatically sets the compiler * options based on the given project:</p> * <pre> @@ -995,7 +995,7 @@ public class ASTParser { } /** * Creates bindings for a batch of Java elements. - * + * * <p>These elements are either * enclosed in {@link ICompilationUnit ICompilationUnits} or in {@link IClassFile IClassFiles}.</p> * <p> @@ -1148,7 +1148,7 @@ public class ASTParser { throw new IllegalStateException(String.valueOf(stringWriter.getBuffer())); } } else if (this.rawSource != null) { - needToResolveBindings = + needToResolveBindings = ((this.bits & CompilationUnitResolver.RESOLVE_BINDING) != 0) && this.unitName != null && (this.project != null @@ -1339,7 +1339,7 @@ public class ASTParser { converter.scanner = new RecoveryScanner(scanner, data.removeUnused()); converter.docParser.scanner = converter.scanner; converter.scanner.setSource(scanner.source); - + compilationUnit.setStatementsRecoveryData(data); } RecordedParsingInformation recordedParsingInformation = codeSnippetParsingUtil.recordedParsingInformation; diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTRecoveryPropagator.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTRecoveryPropagator.java index 641356c05..28371d695 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTRecoveryPropagator.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTRecoveryPropagator.java @@ -74,20 +74,20 @@ class ASTRecoveryPropagator extends DefaultASTVisitor { private CategorizedProblem[] problems; private boolean[] usedOrIrrelevantProblems; - + private RecoveryScannerData data; private int blockDepth = 0; private int lastEnd; - + private int[] insertedTokensKind; private int[] insertedTokensPosition; private boolean[] insertedTokensFlagged; - + private boolean[] removedTokensFlagged; private boolean[] replacedTokensFlagged; - + private Vector stack = new Vector(); - + /** * @noreference This method is not intended to be referenced by clients. */ @@ -95,11 +95,11 @@ class ASTRecoveryPropagator extends DefaultASTVisitor { // visit Javadoc.tags() as well this.problems = problems; this.usedOrIrrelevantProblems = new boolean[problems.length]; - + this.data = data; - + if(this.data != null) { - + int length = 0; for (int i = 0; i < data.insertedTokensPtr + 1; i++) { length += data.insertedTokens[i].length; @@ -115,7 +115,7 @@ class ASTRecoveryPropagator extends DefaultASTVisitor { tokenCount++; } } - + if(data.removedTokensPtr != -1) { this.removedTokensFlagged = new boolean[data.removedTokensPtr + 1]; } @@ -133,21 +133,21 @@ class ASTRecoveryPropagator extends DefaultASTVisitor { super.endVisit(node); } - + public boolean visit(Block node) { boolean visitChildren = super.visit(node); this.blockDepth++; return visitChildren; } - + protected boolean visitNode(ASTNode node) { if(this.blockDepth > 0) { int start = node.getStartPosition(); int end = start + node.getLength() - 1; - + // continue to visit the node only if it contains tokens modifications - + if(this.insertedTokensFlagged != null) { for (int i = 0; i < this.insertedTokensFlagged.length; i++) { if(this.insertedTokensPosition[i] >= start && @@ -156,7 +156,7 @@ class ASTRecoveryPropagator extends DefaultASTVisitor { } } } - + if(this.removedTokensFlagged != null) { for (int i = 0; i <= this.data.removedTokensPtr; i++) { if(this.data.removedTokensStart[i] >= start && @@ -165,7 +165,7 @@ class ASTRecoveryPropagator extends DefaultASTVisitor { } } } - + if(this.replacedTokensFlagged != null) { for (int i = 0; i <= this.data.replacedTokensPtr; i++) { if(this.data.replacedTokensStart[i] >= start && @@ -174,7 +174,7 @@ class ASTRecoveryPropagator extends DefaultASTVisitor { } } } - + return false; } return true; @@ -183,7 +183,7 @@ class ASTRecoveryPropagator extends DefaultASTVisitor { protected void endVisitNode(ASTNode node) { int start = node.getStartPosition(); int end = start + node.getLength() - 1; - + // is inside diet part of the ast if(this.blockDepth < 1) { switch (node.getNodeType()) { @@ -205,9 +205,9 @@ class ASTRecoveryPropagator extends DefaultASTVisitor { } break; } - } else { + } else { markIncludedProblems(start, end); - + if(this.insertedTokensFlagged != null) { if(this.lastEnd != end) { flagNodeWithInsertedTokens(); @@ -225,7 +225,7 @@ class ASTRecoveryPropagator extends DefaultASTVisitor { } } } - + if(this.replacedTokensFlagged != null) { for (int i = 0; i <= this.data.replacedTokensPtr; i++) { if(!this.replacedTokensFlagged[i] && @@ -239,7 +239,7 @@ class ASTRecoveryPropagator extends DefaultASTVisitor { } this.lastEnd = end; } - + private void flagNodeWithInsertedTokens() { if(this.insertedTokensKind != null && this.insertedTokensKind.length > 0) { int s = this.stack.size(); @@ -252,13 +252,13 @@ class ASTRecoveryPropagator extends DefaultASTVisitor { this.stack = new Vector(); } } - + private boolean flagNodesWithInsertedTokensAtEnd(ASTNode node) { int[] expectedEndingToken = this.endingTokens.get(node.getClass()); if (expectedEndingToken != null) { int start = node.getStartPosition(); int end = start + node.getLength() - 1; - + boolean flagParent = false; done : for (int i = this.insertedTokensKind.length - 1; i > -1 ; i--) { if(!this.insertedTokensFlagged[i] && @@ -273,7 +273,7 @@ class ASTRecoveryPropagator extends DefaultASTVisitor { flagParent = true; } } - + if(flagParent) { ASTNode parent = node.getParent(); while (parent != null) { @@ -288,7 +288,7 @@ class ASTRecoveryPropagator extends DefaultASTVisitor { } return true; } - + private boolean flagNodesWithInsertedTokensInside(ASTNode node) { int start = node.getStartPosition(); int end = start + node.getLength() - 1; @@ -302,14 +302,14 @@ class ASTRecoveryPropagator extends DefaultASTVisitor { } return true; } - + private boolean markIncludedProblems(int start, int end) { boolean foundProblems = false; next: for (int i = 0, max = this.problems.length; i < max; i++) { CategorizedProblem problem = this.problems[i]; - + if(this.usedOrIrrelevantProblems[i]) continue next; - + switch(problem.getID()) { case IProblem.ParsingErrorOnKeywordNoSuggestion : case IProblem.ParsingErrorOnKeyword : @@ -344,9 +344,9 @@ class ASTRecoveryPropagator extends DefaultASTVisitor { default: this.usedOrIrrelevantProblems[i] = true; continue next; - + } - + int problemStart = problem.getSourceStart(); int problemEnd = problem.getSourceEnd(); if ((start <= problemStart) && (problemStart <= end) || @@ -360,7 +360,7 @@ class ASTRecoveryPropagator extends DefaultASTVisitor { public void endVisit(ExpressionStatement node) { endVisitNode(node); - if ((node.getFlags() & ASTNode.RECOVERED) == 0) return; + if ((node.getFlags() & ASTNode.RECOVERED) == 0) return; Expression expression = node.getExpression(); if (expression.getNodeType() == ASTNode.ASSIGNMENT) { Assignment assignment = (Assignment) expression; @@ -377,7 +377,7 @@ class ASTRecoveryPropagator extends DefaultASTVisitor { } } } - + public void endVisit(ForStatement node) { endVisitNode(node); List initializers = node.initializers(); @@ -415,7 +415,7 @@ class ASTRecoveryPropagator extends DefaultASTVisitor { } } } - + public void endVisit(NormalAnnotation node) { endVisitNode(node); // is inside diet part of the ast @@ -424,7 +424,7 @@ class ASTRecoveryPropagator extends DefaultASTVisitor { int size = values.size(); if (size > 0) { MemberValuePair lastMemberValuePair = (MemberValuePair)values.get(size - 1); - + int annotationEnd = node.getStartPosition() + node.getLength(); int lastMemberValuePairEnd = lastMemberValuePair.getStartPosition() + lastMemberValuePair.getLength(); if (annotationEnd == lastMemberValuePairEnd) { @@ -433,7 +433,7 @@ class ASTRecoveryPropagator extends DefaultASTVisitor { } } } - + public void endVisit(SingleMemberAnnotation node) { endVisitNode(node); // is inside diet part of the ast diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTSyntaxErrorPropagator.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTSyntaxErrorPropagator.java index 437d9c197..f64da38bf 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTSyntaxErrorPropagator.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTSyntaxErrorPropagator.java @@ -20,7 +20,7 @@ import org.eclipse.jdt.core.compiler.IProblem; class ASTSyntaxErrorPropagator extends ASTVisitor { private CategorizedProblem[] problems; - + ASTSyntaxErrorPropagator(CategorizedProblem[] problems) { // visit Javadoc.tags() as well super(true); @@ -86,63 +86,63 @@ class ASTSyntaxErrorPropagator extends ASTVisitor { * Method declared on ASTVisitor. */ public boolean visit(FieldDeclaration node) { - return checkAndTagAsMalformed(node); + return checkAndTagAsMalformed(node); } /* * Method declared on ASTVisitor. */ public boolean visit(MethodDeclaration node) { - return checkAndTagAsMalformed(node); + return checkAndTagAsMalformed(node); } /* * Method declared on ASTVisitor. */ public boolean visit(PackageDeclaration node) { - return checkAndTagAsMalformed(node); + return checkAndTagAsMalformed(node); } /* * Method declared on ASTVisitor. */ public boolean visit(ImportDeclaration node) { - return checkAndTagAsMalformed(node); + return checkAndTagAsMalformed(node); } /* * Method declared on ASTVisitor. */ public boolean visit(CompilationUnit node) { - return checkAndTagAsMalformed(node); + return checkAndTagAsMalformed(node); } /* * Method declared on ASTVisitor. */ public boolean visit(AnnotationTypeDeclaration node) { - return checkAndTagAsMalformed(node); + return checkAndTagAsMalformed(node); } - + /* * Method declared on ASTVisitor. */ public boolean visit(EnumDeclaration node) { - return checkAndTagAsMalformed(node); + return checkAndTagAsMalformed(node); } - + /* * Method declared on ASTVisitor. */ public boolean visit(TypeDeclaration node) { - return checkAndTagAsMalformed(node); + return checkAndTagAsMalformed(node); } - + /* * Method declared on ASTVisitor. */ public boolean visit(Initializer node) { - return checkAndTagAsMalformed(node); + return checkAndTagAsMalformed(node); } } diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTVisitor.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTVisitor.java index 39ed372fb..149f1cc35 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTVisitor.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTVisitor.java @@ -23,9 +23,9 @@ package org.eclipse.jdt.core.dom; * <li><code>public boolean visit(<i>T</i> node)</code> - Visits * the given node to perform some arbitrary operation. If <code>true</code> * is returned, the given node's child nodes will be visited next; however, - * if <code>false</code> is returned, the given node's child nodes will + * if <code>false</code> is returned, the given node's child nodes will * not be visited. The default implementation provided by this class does - * nothing and returns <code>true</code> (with the exception of + * nothing and returns <code>true</code> (with the exception of * {@link #visit(Javadoc) ASTVisitor.visit(Javadoc)}). * Subclasses may reimplement this method as needed.</li> * <li><code>public void endVisit(<i>T</i> node)</code> - Visits @@ -36,17 +36,17 @@ package org.eclipse.jdt.core.dom; * nothing. Subclasses may reimplement this method as needed.</li> * </ul> * </p> - * In addition, there are a pair of methods for visiting AST nodes in the + * In addition, there are a pair of methods for visiting AST nodes in the * abstract, regardless of node type: * <ul> * <li><code>public void preVisit(ASTNode node)</code> - Visits - * the given node to perform some arbitrary operation. + * the given node to perform some arbitrary operation. * This method is invoked prior to the appropriate type-specific * <code>visit</code> method. * The default implementation of this method does nothing. * Subclasses may reimplement this method as needed.</li> * <li><code>public void postVisit(ASTNode node)</code> - Visits - * the given node to perform some arbitrary operation. + * the given node to perform some arbitrary operation. * This method is invoked after the appropriate type-specific * <code>endVisit</code> method. * The default implementation of this method does nothing. @@ -57,7 +57,7 @@ package org.eclipse.jdt.core.dom; * are visited in order. For nodes with multiple properties, the child nodes * are visited in the order that most closely corresponds to the lexical * reading order of the source program. For instance, for a type declaration - * node, the child ordering is: name, superclass, superinterfaces, and + * node, the child ordering is: name, superclass, superinterfaces, and * body declarations. * </p> * <p> @@ -65,8 +65,8 @@ package org.eclipse.jdt.core.dom; * ensure that the consequences are as expected and desirable. * During the course of an ordinary visit starting at a given node, every node * in the subtree is visited exactly twice, first with <code>visit</code> and - * then with <code>endVisit</code>. During a traversal of a stationary tree, - * each node is either behind (after <code>endVisit</code>), ahead (before + * then with <code>endVisit</code>. During a traversal of a stationary tree, + * each node is either behind (after <code>endVisit</code>), ahead (before * <code>visit</code>), or in progress (between <code>visit</code> and * the matching <code>endVisit</code>). Changes to the "behind" region of the * tree are of no consequence to the visit in progress. Changes to the "ahead" @@ -77,7 +77,7 @@ package org.eclipse.jdt.core.dom; * is between the elements, rather than on an element). The cursor moves from * the head to the tail of this list, advancing to the next position just * <i>before</i> <code>visit</code> if called for that child. After the child - * subtree has been completely visited, the visit moves on the child + * subtree has been completely visited, the visit moves on the child * immediately after the cursor. Removing a child while it is being visited * does not alter the course of the visit. But any children added at positions * after the cursor are considered in the "ahead" portion and will be visited. @@ -88,20 +88,20 @@ package org.eclipse.jdt.core.dom; * <li>Moving a child node further down the list. This could result in the * child subtree being visited multiple times; these visits are sequential.</li> * <li>Moving a child node up into an ancestor. If the new home for - * the node is in the "ahead" portion, the subtree will be visited + * the node is in the "ahead" portion, the subtree will be visited * a second time; again, these visits are sequential.</li> * <li>Moving a node down into a child. If the new home for - * the node is in the "ahead" portion, the subtree will be visited + * the node is in the "ahead" portion, the subtree will be visited * a second time; in this case, the visits will be nested. In some cases, * this can lead to a stack overflow or out of memory condition.</li> * </ul> * <p>Note that {@link LineComment} and {@link BlockComment} nodes are * not normally visited in an AST because they are not considered - * part of main structure of the AST. Use + * part of main structure of the AST. Use * {@link CompilationUnit#getCommentList()} to find these additional * comments nodes. * </p> - * + * * @see org.eclipse.jdt.core.dom.ASTNode#accept(ASTVisitor) */ public abstract class ASTVisitor { @@ -111,12 +111,12 @@ public abstract class ASTVisitor { * @since 3.0 */ private boolean visitDocTags; - + /** * Creates a new AST visitor instance. * <p> * For backwards compatibility, the visitor does not visit tag - * elements below doc comments by default. Use + * elements below doc comments by default. Use * {@link #ASTVisitor(boolean) ASTVisitor(true)} * for an visitor that includes doc comments by default. * </p> @@ -124,10 +124,10 @@ public abstract class ASTVisitor { public ASTVisitor() { this(false); } - + /** - * Creates a new AST visitor instance. - * + * Creates a new AST visitor instance. + * * @param visitDocTags <code>true</code> if doc comment tags are * to be visited by default, and <code>false</code> otherwise * @see Javadoc#tags() @@ -137,14 +137,14 @@ public abstract class ASTVisitor { public ASTVisitor(boolean visitDocTags) { this.visitDocTags = visitDocTags; } - + /** * Visits the given AST node prior to the type-specific visit * (before <code>visit</code>). * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit * * @see #preVisit2(ASTNode) @@ -152,7 +152,7 @@ public abstract class ASTVisitor { public void preVisit(ASTNode node) { // default implementation: do nothing } - + /** * Visits the given AST node prior to the type-specific visit (before <code>visit</code>). * <p> @@ -177,7 +177,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void postVisit(ASTNode node) { @@ -191,7 +191,7 @@ public abstract class ASTVisitor { * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -209,7 +209,7 @@ public abstract class ASTVisitor { * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -226,7 +226,7 @@ public abstract class ASTVisitor { * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -242,7 +242,7 @@ public abstract class ASTVisitor { * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -258,7 +258,7 @@ public abstract class ASTVisitor { * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -274,7 +274,7 @@ public abstract class ASTVisitor { * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -290,7 +290,7 @@ public abstract class ASTVisitor { * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -306,7 +306,7 @@ public abstract class ASTVisitor { * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -322,7 +322,7 @@ public abstract class ASTVisitor { * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -338,7 +338,7 @@ public abstract class ASTVisitor { * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -347,7 +347,7 @@ public abstract class ASTVisitor { public boolean visit(Block node) { return true; } - + /** * Visits the given type-specific AST node. @@ -360,7 +360,7 @@ public abstract class ASTVisitor { * only be called if a client goes out of their way to visit this * kind of node explicitly. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -377,7 +377,7 @@ public abstract class ASTVisitor { * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -393,7 +393,7 @@ public abstract class ASTVisitor { * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -409,7 +409,7 @@ public abstract class ASTVisitor { * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -425,7 +425,7 @@ public abstract class ASTVisitor { * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -441,7 +441,7 @@ public abstract class ASTVisitor { * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -457,7 +457,7 @@ public abstract class ASTVisitor { * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -473,7 +473,7 @@ public abstract class ASTVisitor { * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -489,7 +489,7 @@ public abstract class ASTVisitor { * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -505,7 +505,7 @@ public abstract class ASTVisitor { * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -521,7 +521,7 @@ public abstract class ASTVisitor { * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -537,7 +537,7 @@ public abstract class ASTVisitor { * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -553,7 +553,7 @@ public abstract class ASTVisitor { * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -569,7 +569,7 @@ public abstract class ASTVisitor { * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -586,7 +586,7 @@ public abstract class ASTVisitor { * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -603,7 +603,7 @@ public abstract class ASTVisitor { * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -620,7 +620,7 @@ public abstract class ASTVisitor { * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -636,7 +636,7 @@ public abstract class ASTVisitor { * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -652,7 +652,7 @@ public abstract class ASTVisitor { * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -668,7 +668,7 @@ public abstract class ASTVisitor { * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -684,7 +684,7 @@ public abstract class ASTVisitor { * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -700,7 +700,7 @@ public abstract class ASTVisitor { * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -716,7 +716,7 @@ public abstract class ASTVisitor { * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -732,7 +732,7 @@ public abstract class ASTVisitor { * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -748,7 +748,7 @@ public abstract class ASTVisitor { * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -763,11 +763,11 @@ public abstract class ASTVisitor { * <p> * Unlike other node types, the boolean returned by the default * implementation is controlled by a constructor-supplied - * parameter {@link #ASTVisitor(boolean) ASTVisitor(boolean)} + * parameter {@link #ASTVisitor(boolean) ASTVisitor(boolean)} * which is <code>false</code> by default. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -779,14 +779,14 @@ public abstract class ASTVisitor { // visit tag elements inside doc comments only if requested return this.visitDocTags; } - + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -795,8 +795,8 @@ public abstract class ASTVisitor { public boolean visit(LabeledStatement node) { return true; } - - + + /** * Visits the given type-specific AST node. * <p> @@ -808,7 +808,7 @@ public abstract class ASTVisitor { * only be called if a client goes out of their way to visit this * kind of node explicitly. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -819,14 +819,14 @@ public abstract class ASTVisitor { return true; } - + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -837,14 +837,14 @@ public abstract class ASTVisitor { return true; } - + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -855,14 +855,14 @@ public abstract class ASTVisitor { return true; } - + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -873,14 +873,14 @@ public abstract class ASTVisitor { return true; } - + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -891,14 +891,14 @@ public abstract class ASTVisitor { return true; } - + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -908,15 +908,15 @@ public abstract class ASTVisitor { public boolean visit(MethodRefParameter node) { return true; } - - + + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -925,14 +925,14 @@ public abstract class ASTVisitor { public boolean visit(MethodDeclaration node) { return true; } - + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -942,14 +942,14 @@ public abstract class ASTVisitor { return true; } - + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -960,14 +960,14 @@ public abstract class ASTVisitor { return true; } - + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -977,14 +977,14 @@ public abstract class ASTVisitor { public boolean visit(NormalAnnotation node) { return true; } - + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -993,14 +993,14 @@ public abstract class ASTVisitor { public boolean visit(NullLiteral node) { return true; } - + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -1009,14 +1009,14 @@ public abstract class ASTVisitor { public boolean visit(NumberLiteral node) { return true; } - + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -1026,14 +1026,14 @@ public abstract class ASTVisitor { return true; } - + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -1043,14 +1043,14 @@ public abstract class ASTVisitor { public boolean visit(ParameterizedType node) { return true; } - + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -1059,14 +1059,14 @@ public abstract class ASTVisitor { public boolean visit(ParenthesizedExpression node) { return true; } - + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -1075,14 +1075,14 @@ public abstract class ASTVisitor { public boolean visit(PostfixExpression node) { return true; } - + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -1091,14 +1091,14 @@ public abstract class ASTVisitor { public boolean visit(PrefixExpression node) { return true; } - + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -1107,14 +1107,14 @@ public abstract class ASTVisitor { public boolean visit(PrimitiveType node) { return true; } - + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -1123,14 +1123,14 @@ public abstract class ASTVisitor { public boolean visit(QualifiedName node) { return true; } - + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -1140,14 +1140,14 @@ public abstract class ASTVisitor { public boolean visit(QualifiedType node) { return true; } - + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -1156,14 +1156,14 @@ public abstract class ASTVisitor { public boolean visit(ReturnStatement node) { return true; } - + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -1172,14 +1172,14 @@ public abstract class ASTVisitor { public boolean visit(SimpleName node) { return true; } - + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -1189,14 +1189,14 @@ public abstract class ASTVisitor { return true; } - + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -1207,14 +1207,14 @@ public abstract class ASTVisitor { return true; } - + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -1223,14 +1223,14 @@ public abstract class ASTVisitor { public boolean visit(SingleVariableDeclaration node) { return true; } - + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -1239,14 +1239,14 @@ public abstract class ASTVisitor { public boolean visit(StringLiteral node) { return true; } - + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -1255,14 +1255,14 @@ public abstract class ASTVisitor { public boolean visit(SuperConstructorInvocation node) { return true; } - + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -1271,14 +1271,14 @@ public abstract class ASTVisitor { public boolean visit(SuperFieldAccess node) { return true; } - + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -1287,14 +1287,14 @@ public abstract class ASTVisitor { public boolean visit(SuperMethodInvocation node) { return true; } - + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -1303,14 +1303,14 @@ public abstract class ASTVisitor { public boolean visit(SwitchCase node) { return true; } - + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -1319,14 +1319,14 @@ public abstract class ASTVisitor { public boolean visit(SwitchStatement node) { return true; } - + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -1336,14 +1336,14 @@ public abstract class ASTVisitor { return true; } - + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -1354,14 +1354,14 @@ public abstract class ASTVisitor { return true; } - + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -1372,14 +1372,14 @@ public abstract class ASTVisitor { return true; } - + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -1388,14 +1388,14 @@ public abstract class ASTVisitor { public boolean visit(ThisExpression node) { return true; } - + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -1404,14 +1404,14 @@ public abstract class ASTVisitor { public boolean visit(ThrowStatement node) { return true; } - + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -1420,14 +1420,14 @@ public abstract class ASTVisitor { public boolean visit(TryStatement node) { return true; } - + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -1436,14 +1436,14 @@ public abstract class ASTVisitor { public boolean visit(TypeDeclaration node) { return true; } - + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -1452,14 +1452,14 @@ public abstract class ASTVisitor { public boolean visit(TypeDeclarationStatement node) { return true; } - + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -1468,14 +1468,14 @@ public abstract class ASTVisitor { public boolean visit(TypeLiteral node) { return true; } - + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -1485,14 +1485,14 @@ public abstract class ASTVisitor { public boolean visit(TypeParameter node) { return true; } - + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -1501,14 +1501,14 @@ public abstract class ASTVisitor { public boolean visit(VariableDeclarationExpression node) { return true; } - + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -1517,14 +1517,14 @@ public abstract class ASTVisitor { public boolean visit(VariableDeclarationStatement node) { return true; } - + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -1533,14 +1533,14 @@ public abstract class ASTVisitor { public boolean visit(VariableDeclarationFragment node) { return true; } - + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -1549,14 +1549,14 @@ public abstract class ASTVisitor { public boolean visit(WhileStatement node) { return true; } - + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -1566,7 +1566,7 @@ public abstract class ASTVisitor { public boolean visit(WildcardType node) { return true; } - + //{ObjectTeams: visit methods for OT-specific types /** * Visits the given type-specific AST node. @@ -1574,7 +1574,7 @@ public abstract class ASTVisitor { * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -1584,14 +1584,14 @@ public abstract class ASTVisitor { { return visitNode(node); } - + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -1608,7 +1608,7 @@ public abstract class ASTVisitor { * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -1625,7 +1625,7 @@ public abstract class ASTVisitor { * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -1642,7 +1642,7 @@ public abstract class ASTVisitor { * The default implementation does nothing and returns true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -1659,7 +1659,7 @@ public abstract class ASTVisitor { * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -1676,7 +1676,7 @@ public abstract class ASTVisitor { * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -1693,7 +1693,7 @@ public abstract class ASTVisitor { * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -1703,7 +1703,7 @@ public abstract class ASTVisitor { public boolean visit(ParameterMapping node) { return visitNode(node); - } + } /** * Visits the given type-specific AST node. @@ -1711,7 +1711,7 @@ public abstract class ASTVisitor { * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -1721,15 +1721,15 @@ public abstract class ASTVisitor { public boolean visit(RoleTypeDeclaration node) { return visitNode(node); - } - + } + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -1746,7 +1746,7 @@ public abstract class ASTVisitor { * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -1756,14 +1756,14 @@ public abstract class ASTVisitor { { return visitNode(node); } - + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -1774,8 +1774,8 @@ public abstract class ASTVisitor { return visitNode(node); } - - + + /** * Visits the given type-specific AST node. @@ -1783,7 +1783,7 @@ public abstract class ASTVisitor { * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -1793,14 +1793,14 @@ public abstract class ASTVisitor { { return visitNode(node); } - + /** * Visits the given type-specific AST node. * <p> * The default implementation does nothing and return true. * Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @return <code>true</code> if the children of this node should be * visited, and <code>false</code> if the children of this node should @@ -1814,7 +1814,7 @@ public abstract class ASTVisitor { public boolean visit(PrecedenceDeclaration node) { return visitNode(node); } - + public boolean visit(GuardPredicateDeclaration node) { return visitNode(node); } @@ -1825,15 +1825,15 @@ public abstract class ASTVisitor { protected boolean visitNode(ASTNode node) { return true; } - + // SH} - + /** * End of visit the given type-specific AST node. * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @since 3.1 */ @@ -1846,7 +1846,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @since 3.1 */ @@ -1859,7 +1859,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(AnonymousClassDeclaration node) { @@ -1871,7 +1871,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(ArrayAccess node) { @@ -1883,7 +1883,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(ArrayCreation node) { @@ -1895,7 +1895,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(ArrayInitializer node) { @@ -1907,7 +1907,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(ArrayType node) { @@ -1919,7 +1919,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(AssertStatement node) { @@ -1931,7 +1931,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(Assignment node) { @@ -1943,13 +1943,13 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(Block node) { // default implementation: do nothing } - + /** * End of visit the given type-specific AST node. * <p> @@ -1960,7 +1960,7 @@ public abstract class ASTVisitor { * only be called if a client goes out of their way to visit this * kind of node explicitly. * </p> - * + * * @param node the node to visit * @since 3.0 */ @@ -1973,7 +1973,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(BooleanLiteral node) { @@ -1985,7 +1985,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(BreakStatement node) { @@ -1997,7 +1997,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(CastExpression node) { @@ -2009,7 +2009,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(CatchClause node) { @@ -2021,7 +2021,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(CharacterLiteral node) { @@ -2033,7 +2033,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(ClassInstanceCreation node) { @@ -2045,7 +2045,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(CompilationUnit node) { @@ -2057,7 +2057,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(ConditionalExpression node) { @@ -2069,7 +2069,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(ConstructorInvocation node) { @@ -2081,7 +2081,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(ContinueStatement node) { @@ -2093,7 +2093,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(DoStatement node) { @@ -2105,58 +2105,58 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(EmptyStatement node) { // default implementation: do nothing } - + /** * End of visit the given type-specific AST node. * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @since 3.1 */ public void endVisit(EnhancedForStatement node) { // default implementation: do nothing } - + /** * End of visit the given type-specific AST node. * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @since 3.1 */ public void endVisit(EnumConstantDeclaration node) { // default implementation: do nothing - } - + } + /** * End of visit the given type-specific AST node. * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @since 3.1 */ public void endVisit(EnumDeclaration node) { // default implementation: do nothing - } + } /** * End of visit the given type-specific AST node. * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(ExpressionStatement node) { @@ -2168,7 +2168,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(FieldAccess node) { @@ -2180,7 +2180,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(FieldDeclaration node) { @@ -2192,7 +2192,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(ForStatement node) { @@ -2204,7 +2204,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(IfStatement node) { @@ -2216,7 +2216,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(ImportDeclaration node) { @@ -2228,7 +2228,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(InfixExpression node) { @@ -2240,7 +2240,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(InstanceofExpression node) { @@ -2252,7 +2252,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(Initializer node) { @@ -2264,7 +2264,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(Javadoc node) { @@ -2276,13 +2276,13 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(LabeledStatement node) { // default implementation: do nothing } - + /** * End of visit the given type-specific AST node. * <p> @@ -2293,72 +2293,72 @@ public abstract class ASTVisitor { * only be called if a client goes out of their way to visit this * kind of node explicitly. * </p> - * + * * @param node the node to visit * @since 3.0 */ public void endVisit(LineComment node) { // default implementation: do nothing } - + /** * End of visit the given type-specific AST node. * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @since 3.1 */ public void endVisit(MarkerAnnotation node) { // default implementation: do nothing } - + /** * End of visit the given type-specific AST node. * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @since 3.0 */ public void endVisit(MemberRef node) { // default implementation: do nothing } - + /** * End of visit the given type-specific AST node. * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @since 3.1 */ public void endVisit(MemberValuePair node) { // default implementation: do nothing } - + /** * End of visit the given type-specific AST node. * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @since 3.0 */ public void endVisit(MethodRef node) { // default implementation: do nothing } - + /** * End of visit the given type-specific AST node. * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @since 3.0 */ @@ -2371,7 +2371,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(MethodDeclaration node) { @@ -2383,32 +2383,32 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(MethodInvocation node) { // default implementation: do nothing } - + /** * End of visit the given type-specific AST node. * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @since 3.1 */ public void endVisit(Modifier node) { // default implementation: do nothing } - + /** * End of visit the given type-specific AST node. * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @since 3.1 */ @@ -2421,7 +2421,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(NullLiteral node) { @@ -2433,7 +2433,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(NumberLiteral node) { @@ -2445,32 +2445,32 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(PackageDeclaration node) { // default implementation: do nothing } - + /** * End of visit the given type-specific AST node. * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @since 3.1 */ public void endVisit(ParameterizedType node) { // default implementation: do nothing - } + } /** * End of visit the given type-specific AST node. * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(ParenthesizedExpression node) { @@ -2482,7 +2482,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(PostfixExpression node) { @@ -2494,7 +2494,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(PrefixExpression node) { @@ -2506,7 +2506,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(PrimitiveType node) { @@ -2518,32 +2518,32 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(QualifiedName node) { // default implementation: do nothing } - + /** * End of visit the given type-specific AST node. * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @since 3.1 */ public void endVisit(QualifiedType node) { // default implementation: do nothing - } + } /** * End of visit the given type-specific AST node. * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(ReturnStatement node) { @@ -2555,7 +2555,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(SimpleName node) { @@ -2567,19 +2567,19 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(SimpleType node) { // default implementation: do nothing } - + /** * End of visit the given type-specific AST node. * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @since 3.1 */ @@ -2592,7 +2592,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(SingleVariableDeclaration node) { @@ -2604,7 +2604,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(StringLiteral node) { @@ -2616,7 +2616,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(SuperConstructorInvocation node) { @@ -2628,7 +2628,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(SuperFieldAccess node) { @@ -2640,7 +2640,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(SuperMethodInvocation node) { @@ -2652,7 +2652,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(SwitchCase node) { @@ -2664,7 +2664,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(SwitchStatement node) { @@ -2676,32 +2676,32 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(SynchronizedStatement node) { // default implementation: do nothing } - + /** * End of visit the given type-specific AST node. * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @since 3.0 */ public void endVisit(TagElement node) { // default implementation: do nothing } - + /** * End of visit the given type-specific AST node. * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @since 3.0 */ @@ -2714,7 +2714,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(ThisExpression node) { @@ -2726,7 +2726,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(ThrowStatement node) { @@ -2738,7 +2738,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(TryStatement node) { @@ -2750,7 +2750,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(TypeDeclaration node) { @@ -2762,7 +2762,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(TypeDeclarationStatement node) { @@ -2774,19 +2774,19 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(TypeLiteral node) { // default implementation: do nothing } - + /** * End of visit the given type-specific AST node. * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @since 3.1 */ @@ -2799,7 +2799,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(VariableDeclarationExpression node) { @@ -2811,7 +2811,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(VariableDeclarationStatement node) { @@ -2823,7 +2823,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(VariableDeclarationFragment node) { @@ -2835,46 +2835,46 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(WhileStatement node) { // default implementation: do nothing } - + /** * End of visit the given type-specific AST node. * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @since 3.1 */ public void endVisit(WildcardType node) { // default implementation: do nothing } - + //{ObjectTeams: endVisit methods for OT-specific types /** * End of visit the given type-specific AST node. * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(MethodSpec node) { // default implementation: do nothing } - + /** * End of visit the given type-specific AST node. * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(FieldAccessSpec node) @@ -2887,22 +2887,22 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(CallinMappingDeclaration node) { // default implementation: do nothing } - + /** * End of visit the given type-specific AST node. * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit - */ + */ public void endVisit(CalloutMappingDeclaration node) { // default implementation: do nothing @@ -2913,10 +2913,10 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit * @since 1.3.1 - */ + */ public void endVisit(MethodBindingOperator node) { // default implementation: do nothing @@ -2927,7 +2927,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(ParameterMapping node) @@ -2940,59 +2940,59 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(RoleTypeDeclaration node) { // default implementation: do nothing } - + /** * End of visit the given type-specific AST node. * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit - */ + */ public void endVisit(LiftingType node) { // default implementation: do nothing } - + /** * End of visit the given type-specific AST node. * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit - */ + */ public void endVisit(TypeAnchor node) { // default implementation: do nothing } - + /** * End of visit the given type-specific AST node. * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit - */ + */ public void endVisit(WithinStatement node) { // default implementation: do nothing } - + /** * End of visit the given type-specific AST node. * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(TSuperMessageSend node) @@ -3005,7 +3005,7 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit */ public void endVisit(TSuperConstructorInvocation node) @@ -3013,15 +3013,15 @@ public abstract class ASTVisitor { // default implementation: do nothing } - + /** * End of visit the given type-specific AST node. * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit - */ + */ public void endVisit(BaseConstructorInvocation node) { // default implementation: do nothing @@ -3032,15 +3032,15 @@ public abstract class ASTVisitor { * <p> * The default implementation does nothing. Subclasses may reimplement. * </p> - * + * * @param node the node to visit - */ + */ public void endVisit(BaseCallMessageSend node) { // default implementation: do nothing } - - public void endVisit(PrecedenceDeclaration declaration) + + public void endVisit(PrecedenceDeclaration declaration) { // default implementation: do nothing } @@ -3048,5 +3048,5 @@ public abstract class ASTVisitor { public void endVisit(GuardPredicateDeclaration predicate) { // default implementation: do nothing } - + } diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AbstractMethodMappingDeclaration.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AbstractMethodMappingDeclaration.java index b34c00ef5..bc181a21e 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AbstractMethodMappingDeclaration.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AbstractMethodMappingDeclaration.java @@ -1,19 +1,19 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute for Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * $Id: AbstractMethodMappingDeclaration.java 23416 2010-02-03 19:59:31Z stephan $ - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation @@ -24,7 +24,7 @@ import java.util.List; /** * NEW for OTDT. - * + * * Super class for callin/callout method mappings * @author brcan * @@ -32,7 +32,7 @@ import java.util.List; */ public abstract class AbstractMethodMappingDeclaration extends BodyDeclaration { - + protected MethodMappingElement roleMappingElement = null; // includes info about binding kind and binding modifiers @@ -44,46 +44,46 @@ public abstract class AbstractMethodMappingDeclaration extends BodyDeclaration * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ AbstractMethodMappingDeclaration(AST ast) { super(ast); } - + /** - * The list of parameter mappings (element type: <code>ParameterMapping</code>). + * The list of parameter mappings (element type: <code>ParameterMapping</code>). * Defaults to an empty list. */ - ASTNode.NodeList _parameterMappings = + ASTNode.NodeList _parameterMappings = new ASTNode.NodeList(internalParameterMappingsProperty()); /** Return the structural property descriptor for the roleMappingElement property of this node. */ public abstract ChildPropertyDescriptor getRoleElementProperty(); - /** Return the structural property descriptor for the bindingOperator property of this node. */ + /** Return the structural property descriptor for the bindingOperator property of this node. */ abstract ChildPropertyDescriptor internalGetBindingOperatorProperty(); - + /** * Returns structural property descriptor for the "parameterMappings" property * of this node. - * + * * @return the property descriptor */ abstract ChildListPropertyDescriptor internalParameterMappingsProperty(); - + /** * Creates and returns a structural property descriptor for the * "parameterMappings" property declared on the given concrete node type. - * + * * @return the property descriptor */ static final ChildListPropertyDescriptor internalParameterMappingPropertyFactory(Class nodeClass) { return new ChildListPropertyDescriptor(nodeClass, "parameterMappings", ParameterMapping.class, CYCLE_RISK); //$NON-NLS-1$ } - + ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) { if (property == getRoleElementProperty()) @@ -107,12 +107,12 @@ public abstract class AbstractMethodMappingDeclaration extends BodyDeclaration // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /** * Returns the method spec left of the callout/in arrow. * @return the left method spec, i.e. the declaring role method - */ + */ public MethodMappingElement getRoleMappingElement() { if (this.roleMappingElement == null) { @@ -124,21 +124,21 @@ public abstract class AbstractMethodMappingDeclaration extends BodyDeclaration postLazyInit(this.roleMappingElement, getRoleElementProperty()); } } - } + } return this.roleMappingElement; } /** * Sets the left method spec (role method spec) declared in this callout * mapping declaration to the given method spec. - * + * * @param roleMappingElement * @exception IllegalArgumentException if: * <ul> * <li>the node belongs to a different AST</li> * <li>the node already has a parent</li> * </ul> - */ + */ public void setRoleMappingElement(MethodMappingElement roleMappingElement) { if (roleMappingElement == null) @@ -156,9 +156,9 @@ public abstract class AbstractMethodMappingDeclaration extends BodyDeclaration MethodBindingOperator oldOperator = this.bindingOperator; preReplaceChild(oldOperator, bindingOp, propertyDescriptor); this.bindingOperator = bindingOp; - postReplaceChild(oldOperator, bindingOp, propertyDescriptor); + postReplaceChild(oldOperator, bindingOp, propertyDescriptor); } - + public MethodBindingOperator bindingOperator() { if (this.bindingOperator == null) { @@ -179,11 +179,11 @@ public abstract class AbstractMethodMappingDeclaration extends BodyDeclaration /** * Returns the live ordered list of parameter mappings for this * callin mapping declaration. - * + * * @return the live list of parameter mappings * (element type: <code>ParameterMapping</code>) - */ - public List getParameterMappings() + */ + public List getParameterMappings() { return _parameterMappings; } @@ -196,15 +196,15 @@ public abstract class AbstractMethodMappingDeclaration extends BodyDeclaration public boolean hasSignature() { return getRoleMappingElement().hasSignature(); } - - /** + + /** * Mark this method mapping as not having signatures and actually * remove signatures from all method specs. */ public void removeSignatures() { removeSignatureFrom(getRoleMappingElement()); } - + void removeSignatureFrom(MethodMappingElement mappingElement) { mappingElement.setSignatureFlag(false); switch (mappingElement.getNodeType()) { diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AbstractTypeDeclaration.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AbstractTypeDeclaration.java index 031f49882..1cc2abcdb 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AbstractTypeDeclaration.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AbstractTypeDeclaration.java @@ -22,11 +22,11 @@ import java.util.List; * EnumDeclaration * AnnotationTypeDeclaration * </pre> - * + * * @since 3.0 */ public abstract class AbstractTypeDeclaration extends BodyDeclaration { - + /** * The type name; lazily initialized; defaults to a unspecified, * legal Java class identifier. @@ -44,7 +44,7 @@ public abstract class AbstractTypeDeclaration extends BodyDeclaration { /** * Returns structural property descriptor for the "bodyDeclarations" property * of this node. - * + * * @return the property descriptor */ abstract ChildListPropertyDescriptor internalBodyDeclarationsProperty(); @@ -52,7 +52,7 @@ public abstract class AbstractTypeDeclaration extends BodyDeclaration { /** * Returns structural property descriptor for the "bodyDeclarations" property * of this node. - * + * * @return the property descriptor * @since 3.1 */ @@ -63,51 +63,51 @@ public abstract class AbstractTypeDeclaration extends BodyDeclaration { /** * Returns structural property descriptor for the "name" property * of this node. - * + * * @return the property descriptor */ abstract ChildPropertyDescriptor internalNameProperty(); - + /** * Returns structural property descriptor for the "name" property * of this node. - * + * * @return the property descriptor * @since 3.1 */ public final ChildPropertyDescriptor getNameProperty() { return internalNameProperty(); } - + /** * Creates and returns a structural property descriptor for the * "bodyDeclaration" property declared on the given concrete node type. - * + * * @return the property descriptor */ static final ChildListPropertyDescriptor internalBodyDeclarationPropertyFactory(Class nodeClass) { return new ChildListPropertyDescriptor(nodeClass, "bodyDeclarations", BodyDeclaration.class, CYCLE_RISK); //$NON-NLS-1$ } - + /** * Creates and returns a structural property descriptor for the * "name" property declared on the given concrete node type. - * + * * @return the property descriptor */ static final ChildPropertyDescriptor internalNamePropertyFactory(Class nodeClass) { return new ChildPropertyDescriptor(nodeClass, "name", SimpleName.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ } - + /** - * Creates a new AST node for an abstract type declaration owned by the given + * Creates a new AST node for an abstract type declaration owned by the given * AST. * <p> - * N.B. This constructor is package-private; all subclasses must be - * declared in the same package; clients are unable to declare + * N.B. This constructor is package-private; all subclasses must be + * declared in the same package; clients are unable to declare * additional subclasses. * </p> - * + * * @param ast the AST that is to own this node */ AbstractTypeDeclaration(AST ast) { @@ -117,10 +117,10 @@ public abstract class AbstractTypeDeclaration extends BodyDeclaration { /** * Returns the name of the type declared in this type declaration. - * + * * @return the type name node * @since 2.0 (originally declared on <code>TypeDeclaration</code>) - */ + */ public SimpleName getName() { if (this.typeName == null) { // lazy init must be thread-safe for readers @@ -134,11 +134,11 @@ public abstract class AbstractTypeDeclaration extends BodyDeclaration { } return this.typeName; } - + /** * Sets the name of the type declared in this type declaration to the * given name. - * + * * @param typeName the new type name * @exception IllegalArgumentException if: * <ul> @@ -146,7 +146,7 @@ public abstract class AbstractTypeDeclaration extends BodyDeclaration { * <li>the node already has a parent</li> * </ul> * @since 2.0 (originally declared on <code>TypeDeclaration</code>) - */ + */ public void setName(SimpleName typeName) { if (typeName == null) { throw new IllegalArgumentException(); @@ -159,17 +159,17 @@ public abstract class AbstractTypeDeclaration extends BodyDeclaration { } /** - * Returns the live ordered list of body declarations of this type + * Returns the live ordered list of body declarations of this type * declaration. - * + * * @return the live list of body declarations * (element type: <code>BodyDeclaration</code>) * @since 2.0 (originally declared on <code>TypeDeclaration</code>) - */ + */ public List bodyDeclarations() { return this.bodyDeclarations; } - + /** * Returns whether this type declaration is a package member (that is, * a top-level type). @@ -177,7 +177,7 @@ public abstract class AbstractTypeDeclaration extends BodyDeclaration { * Note that this is a convenience method that simply checks whether * this node's parent is a compilation unit node. * </p> - * + * * @return <code>true</code> if this type declaration is a child of * a compilation unit node, and <code>false</code> otherwise * @since 2.0 (originally declared on <code>TypeDeclaration</code>) @@ -191,10 +191,10 @@ public abstract class AbstractTypeDeclaration extends BodyDeclaration { * Returns whether this type declaration is a type member. * <p> * Note that this is a convenience method that simply checks whether - * this node's parent is a type declaration node or an anonymous + * this node's parent is a type declaration node or an anonymous * class declaration. * </p> - * + * * @return <code>true</code> if this type declaration is a child of * a type declaration node or an anonymous class declaration node, * and <code>false</code> otherwise @@ -212,7 +212,7 @@ public abstract class AbstractTypeDeclaration extends BodyDeclaration { * Note that this is a convenience method that simply checks whether * this node's parent is a type declaration statement node. * </p> - * + * * @return <code>true</code> if this type declaration is a child of * a type declaration statement node, and <code>false</code> otherwise * @since 2.0 (originally declared on <code>TypeDeclaration</code>) @@ -225,7 +225,7 @@ public abstract class AbstractTypeDeclaration extends BodyDeclaration { //{ObjectTeams: additional queries: /** * Returns whether this type declaration is a team type. - * + * * @return <code>true</code> if this type declaration is a team declaration, * and <code>false</code> otherwise * @since OTDT_1.2.3 @@ -236,7 +236,7 @@ public abstract class AbstractTypeDeclaration extends BodyDeclaration { /** * Returns whether this type declaration is a role type. - * + * * @return <code>true</code> if this type declaration is a role declaration, * and <code>false</code> otherwise * @since OTDT_1.2.3 @@ -253,29 +253,29 @@ public abstract class AbstractTypeDeclaration extends BodyDeclaration { * Note that bindings are generally unavailable unless requested when the * AST is being built. * </p> - * - * @return the binding, or <code>null</code> if the binding cannot be + * + * @return the binding, or <code>null</code> if the binding cannot be * resolved * @since 3.1 Declared in 3.0 on the individual subclasses. - */ + */ public final ITypeBinding resolveBinding() { return internalResolveBinding(); } - + /** * Resolves and returns the binding for the type declared in this type * declaration. This method must be implemented by subclasses. - * - * @return the binding, or <code>null</code> if the binding cannot be + * + * @return the binding, or <code>null</code> if the binding cannot be * resolved - */ + */ abstract ITypeBinding internalResolveBinding(); - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int memSize() { return super.memSize() + 2 * 4; } - + } diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Annotation.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Annotation.java index 6d22f007a..fd159119d 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Annotation.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Annotation.java @@ -23,11 +23,11 @@ package org.eclipse.jdt.core.dom; * @since 3.1 */ public abstract class Annotation extends Expression implements IExtendedModifier { - + /** * Returns structural property descriptor for the "typeName" property * of this node. - * + * * @return the property descriptor */ abstract ChildPropertyDescriptor internalTypeNameProperty(); @@ -35,7 +35,7 @@ public abstract class Annotation extends Expression implements IExtendedModifier /** * Returns structural property descriptor for the "typeName" property * of this node. - * + * * @return the property descriptor */ public final ChildPropertyDescriptor getTypeNameProperty() { @@ -45,13 +45,13 @@ public abstract class Annotation extends Expression implements IExtendedModifier /** * Creates and returns a structural property descriptor for the * "typeName" property declared on the given concrete node type. - * + * * @return the property descriptor */ static final ChildPropertyDescriptor internalTypeNamePropertyFactory(Class nodeClass) { return new ChildPropertyDescriptor(nodeClass, "typeName", Name.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ } - + /** * The annotation type name; lazily initialized; defaults to an unspecified, * legal Java identifier. @@ -59,37 +59,37 @@ public abstract class Annotation extends Expression implements IExtendedModifier Name typeName = null; /** - * Creates a new AST node for an annotation node owned by the + * Creates a new AST node for an annotation node owned by the * given AST. * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ Annotation(AST ast) { super(ast); } - + /** * @see IExtendedModifier#isModifier() - */ + */ public boolean isModifier() { return false; } - + /** * @see IExtendedModifier#isAnnotation() - */ + */ public boolean isAnnotation() { return true; } /** * Returns the annotation type name of this annotation. - * + * * @return the annotation type name - */ + */ public Name getTypeName() { if (this.typeName == null) { // lazy init must be thread-safe for readers @@ -103,17 +103,17 @@ public abstract class Annotation extends Expression implements IExtendedModifier } return this.typeName; } - + /** * Sets the annotation type name of this annotation. - * + * * @param typeName the annotation type name * @exception IllegalArgumentException if: * <ul> * <li>the node belongs to a different AST</li> * <li>the node already has a parent</li> * </ul> - */ + */ public void setTypeName(Name typeName) { if (typeName == null) { throw new IllegalArgumentException(); @@ -128,10 +128,10 @@ public abstract class Annotation extends Expression implements IExtendedModifier /** * Returns whether this is a normal annotation * ({@link NormalAnnotation}). - * + * * @return <code>true</code> if this is a normal annotation, * and <code>false</code> otherwise - */ + */ public boolean isNormalAnnotation() { return (this instanceof NormalAnnotation); } @@ -139,10 +139,10 @@ public abstract class Annotation extends Expression implements IExtendedModifier /** * Returns whether this is a marker annotation * ({@link MarkerAnnotation}). - * + * * @return <code>true</code> if this is a marker annotation, * and <code>false</code> otherwise - */ + */ public boolean isMarkerAnnotation() { return (this instanceof MarkerAnnotation); } @@ -150,10 +150,10 @@ public abstract class Annotation extends Expression implements IExtendedModifier /** * Returns whether this is a single member annotation. * ({@link SingleMemberAnnotation}). - * + * * @return <code>true</code> if this is a single member annotation, * and <code>false</code> otherwise - */ + */ public boolean isSingleMemberAnnotation() { return (this instanceof SingleMemberAnnotation); } @@ -171,10 +171,10 @@ public abstract class Annotation extends Expression implements IExtendedModifier * Note that bindings (which includes resolved annotations) are generally unavailable unless * requested when the AST is being built. * </p> - * + * * @return the resolved annotation, or <code>null</code> if the annotation cannot be resolved * @since 3.2 - */ + */ public IAnnotationBinding resolveAnnotationBinding() { return this.ast.getBindingResolver().resolveAnnotation(this); } diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AnnotationBinding.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AnnotationBinding.java index 106cf7b41..c3aedc36d 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AnnotationBinding.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AnnotationBinding.java @@ -37,7 +37,7 @@ class AnnotationBinding implements IAnnotationBinding { this.binding = annotation; this.bindingResolver = resolver; } - + public IAnnotationBinding[] getAnnotations() { return NoAnnotations; } @@ -48,7 +48,7 @@ class AnnotationBinding implements IAnnotationBinding { return null; return typeBinding; } - + public IMemberValuePairBinding[] getDeclaredMemberValuePairs() { ReferenceBinding typeBinding = this.binding.getAnnotationType(); if (typeBinding == null || ((typeBinding.tagBits & TagBits.HasMissingType) != 0)) { @@ -98,7 +98,7 @@ class AnnotationBinding implements IAnnotationBinding { } return allPairs; } - + public IJavaElement getJavaElement() { if (!(this.bindingResolver instanceof DefaultBindingResolver)) return null; ASTNode node = (ASTNode) ((DefaultBindingResolver) this.bindingResolver).bindingsToAstNodes.get(this); @@ -146,7 +146,7 @@ class AnnotationBinding implements IAnnotationBinding { } return this.key; } - + private String getRecipientKey() { if (!(this.bindingResolver instanceof DefaultBindingResolver)) return ""; //$NON-NLS-1$ DefaultBindingResolver resolver = (DefaultBindingResolver) this.bindingResolver; @@ -191,13 +191,13 @@ class AnnotationBinding implements IAnnotationBinding { return annotationType.getName(); } } - + public boolean isDeprecated() { ReferenceBinding typeBinding = this.binding.getAnnotationType(); if (typeBinding == null) return false; return typeBinding.isDeprecated(); } - + public boolean isEqualTo(IBinding otherBinding) { if (this == otherBinding) return true; @@ -245,5 +245,5 @@ class AnnotationBinding implements IAnnotationBinding { buffer.append(')'); return buffer.toString(); } - + } diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AnnotationTypeDeclaration.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AnnotationTypeDeclaration.java index 4924c2b9e..9ef8aa6c8 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AnnotationTypeDeclaration.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AnnotationTypeDeclaration.java @@ -39,43 +39,43 @@ import java.util.List; * modifiers). The source range extends through the last character of the "}" * token following the body declarations. * </p> - * + * * @since 3.1 * @noinstantiate This class is not intended to be instantiated by clients. */ public class AnnotationTypeDeclaration extends AbstractTypeDeclaration { - + /** * The "javadoc" structural property of this node type. */ - public static final ChildPropertyDescriptor JAVADOC_PROPERTY = + public static final ChildPropertyDescriptor JAVADOC_PROPERTY = internalJavadocPropertyFactory(AnnotationTypeDeclaration.class); /** * The "modifiers" structural property of this node type. */ - public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = + public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = internalModifiers2PropertyFactory(AnnotationTypeDeclaration.class); - + /** * The "name" structural property of this node type. */ - public static final ChildPropertyDescriptor NAME_PROPERTY = + public static final ChildPropertyDescriptor NAME_PROPERTY = internalNamePropertyFactory(AnnotationTypeDeclaration.class); /** * The "bodyDeclarations" structural property of this node type. */ - public static final ChildListPropertyDescriptor BODY_DECLARATIONS_PROPERTY = + public static final ChildListPropertyDescriptor BODY_DECLARATIONS_PROPERTY = internalBodyDeclarationPropertyFactory(AnnotationTypeDeclaration.class); - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List properyList = new ArrayList(5); createPropertyList(AnnotationTypeDeclaration.class, properyList); @@ -89,28 +89,28 @@ public class AnnotationTypeDeclaration extends AbstractTypeDeclaration { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** - * Creates a new AST node for an annotation type declaration owned by the given + * Creates a new AST node for an annotation type declaration owned by the given * AST. By default, the type declaration is for an annotation - * type of an unspecified, but legal, name; no modifiers; no javadoc; + * type of an unspecified, but legal, name; no modifiers; no javadoc; * and an empty list of body declarations. * <p> - * N.B. This constructor is package-private; all subclasses must be - * declared in the same package; clients are unable to declare + * N.B. This constructor is package-private; all subclasses must be + * declared in the same package; clients are unable to declare * additional subclasses. * </p> - * + * * @param ast the AST that is to own this node */ AnnotationTypeDeclaration(AST ast) { @@ -124,7 +124,7 @@ public class AnnotationTypeDeclaration extends AbstractTypeDeclaration { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -148,7 +148,7 @@ public class AnnotationTypeDeclaration extends AbstractTypeDeclaration { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -162,7 +162,7 @@ public class AnnotationTypeDeclaration extends AbstractTypeDeclaration { // allow default implementation to flag the error return super.internalGetChildListProperty(property); } - + /* (omit javadoc for this method) * Method declared on BodyDeclaration. */ @@ -227,7 +227,7 @@ public class AnnotationTypeDeclaration extends AbstractTypeDeclaration { // dispatch to correct overloaded match method return matcher.match(this, other); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -242,21 +242,21 @@ public class AnnotationTypeDeclaration extends AbstractTypeDeclaration { } visitor.endVisit(this); } - + /* (omit javadoc for this method) * Method declared on AsbtractTypeDeclaration. */ ITypeBinding internalResolveBinding() { return this.ast.getBindingResolver().resolveType(this); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int memSize() { return super.memSize(); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AnnotationTypeMemberDeclaration.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AnnotationTypeMemberDeclaration.java index 18238725d..f716936b8 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AnnotationTypeMemberDeclaration.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AnnotationTypeMemberDeclaration.java @@ -28,54 +28,54 @@ import java.util.List; * When a Javadoc comment is present, the source * range begins with the first character of the "/**" comment delimiter. * When there is no Javadoc comment, the source range begins with the first - * character of the first modifier keyword (if modifiers), - * or the first character of the member type (no modifiers). + * character of the first modifier keyword (if modifiers), + * or the first character of the member type (no modifiers). * The source range extends through the last character of the * ";" token. * </p> - * + * * @since 3.1 * @noinstantiate This class is not intended to be instantiated by clients. */ public class AnnotationTypeMemberDeclaration extends BodyDeclaration { - + /** * The "javadoc" structural property of this node type. */ - public static final ChildPropertyDescriptor JAVADOC_PROPERTY = + public static final ChildPropertyDescriptor JAVADOC_PROPERTY = internalJavadocPropertyFactory(AnnotationTypeMemberDeclaration.class); /** * The "modifiers" structural property of this node type. */ - public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = + public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = internalModifiers2PropertyFactory(AnnotationTypeMemberDeclaration.class); - + /** * The "name" structural property of this node type. */ - public static final ChildPropertyDescriptor NAME_PROPERTY = + public static final ChildPropertyDescriptor NAME_PROPERTY = new ChildPropertyDescriptor(AnnotationTypeMemberDeclaration.class, "name", SimpleName.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ /** * The "type" structural property of this node type. */ - public static final ChildPropertyDescriptor TYPE_PROPERTY = + public static final ChildPropertyDescriptor TYPE_PROPERTY = new ChildPropertyDescriptor(AnnotationTypeMemberDeclaration.class, "type", Type.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ /** * The "default" structural property of this node type. */ - public static final ChildPropertyDescriptor DEFAULT_PROPERTY = + public static final ChildPropertyDescriptor DEFAULT_PROPERTY = new ChildPropertyDescriptor(AnnotationTypeMemberDeclaration.class, "default", Expression.class, OPTIONAL, CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List properyList = new ArrayList(6); createPropertyList(AnnotationTypeMemberDeclaration.class, properyList); @@ -90,16 +90,16 @@ public class AnnotationTypeMemberDeclaration extends BodyDeclaration { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** * The member name; lazily initialized; defaults to an unspecified, * legal Java identifier. @@ -110,23 +110,23 @@ public class AnnotationTypeMemberDeclaration extends BodyDeclaration { * The member type; lazily initialized; defaults to int. */ private Type memberType = null; - + /** * The optional default expression; <code>null</code> for none; defaults to none. */ private Expression optionalDefaultValue = null; - + /** - * Creates a new AST node for an annotation type member declaration owned + * Creates a new AST node for an annotation type member declaration owned * by the given AST. By default, the declaration is for a member of an * unspecified, but legal, name; no modifiers; no javadoc; * an unspecified value type; and no default value. * <p> - * N.B. This constructor is package-private; all subclasses must be - * declared in the same package; clients are unable to declare + * N.B. This constructor is package-private; all subclasses must be + * declared in the same package; clients are unable to declare * additional subclasses. * </p> - * + * * @param ast the AST that is to own this node */ AnnotationTypeMemberDeclaration(AST ast) { @@ -140,7 +140,7 @@ public class AnnotationTypeMemberDeclaration extends BodyDeclaration { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -188,7 +188,7 @@ public class AnnotationTypeMemberDeclaration extends BodyDeclaration { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -199,7 +199,7 @@ public class AnnotationTypeMemberDeclaration extends BodyDeclaration { // allow default implementation to flag the error return super.internalGetChildListProperty(property); } - + /* (omit javadoc for this method) * Method declared on BodyDeclaration. */ @@ -251,7 +251,7 @@ public class AnnotationTypeMemberDeclaration extends BodyDeclaration { // dispatch to correct overloaded match method return matcher.match(this, other); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -267,12 +267,12 @@ public class AnnotationTypeMemberDeclaration extends BodyDeclaration { } visitor.endVisit(this); } - + /** * Returns the name of the annotation type member declared in this declaration. - * + * * @return the member name node - */ + */ public SimpleName getName() { if (this.memberName == null) { // lazy init must be thread-safe for readers @@ -286,18 +286,18 @@ public class AnnotationTypeMemberDeclaration extends BodyDeclaration { } return this.memberName; } - + /** * Sets the name of the annotation type member declared in this declaration to the * given name. - * + * * @param memberName the new member name * @exception IllegalArgumentException if: * <ul> * <li>the node belongs to a different AST</li> * <li>the node already has a parent</li> * </ul> - */ + */ public void setName(SimpleName memberName) { if (memberName == null) { throw new IllegalArgumentException(); @@ -309,11 +309,11 @@ public class AnnotationTypeMemberDeclaration extends BodyDeclaration { } /** - * Returns the type of the annotation type member declared in this + * Returns the type of the annotation type member declared in this * declaration. - * + * * @return the type of the member - */ + */ public Type getType() { if (this.memberType == null) { // lazy init must be thread-safe for readers @@ -331,14 +331,14 @@ public class AnnotationTypeMemberDeclaration extends BodyDeclaration { /** * Sets the type of the annotation type member declared in this declaration * to the given type. - * + * * @param type the new member type * @exception IllegalArgumentException if: * <ul> * <li>the node belongs to a different AST</li> * <li>the node already has a parent</li> * </ul> - */ + */ public void setType(Type type) { if (type == null) { throw new IllegalArgumentException(); @@ -350,19 +350,19 @@ public class AnnotationTypeMemberDeclaration extends BodyDeclaration { } /** - * Returns the default value of this annotation type member, or + * Returns the default value of this annotation type member, or * <code>null</code> if there is none. - * + * * @return the expression node, or <code>null</code> if there is none - */ + */ public Expression getDefault() { return this.optionalDefaultValue; } - + /** * Sets or clears the default value of this annotation type member. - * - * @param defaultValue the expression node, or <code>null</code> if + * + * @param defaultValue the expression node, or <code>null</code> if * there is none * @exception IllegalArgumentException if: * <ul> @@ -370,7 +370,7 @@ public class AnnotationTypeMemberDeclaration extends BodyDeclaration { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setDefault(Expression defaultValue) { // a AnnotationTypeMemberDeclaration may occur inside an Expression - must check cycles ASTNode oldChild = this.optionalDefaultValue; @@ -378,7 +378,7 @@ public class AnnotationTypeMemberDeclaration extends BodyDeclaration { this.optionalDefaultValue = defaultValue; postReplaceChild(oldChild, defaultValue, DEFAULT_PROPERTY); } - + /** * Resolves and returns the binding for the annotation type member declared * in this declaration. @@ -386,10 +386,10 @@ public class AnnotationTypeMemberDeclaration extends BodyDeclaration { * Note that bindings are generally unavailable unless requested when the * AST is being built. * </p> - * - * @return the binding, or <code>null</code> if the binding cannot be + * + * @return the binding, or <code>null</code> if the binding cannot be * resolved - */ + */ public IMethodBinding resolveBinding() { return this.ast.getBindingResolver().resolveMember(this); } @@ -400,7 +400,7 @@ public class AnnotationTypeMemberDeclaration extends BodyDeclaration { int memSize() { return super.memSize() + 3 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AnonymousClassDeclaration.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AnonymousClassDeclaration.java index 97d407f22..23852df48 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AnonymousClassDeclaration.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AnonymousClassDeclaration.java @@ -23,7 +23,7 @@ import java.util.List; * AnonymousClassDeclaration: * <b>{</b> ClassBodyDeclaration <b>}</b> * </pre> - * + * * @see ClassInstanceCreation * @see EnumConstantDeclaration * @since 2.0 @@ -35,16 +35,16 @@ public class AnonymousClassDeclaration extends ASTNode { * The "bodyDeclarations" structural property of this node type. * @since 3.0 */ - public static final ChildListPropertyDescriptor BODY_DECLARATIONS_PROPERTY = + public static final ChildListPropertyDescriptor BODY_DECLARATIONS_PROPERTY = new ChildListPropertyDescriptor(AnonymousClassDeclaration.class, "bodyDeclarations", BodyDeclaration.class, CYCLE_RISK); //$NON-NLS-1$ - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List properyList = new ArrayList(2); createPropertyList(AnonymousClassDeclaration.class, properyList); @@ -55,34 +55,34 @@ public class AnonymousClassDeclaration extends ASTNode { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** * The body declarations (element type: <code>BodyDeclaration</code>). * Defaults to none. */ - private ASTNode.NodeList bodyDeclarations = + private ASTNode.NodeList bodyDeclarations = new ASTNode.NodeList(BODY_DECLARATIONS_PROPERTY); /** - * Creates a new AST node for an anonymous class declaration owned + * Creates a new AST node for an anonymous class declaration owned * by the given AST. By default, the list of body declarations is empty. * <p> - * N.B. This constructor is package-private; all subclasses must be - * declared in the same package; clients are unable to declare + * N.B. This constructor is package-private; all subclasses must be + * declared in the same package; clients are unable to declare * additional subclasses. * </p> - * + * * @param ast the AST that is to own this node */ AnonymousClassDeclaration(AST ast) { @@ -95,7 +95,7 @@ public class AnonymousClassDeclaration extends ASTNode { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -106,7 +106,7 @@ public class AnonymousClassDeclaration extends ASTNode { // allow default implementation to flag the error return super.internalGetChildListProperty(property); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -144,14 +144,14 @@ public class AnonymousClassDeclaration extends ASTNode { } visitor.endVisit(this); } - + /** * Returns the live ordered list of body declarations of this * anonymous class declaration. - * + * * @return the live list of body declarations * (element type: <code>BodyDeclaration</code>) - */ + */ public List bodyDeclarations() { return this.bodyDeclarations; } @@ -163,14 +163,14 @@ public class AnonymousClassDeclaration extends ASTNode { * Note that bindings are generally unavailable unless requested when the * AST is being built. * </p> - * - * @return the binding, or <code>null</code> if the binding cannot be + * + * @return the binding, or <code>null</code> if the binding cannot be * resolved - */ + */ public ITypeBinding resolveBinding() { return this.ast.getBindingResolver().resolveType(this); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -178,12 +178,12 @@ public class AnonymousClassDeclaration extends ASTNode { // treat Code as free return BASE_NODE_SIZE + 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int treeSize() { - return + return memSize() + this.bodyDeclarations.listSize(); } diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ArrayAccess.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ArrayAccess.java index 58e02e0e3..07a3b0d52 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ArrayAccess.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ArrayAccess.java @@ -21,33 +21,33 @@ import java.util.List; * ArrayAccess: * Expression <b>[</b> Expression <b>]</b> * </pre> - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ public class ArrayAccess extends Expression { - + /** * The "array" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor ARRAY_PROPERTY = + public static final ChildPropertyDescriptor ARRAY_PROPERTY = new ChildPropertyDescriptor(ArrayAccess.class, "array", Expression.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ /** * The "index" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor INDEX_PROPERTY = + public static final ChildPropertyDescriptor INDEX_PROPERTY = new ChildPropertyDescriptor(ArrayAccess.class, "index", Expression.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List properyList = new ArrayList(3); createPropertyList(ArrayAccess.class, properyList); @@ -59,18 +59,18 @@ public class ArrayAccess extends Expression { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** * The array expression; lazily initialized; defaults to an unspecified, * but legal, expression. @@ -84,13 +84,13 @@ public class ArrayAccess extends Expression { private Expression indexExpression = null; /** - * Creates a new unparented array access expression node owned by the given - * AST. By default, the array and index expresssions are unspecified, + * Creates a new unparented array access expression node owned by the given + * AST. By default, the array and index expresssions are unspecified, * but legal. * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ ArrayAccess(AST ast) { @@ -103,7 +103,7 @@ public class ArrayAccess extends Expression { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -127,7 +127,7 @@ public class ArrayAccess extends Expression { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -166,12 +166,12 @@ public class ArrayAccess extends Expression { } visitor.endVisit(this); } - + /** * Returns the array expression of this array access expression. - * + * * @return the array expression node - */ + */ public Expression getArray() { if (this.arrayExpression == null) { // lazy init must be thread-safe for readers @@ -185,10 +185,10 @@ public class ArrayAccess extends Expression { } return this.arrayExpression; } - + /** * Sets the array expression of this array access expression. - * + * * @param expression the array expression node * @exception IllegalArgumentException if: * <ul> @@ -196,7 +196,7 @@ public class ArrayAccess extends Expression { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setArray(Expression expression) { if (expression == null) { throw new IllegalArgumentException(); @@ -208,12 +208,12 @@ public class ArrayAccess extends Expression { this.arrayExpression = expression; postReplaceChild(oldChild, expression, ARRAY_PROPERTY); } - + /** * Returns the index expression of this array access expression. - * + * * @return the index expression node - */ + */ public Expression getIndex() { if (this.indexExpression == null) { // lazy init must be thread-safe for readers @@ -227,10 +227,10 @@ public class ArrayAccess extends Expression { } return this.indexExpression; } - + /** * Sets the index expression of this array access expression. - * + * * @param expression the index expression node * @exception IllegalArgumentException if: * <ul> @@ -238,7 +238,7 @@ public class ArrayAccess extends Expression { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setIndex(Expression expression) { if (expression == null) { throw new IllegalArgumentException(); diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ArrayCreation.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ArrayCreation.java index 2a57be45c..cca1072ba 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ArrayCreation.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ArrayCreation.java @@ -47,35 +47,35 @@ import java.util.List; * @noinstantiate This class is not intended to be instantiated by clients. */ public class ArrayCreation extends Expression { - + /** * The "type" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor TYPE_PROPERTY = + public static final ChildPropertyDescriptor TYPE_PROPERTY = new ChildPropertyDescriptor(ArrayCreation.class, "type", ArrayType.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ /** * The "dimensions" structural property of this node type. * @since 3.0 */ - public static final ChildListPropertyDescriptor DIMENSIONS_PROPERTY = + public static final ChildListPropertyDescriptor DIMENSIONS_PROPERTY = new ChildListPropertyDescriptor(ArrayCreation.class, "dimensions", Expression.class, CYCLE_RISK); //$NON-NLS-1$ /** * The "initializer" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor INITIALIZER_PROPERTY = + public static final ChildPropertyDescriptor INITIALIZER_PROPERTY = new ChildPropertyDescriptor(ArrayCreation.class, "initializer", ArrayInitializer.class, OPTIONAL, CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List properyList = new ArrayList(4); createPropertyList(ArrayCreation.class, properyList); @@ -88,18 +88,18 @@ public class ArrayCreation extends Expression { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** * The array type; lazily initialized; defaults to a unspecified, * legal array type. @@ -120,11 +120,11 @@ public class ArrayCreation extends Expression { private ArrayInitializer optionalInitializer = null; /** - * Creates a new AST node for an array creation expression owned by the + * Creates a new AST node for an array creation expression owned by the * given AST. By default, the array type is an unspecified 1-dimensional * array, the list of dimensions is empty, and there is no array * initializer. - * + * * @param ast the AST that is to own this node */ ArrayCreation(AST ast) { @@ -137,7 +137,7 @@ public class ArrayCreation extends Expression { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -161,7 +161,7 @@ public class ArrayCreation extends Expression { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -172,7 +172,7 @@ public class ArrayCreation extends Expression { // allow default implementation to flag the error return super.internalGetChildListProperty(property); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -214,12 +214,12 @@ public class ArrayCreation extends Expression { } visitor.endVisit(this); } - + /** * Returns the array type in this array creation expression. - * + * * @return the array type - */ + */ public ArrayType getType() { if (this.arrayType == null) { // lazy init must be thread-safe for readers @@ -237,14 +237,14 @@ public class ArrayCreation extends Expression { /** * Sets the array type in this array creation expression. - * + * * @param type the new array type * @exception IllegalArgumentException if: * <ul> * <li>the node belongs to a different AST</li> * <li>the node already has a parent</li> * </ul> - */ + */ public void setType(ArrayType type) { if (type == null) { throw new IllegalArgumentException(); @@ -255,32 +255,32 @@ public class ArrayCreation extends Expression { this.arrayType = type; postReplaceChild(oldChild, type, TYPE_PROPERTY); } - + /** * Returns the live ordered list of dimension expressions in this array * initializer. - * + * * @return the live list of dimension expressions * (element type: <code>Expression</code>) - */ + */ public List dimensions() { return this.dimensions; } - + /** - * Returns the array initializer of this array creation expression, or + * Returns the array initializer of this array creation expression, or * <code>null</code> if there is none. - * - * @return the array initializer node, or <code>null</code> if + * + * @return the array initializer node, or <code>null</code> if * there is none - */ + */ public ArrayInitializer getInitializer() { return this.optionalInitializer; } - + /** * Sets or clears the array initializer of this array creation expression. - * + * * @param initializer the array initializer node, or <code>null</code> * if there is none * @exception IllegalArgumentException if: @@ -289,7 +289,7 @@ public class ArrayCreation extends Expression { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setInitializer(ArrayInitializer initializer) { // an ArrayCreation may occur inside an ArrayInitializer // must check cycles @@ -305,7 +305,7 @@ public class ArrayCreation extends Expression { int memSize() { return BASE_NODE_SIZE + 3 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ArrayInitializer.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ArrayInitializer.java index 342faf063..ee91f5f91 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ArrayInitializer.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ArrayInitializer.java @@ -21,26 +21,26 @@ import java.util.List; * ArrayInitializer: * <b>{</b> [ Expression { <b>,</b> Expression} [ <b>,</b> ]] <b>}</b> * </pre> - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ public class ArrayInitializer extends Expression { - + /** * The "expressions" structural property of this node type. * @since 3.0 */ - public static final ChildListPropertyDescriptor EXPRESSIONS_PROPERTY = + public static final ChildListPropertyDescriptor EXPRESSIONS_PROPERTY = new ChildListPropertyDescriptor(ArrayInitializer.class, "expressions", Expression.class, CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List properyList = new ArrayList(2); createPropertyList(ArrayInitializer.class, properyList); @@ -51,18 +51,18 @@ public class ArrayInitializer extends Expression { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** * The list of expressions (element type: * <code>Expression</code>). Defaults to an empty list. @@ -71,13 +71,13 @@ public class ArrayInitializer extends Expression { new ASTNode.NodeList(EXPRESSIONS_PROPERTY); /** - * Creates a new AST node for an array initializer owned by the + * Creates a new AST node for an array initializer owned by the * given AST. By default, the list of expressions is empty. - * + * * @param ast the AST that is to own this node */ ArrayInitializer(AST ast) { - super(ast); + super(ast); } /* (omit javadoc for this method) @@ -86,7 +86,7 @@ public class ArrayInitializer extends Expression { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -133,24 +133,24 @@ public class ArrayInitializer extends Expression { } visitor.endVisit(this); } - + /** * Returns the live ordered list of expressions in this array initializer. - * - * @return the live list of expressions + * + * @return the live list of expressions * (element type: <code>Expression</code>) - */ + */ public List expressions() { return this.expressions; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int memSize() { return BASE_NODE_SIZE + 1 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ArrayType.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ArrayType.java index 25f8d9301..adceb01ba 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ArrayType.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ArrayType.java @@ -23,26 +23,26 @@ import java.util.List; * ArrayType: * Type <b>[</b> <b>]</b> * </pre> - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ public class ArrayType extends Type { - + /** * The "componentType" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor COMPONENT_TYPE_PROPERTY = + public static final ChildPropertyDescriptor COMPONENT_TYPE_PROPERTY = new ChildPropertyDescriptor(ArrayType.class, "componentType", Type.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List properyList = new ArrayList(2); createPropertyList(ArrayType.class, properyList); @@ -53,31 +53,31 @@ public class ArrayType extends Type { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - - /** + + /** * The component type; lazily initialized; defaults to a simple type with * an unspecfied, but legal, name. */ private Type componentType = null; - + /** * Creates a new unparented node for an array type owned by the given AST. * By default, a 1-dimensional array of an unspecified simple type. * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ ArrayType(AST ast) { @@ -90,7 +90,7 @@ public class ArrayType extends Type { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -106,7 +106,7 @@ public class ArrayType extends Type { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -142,13 +142,13 @@ public class ArrayType extends Type { } visitor.endVisit(this); } - + /** * Returns the component type of this array type. The component type * may be another array type. - * + * * @return the component type node - */ + */ public Type getComponentType() { if (this.componentType == null) { // lazy init must be thread-safe for readers @@ -166,7 +166,7 @@ public class ArrayType extends Type { /** * Sets the component type of this array type. The component type * may be another array type. - * + * * @param componentType the component type * @exception IllegalArgumentException if: * <ul> @@ -174,7 +174,7 @@ public class ArrayType extends Type { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setComponentType(Type componentType) { if (componentType == null) { throw new IllegalArgumentException(); @@ -190,11 +190,11 @@ public class ArrayType extends Type { * never an array type. * <p> * This is a convenience method that descends a chain of nested array types - * until it reaches a non-array type. + * until it reaches a non-array type. * </p> - * + * * @return the component type node - */ + */ public Type getElementType() { Type t = getComponentType(); while (t.isArrayType()) { @@ -202,16 +202,16 @@ public class ArrayType extends Type { } return t; } - + /** * Returns the number of dimensions in this array type. * <p> * This is a convenience method that descends a chain of nested array types - * until it reaches a non-array type. + * until it reaches a non-array type. * </p> - * + * * @return the number of dimensions (always positive) - */ + */ public int getDimensions() { Type t = getComponentType(); int dimensions = 1; // always include this array type @@ -221,20 +221,20 @@ public class ArrayType extends Type { } return dimensions; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int memSize() { return BASE_NODE_SIZE + 1 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int treeSize() { return - memSize() + memSize() + (this.componentType == null ? 0 : getComponentType().treeSize()); } } diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AssertStatement.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AssertStatement.java index c7720f9a4..88857cd6b 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AssertStatement.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/AssertStatement.java @@ -21,33 +21,33 @@ import java.util.List; * AssertStatement: * <b>assert</b> Expression [ <b>:</b> Expression ] <b>;</b> * </pre> - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ public class AssertStatement extends Statement { - + /** * The "expression" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor EXPRESSION_PROPERTY = + public static final ChildPropertyDescriptor EXPRESSION_PROPERTY = new ChildPropertyDescriptor(AssertStatement.class, "expression", Expression.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ /** * The "message" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor MESSAGE_PROPERTY = + public static final ChildPropertyDescriptor MESSAGE_PROPERTY = new ChildPropertyDescriptor(AssertStatement.class, "message", Expression.class, OPTIONAL, CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List properyList = new ArrayList(3); createPropertyList(AssertStatement.class, properyList); @@ -59,18 +59,18 @@ public class AssertStatement extends Statement { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** * The expression; lazily initialized; defaults to a unspecified, but legal, * expression. @@ -81,15 +81,15 @@ public class AssertStatement extends Statement { * The message expression; <code>null</code> for none; defaults to none. */ private Expression optionalMessageExpression = null; - + /** - * Creates a new unparented assert statement node owned by the given + * Creates a new unparented assert statement node owned by the given * AST. By default, the assert statement has an unspecified, but legal, * expression, and not message expression. * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ AssertStatement(AST ast) { @@ -102,7 +102,7 @@ public class AssertStatement extends Statement { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -168,12 +168,12 @@ public class AssertStatement extends Statement { } visitor.endVisit(this); } - + /** * Returns the first expression of this assert statement. - * + * * @return the expression node - */ + */ public Expression getExpression() { if (this.expression == null) { // lazy init must be thread-safe for readers @@ -187,10 +187,10 @@ public class AssertStatement extends Statement { } return this.expression; } - + /** * Sets the first expression of this assert statement. - * + * * @param expression the new expression node * @exception IllegalArgumentException if: * <ul> @@ -198,7 +198,7 @@ public class AssertStatement extends Statement { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setExpression(Expression expression) { if (expression == null) { throw new IllegalArgumentException(); @@ -211,20 +211,20 @@ public class AssertStatement extends Statement { } /** - * Returns the message expression of this assert statement, or + * Returns the message expression of this assert statement, or * <code>null</code> if there is none. - * - * @return the message expression node, or <code>null</code> if there + * + * @return the message expression node, or <code>null</code> if there * is none - */ + */ public Expression getMessage() { return this.optionalMessageExpression; } - + /** * Sets or clears the message expression of this assert statement. - * - * @param expression the message expression node, or <code>null</code> if + * + * @param expression the message expression node, or <code>null</code> if * there is none * @exception IllegalArgumentException if: * <ul> @@ -232,7 +232,7 @@ public class AssertStatement extends Statement { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setMessage(Expression expression) { // an AsertStatement may occur inside an Expression - must check cycles ASTNode oldChild = this.optionalMessageExpression; @@ -240,14 +240,14 @@ public class AssertStatement extends Statement { this.optionalMessageExpression = expression; postReplaceChild(oldChild, expression, MESSAGE_PROPERTY); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int memSize() { return super.memSize() + 2 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -256,7 +256,7 @@ public class AssertStatement extends Statement { memSize() + (this.expression == null ? 0 : getExpression().treeSize()) + (this.optionalMessageExpression == null ? 0 : getMessage().treeSize()); - + } } diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Assignment.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Assignment.java index 411c94641..bc19c3f1e 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Assignment.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Assignment.java @@ -23,12 +23,12 @@ import java.util.Map; * Assignment: * Expression AssignmentOperator Expression * </pre> - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ public class Assignment extends Expression { - + /** * Assignment operators (typesafe enumeration). * <pre> @@ -48,34 +48,34 @@ public class Assignment extends Expression { * </pre> */ public static class Operator { - + /** * The name of the operator */ private String op; - + /** * Creates a new assignment operator with the given name. * <p> * Note: this constructor is private. The only instances * ever created are the ones for the standard operators. * </p> - * + * * @param op the character sequence for the operator */ private Operator(String op) { this.op = op; } - + /** * Returns the character sequence for the operator. - * + * * @return the character sequence for the operator */ public String toString() { return this.op; } - + /** = operator. */ public static final Operator ASSIGN = new Operator("=");//$NON-NLS-1$ /** += operator. */ @@ -103,23 +103,23 @@ public class Assignment extends Expression { /** >>>= operator. */ public static final Operator RIGHT_SHIFT_UNSIGNED_ASSIGN = new Operator(">>>=");//$NON-NLS-1$ - + /** * Returns the assignment operator corresponding to the given string, * or <code>null</code> if none. * <p> * <code>toOperator</code> is the converse of <code>toString</code>: - * that is, <code>Operator.toOperator(op.toString()) == op</code> for all + * that is, <code>Operator.toOperator(op.toString()) == op</code> for all * operators <code>op</code>. * </p> - * + * * @param token the character sequence for the operator * @return the assignment operator, or <code>null</code> if none */ public static Operator toOperator(String token) { return (Operator) CODES.get(token); } - + /** * Map from token to operator (key type: <code>String</code>; * value type: <code>Operator</code>). @@ -146,35 +146,35 @@ public class Assignment extends Expression { } } } - + /** * The "leftHandSide" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor LEFT_HAND_SIDE_PROPERTY = + public static final ChildPropertyDescriptor LEFT_HAND_SIDE_PROPERTY = new ChildPropertyDescriptor(Assignment.class, "leftHandSide", Expression.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ /** * The "operator" structural property of this node type. * @since 3.0 */ - public static final SimplePropertyDescriptor OPERATOR_PROPERTY = + public static final SimplePropertyDescriptor OPERATOR_PROPERTY = new SimplePropertyDescriptor(Assignment.class, "operator", Assignment.Operator.class, MANDATORY); //$NON-NLS-1$ - + /** * The "rightHandSide" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor RIGHT_HAND_SIDE_PROPERTY = + public static final ChildPropertyDescriptor RIGHT_HAND_SIDE_PROPERTY = new ChildPropertyDescriptor(Assignment.class, "rightHandSide", Expression.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List properyList = new ArrayList(4); createPropertyList(Assignment.class, properyList); @@ -187,18 +187,18 @@ public class Assignment extends Expression { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** * The assignment operator; defaults to Assignment.Operator.ASSIGN */ @@ -217,10 +217,10 @@ public class Assignment extends Expression { private Expression rightHandSide = null; /** - * Creates a new AST node for an assignment expression owned by the given + * Creates a new AST node for an assignment expression owned by the given * AST. By default, the node has an assignment operator, and unspecified * left and right hand sides. - * + * * @param ast the AST that is to own this node */ Assignment(AST ast) { @@ -233,7 +233,7 @@ public class Assignment extends Expression { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -313,22 +313,22 @@ public class Assignment extends Expression { } visitor.endVisit(this); } - + /** * Returns the operator of this assignment expression. - * + * * @return the assignment operator - */ + */ public Assignment.Operator getOperator() { return this.assignmentOperator; } /** * Sets the operator of this assignment expression. - * + * * @param assignmentOperator the assignment operator * @exception IllegalArgumentException if the argument is incorrect - */ + */ public void setOperator(Assignment.Operator assignmentOperator) { if (assignmentOperator == null) { throw new IllegalArgumentException(); @@ -340,9 +340,9 @@ public class Assignment extends Expression { /** * Returns the left hand side of this assignment expression. - * + * * @return the left hand side node - */ + */ public Expression getLeftHandSide() { if (this.leftHandSide == null) { // lazy init must be thread-safe for readers @@ -356,10 +356,10 @@ public class Assignment extends Expression { } return this.leftHandSide; } - + /** * Sets the left hand side of this assignment expression. - * + * * @param expression the left hand side node * @exception IllegalArgumentException if: * <ul> @@ -367,7 +367,7 @@ public class Assignment extends Expression { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setLeftHandSide(Expression expression) { if (expression == null) { throw new IllegalArgumentException(); @@ -381,9 +381,9 @@ public class Assignment extends Expression { /** * Returns the right hand side of this assignment expression. - * + * * @return the right hand side node - */ + */ public Expression getRightHandSide() { if (this.rightHandSide == null) { // lazy init must be thread-safe for readers @@ -397,10 +397,10 @@ public class Assignment extends Expression { } return this.rightHandSide; } - + /** * Sets the right hand side of this assignment expression. - * + * * @param expression the right hand side node * @exception IllegalArgumentException if: * <ul> @@ -408,7 +408,7 @@ public class Assignment extends Expression { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setRightHandSide(Expression expression) { if (expression == null) { throw new IllegalArgumentException(); @@ -427,12 +427,12 @@ public class Assignment extends Expression { // treat Code as free return BASE_NODE_SIZE + 3 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int treeSize() { - return + return memSize() + (this.leftHandSide == null ? 0 : getLeftHandSide().treeSize()) + (this.rightHandSide == null ? 0 : getRightHandSide().treeSize()); diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BaseCallMessageSend.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BaseCallMessageSend.java index 94c0ee59c..7cb932b4a 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BaseCallMessageSend.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BaseCallMessageSend.java @@ -1,19 +1,19 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute for Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * $Id: BaseCallMessageSend.java 23416 2010-02-03 19:59:31Z stephan $ - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation @@ -25,7 +25,7 @@ import java.util.List; /** * NEW for OTDT - * + * * BaseCallMessageSend represents a 'base call' * inside a role method with 'callin' modifier (OTJLD §4.3), * e.g. @@ -34,7 +34,7 @@ import java.util.List; * Contained AST elements: * a selector name (<code>SimpleName</code>), e.g. <code>myRoleMethod<code>. * a List of argument expressions (<code>Expression</code>). - * + * * @author mkr * @version $Id: BaseCallMessageSend.java 23416 2010-02-03 19:59:31Z stephan $ */ @@ -44,32 +44,32 @@ public class BaseCallMessageSend extends Expression * The "name" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor NAME_PROPERTY = + public static final ChildPropertyDescriptor NAME_PROPERTY = new ChildPropertyDescriptor(BaseCallMessageSend.class, "name",//$NON-NLS-1$ SimpleName.class, MANDATORY, - NO_CYCLE_RISK); + NO_CYCLE_RISK); /** * The "arguments" structural property of this node type. * @since 3.0 */ - public static final ChildListPropertyDescriptor ARGUMENTS_PROPERTY = + public static final ChildListPropertyDescriptor ARGUMENTS_PROPERTY = new ChildListPropertyDescriptor(BaseCallMessageSend.class, "arguments",//$NON-NLS-1$ Expression.class, - CYCLE_RISK); + CYCLE_RISK); + + - - /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List propertyList = new ArrayList(3); @@ -82,24 +82,24 @@ public class BaseCallMessageSend extends Expression /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** * The method name; lazily initialized; */ private SimpleName _methodName = null; - + /** - * The list of argument expressions (element type: + * The list of argument expressions (element type: * <code>Expression</code>). Defaults to an empty list. */ private ASTNode.NodeList _arguments = @@ -108,7 +108,7 @@ public class BaseCallMessageSend extends Expression /** * Creates a new AST node for a tsuper expression owned by the given AST. * By default, there is no qualifier. - * + * * @param ast the AST that is to own this node */ BaseCallMessageSend(AST ast) @@ -120,12 +120,12 @@ public class BaseCallMessageSend extends Expression { return propertyDescriptors(apiLevel); } - + final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) { - + if (property == NAME_PROPERTY) { if (get) { @@ -137,11 +137,11 @@ public class BaseCallMessageSend extends Expression return null; } } - + // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + final List internalGetChildListProperty(ChildListPropertyDescriptor property) { if (property == ARGUMENTS_PROPERTY) @@ -165,7 +165,7 @@ public class BaseCallMessageSend extends Expression result.setSourceRange(this.getStartPosition(), this.getLength()); result.setName((SimpleName)_methodName.clone(target)); result.getArguments().addAll(ASTNode.copySubtrees(target, _arguments)); - return result; + return result; } final boolean subtreeMatch0(ASTMatcher matcher, Object other) @@ -184,15 +184,15 @@ public class BaseCallMessageSend extends Expression } visitor.endVisit(this); } - - + + /** * Returns the name of the method invoked in this expression. - * + * * @return the method name node - */ + */ public SimpleName getName() - { + { if (_methodName == null) { // lazy init must be thread-safe for readers @@ -208,19 +208,19 @@ public class BaseCallMessageSend extends Expression } return _methodName; } - + /** * Sets the name of the method invoked in this expression to the * given name. - * + * * @param name the new method name * @exception IllegalArgumentException if: * <ul> * <li>the node belongs to a different AST</li> * <li>the node already has a parent</li> * </ul> - */ - public void setName(SimpleName name) + */ + public void setName(SimpleName name) { if (name == null) { @@ -231,15 +231,15 @@ public class BaseCallMessageSend extends Expression _methodName = name; postReplaceChild(oldChild, name, NAME_PROPERTY); } - + /** - * Returns the ordered list of argument expressions in this + * Returns the ordered list of argument expressions in this * base call method send expression. - * - * @return the live list of argument expressions + * + * @return the live list of argument expressions * (element type: <code>Expression</code>) - */ - public List getArguments() + */ + public List getArguments() { return _arguments; } @@ -247,17 +247,17 @@ public class BaseCallMessageSend extends Expression /* (omit javadoc for this method) * Method declared on ASTNode. */ - int memSize() + int memSize() { - return BASE_NODE_SIZE + 4 * 4; + return BASE_NODE_SIZE + 4 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ - int treeSize() + int treeSize() { - return + return memSize() + (_methodName == null ? 0 : _methodName.treeSize()) + (_arguments == null ? 0 : _arguments.listSize()); @@ -267,7 +267,7 @@ public class BaseCallMessageSend extends Expression { return this.ast.getBindingResolver().resolveMethod(this); } - - - + + + } diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BaseConstructorInvocation.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BaseConstructorInvocation.java index 25f4c5126..8a01a2618 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BaseConstructorInvocation.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BaseConstructorInvocation.java @@ -1,19 +1,19 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute for Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * $Id: BaseConstructorInvocation.java 23416 2010-02-03 19:59:31Z stephan $ - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation @@ -25,23 +25,23 @@ import java.util.List; /** * NEW for OTDT - * + * * BaseConstructorMessageSend represents a 'base call' to a constructor of the - * role's base class (OTJLD §2.4.2), + * role's base class (OTJLD §2.4.2), * e.g. <code>base();</code> or <code>base(arg1, arg2);</code>. - * + * * Contained AST elements: * a list of argument expressions (<code>Expression</code>). - * + * * Locations in source code: * This node can only be used within role constructor bodies, i.e. it appears in * ordinary <code>ExpressionStatement</code>s only. - * + * * Contrary to org.eclipse.jdt.internal.compiler.ast.BaseConstructorMessageSend * this is not an assignment. In the compiler ast * "base(args)" is translated to "_OT$base = new BaseClass(args);". * In the dom ast we just need "base(args);". - * + * * @author mkr * @version $Id: BaseConstructorInvocation.java 23416 2010-02-03 19:59:31Z stephan $ */ @@ -51,16 +51,16 @@ public class BaseConstructorInvocation extends Statement * The "arguments" structural property of this node type. * @since 3.0 */ - public static final ChildListPropertyDescriptor ARGUMENTS_PROPERTY = + public static final ChildListPropertyDescriptor ARGUMENTS_PROPERTY = new ChildListPropertyDescriptor(BaseConstructorInvocation.class, "arguments", Expression.class, CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List propertyList = new ArrayList(2); @@ -72,10 +72,10 @@ public class BaseConstructorInvocation extends Statement /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) */ public static List propertyDescriptors(int apiLevel) @@ -84,7 +84,7 @@ public class BaseConstructorInvocation extends Statement } /** - * The list of argument expressions (element type: + * The list of argument expressions (element type: * <code>Expression</code>). Defaults to an empty list. */ private ASTNode.NodeList _arguments = @@ -93,7 +93,7 @@ public class BaseConstructorInvocation extends Statement /** * Creates a new AST node for a base expression owned by the given AST. * By default, there is no qualifier. - * + * * @param ast the AST that is to own this node */ BaseConstructorInvocation(AST ast) @@ -102,13 +102,13 @@ public class BaseConstructorInvocation extends Statement } /** - * Returns the live ordered list of argument expressions in this + * Returns the live ordered list of argument expressions in this * base constructor invocation expression. - * - * @return the live list of argument expressions + * + * @return the live list of argument expressions * (element type: <code>Expression</code>) - */ - public List getArguments() + */ + public List getArguments() { return _arguments; } @@ -118,9 +118,9 @@ public class BaseConstructorInvocation extends Statement return propertyDescriptors(apiLevel); } - final List internalGetChildListProperty(ChildListPropertyDescriptor property) + final List internalGetChildListProperty(ChildListPropertyDescriptor property) { - if (property == ARGUMENTS_PROPERTY) + if (property == ARGUMENTS_PROPERTY) { return getArguments(); } @@ -143,7 +143,7 @@ public class BaseConstructorInvocation extends Statement return result; } - + final boolean subtreeMatch0(ASTMatcher matcher, Object other) { // dispatch to correct overloaded match method @@ -153,32 +153,32 @@ public class BaseConstructorInvocation extends Statement void accept0(ASTVisitor visitor) { boolean visitChildren = visitor.visit(this); - - if (visitChildren) + + if (visitChildren) { // visit children in normal left to right reading order acceptChildren(visitor, _arguments); } visitor.endVisit(this); } - + int memSize() { // treat Operator as free return BASE_NODE_SIZE + 1 * 4; } - + int treeSize() { - return memSize() + (_arguments == null - ? 0 + return memSize() + (_arguments == null + ? 0 : _arguments.listSize()); } - + public IMethodBinding resolveConstructorBinding() { return this.ast.getBindingResolver().resolveConstructor(this); } - + } diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BindingComparator.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BindingComparator.java index 27aff86ea..ed3a8aa82 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BindingComparator.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BindingComparator.java @@ -28,7 +28,7 @@ import org.eclipse.jdt.internal.compiler.lookup.WildcardBinding; /** * Internal helper class for comparing bindings. - * + * * @since 3.1 */ class BindingComparator { @@ -58,7 +58,7 @@ class BindingComparator { } return true; } - + /** * @param declaringElement * @param declaringElement2 @@ -104,12 +104,12 @@ class BindingComparator { } return false; } - + static boolean isEqual(org.eclipse.jdt.internal.compiler.lookup.MethodBinding methodBinding, org.eclipse.jdt.internal.compiler.lookup.MethodBinding methodBinding2) { return isEqual(methodBinding, methodBinding2, new HashSet()); } - + static boolean isEqual(org.eclipse.jdt.internal.compiler.lookup.MethodBinding methodBinding, org.eclipse.jdt.internal.compiler.lookup.MethodBinding methodBinding2, HashSet visitedTypes) { @@ -118,13 +118,13 @@ class BindingComparator { } if (methodBinding2 == null) return false; return CharOperation.equals(methodBinding.selector, methodBinding2.selector) - && isEqual(methodBinding.returnType, methodBinding2.returnType, visitedTypes) + && isEqual(methodBinding.returnType, methodBinding2.returnType, visitedTypes) && isEqual(methodBinding.thrownExceptions, methodBinding2.thrownExceptions, visitedTypes) && isEqual(methodBinding.declaringClass, methodBinding2.declaringClass, visitedTypes) && isEqual(methodBinding.typeVariables, methodBinding2.typeVariables, visitedTypes) && isEqual(methodBinding.parameters, methodBinding2.parameters, visitedTypes); } - + static boolean isEqual(org.eclipse.objectteams.otdt.internal.core.compiler.lookup.CallinCalloutBinding mapping, org.eclipse.objectteams.otdt.internal.core.compiler.lookup.CallinCalloutBinding mapping2) { @@ -209,21 +209,21 @@ class BindingComparator { return false; // TODO(SH): Should this method use AccOTTypeJustFlag instead of AccJustFlag? - + switch (typeBinding.kind()) { case Binding.BASE_TYPE : if (!typeBinding2.isBaseType()) { return false; } return typeBinding.id == typeBinding2.id; - + case Binding.ARRAY_TYPE : if (!typeBinding2.isArrayType()) { return false; } return typeBinding.dimensions() == typeBinding2.dimensions() && isEqual(typeBinding.leafComponentType(), typeBinding2.leafComponentType(), visitedTypes); - + case Binding.PARAMETERIZED_TYPE : if (!typeBinding2.isParameterizedType()) { return false; @@ -235,7 +235,7 @@ class BindingComparator { == (parameterizedTypeBinding2.modifiers & (ExtraCompilerModifiers.AccJustFlag | ClassFileConstants.AccInterface | ClassFileConstants.AccEnum | ClassFileConstants.AccAnnotation)) && isEqual(parameterizedTypeBinding.arguments, parameterizedTypeBinding2.arguments, visitedTypes) && isEqual(parameterizedTypeBinding.enclosingType(), parameterizedTypeBinding2.enclosingType(), visitedTypes); - + case Binding.WILDCARD_TYPE : if (typeBinding2.kind() != Binding.WILDCARD_TYPE) { return false; @@ -244,7 +244,7 @@ class BindingComparator { WildcardBinding wildcardBinding2 = (WildcardBinding) typeBinding2; return isEqual(wildcardBinding.bound, wildcardBinding2.bound, visitedTypes) && wildcardBinding.boundKind == wildcardBinding2.boundKind; - + case Binding.INTERSECTION_TYPE: if (typeBinding2.kind() != Binding.INTERSECTION_TYPE) { return false; @@ -253,7 +253,7 @@ class BindingComparator { WildcardBinding intersectionBinding2 = (WildcardBinding) typeBinding2; return isEqual(intersectionBinding.bound, intersectionBinding2.bound, visitedTypes) && isEqual(intersectionBinding.otherBounds, intersectionBinding2.otherBounds, visitedTypes); - + case Binding.TYPE_PARAMETER : if (!(typeBinding2.isTypeVariable())) { return false; @@ -267,7 +267,7 @@ class BindingComparator { if (captureBinding.position == captureBinding2.position) { if (visitedTypes.contains(typeBinding)) return true; visitedTypes.add(typeBinding); - + return isEqual(captureBinding.wildcard, captureBinding2.wildcard, visitedTypes) && isEqual(captureBinding.sourceType, captureBinding2.sourceType, visitedTypes); } @@ -300,12 +300,12 @@ class BindingComparator { default : if (!(typeBinding2 instanceof ReferenceBinding)) { return false; - } -//{ObjectTeams: avoid confusion between class/ifc parts of a role: + } +//{ObjectTeams: avoid confusion between class/ifc parts of a role: /* orig: referenceBinding = (ReferenceBinding) typeBinding; referenceBinding2 = (ReferenceBinding) typeBinding2; - :giro */ + :giro */ referenceBinding = ((ReferenceBinding) typeBinding).getRealType(); referenceBinding2 = ((ReferenceBinding) typeBinding2).getRealType(); // SH} diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BindingResolver.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BindingResolver.java index 0b2424805..07374fb48 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BindingResolver.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BindingResolver.java @@ -145,8 +145,8 @@ class BindingResolver { //{ObjectTeams: new retrieval: IMethodMappingBinding getMethodMappingBinding(org.eclipse.objectteams.otdt.internal.core.compiler.lookup.CallinCalloutBinding callbinding) { return null; - } -// SH} + } +// SH} /** * Returns the new member value pair binding corresponding to the given old value pair binding. * <p> @@ -602,7 +602,7 @@ class BindingResolver { } //{ObjectTeams: resolve bindings for OT-specific nodes - + IMethodBinding resolveConstructor(BaseConstructorInvocation constructor) { return null; @@ -613,12 +613,12 @@ class BindingResolver { return null; } - + IMethodBinding resolveMethod(BaseCallMessageSend method) { return null; - } - + } + IMethodBinding resolveMethod(MethodSpec method) { @@ -628,8 +628,8 @@ class BindingResolver { IMethodBinding resolveMethod(TSuperMessageSend method) { return null; - } - + } + IMethodMappingBinding resolveMethodMapping(AbstractMethodMappingDeclaration mapping) { return null; diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Block.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Block.java index 23c429af4..b5921c207 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Block.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Block.java @@ -21,26 +21,26 @@ import java.util.List; * Block: * <b>{</b> { Statement } <b>}</b> * </pre> - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ public class Block extends Statement { - + /** * The "statements" structural property of this node type. * @since 3.0 */ - public static final ChildListPropertyDescriptor STATEMENTS_PROPERTY = + public static final ChildListPropertyDescriptor STATEMENTS_PROPERTY = new ChildListPropertyDescriptor(Block.class, "statements", Statement.class, CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List properyList = new ArrayList(2); createPropertyList(Block.class, properyList); @@ -51,22 +51,22 @@ public class Block extends Statement { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** - * The list of statements (element type: <code>Statement</code>). + * The list of statements (element type: <code>Statement</code>). * Defaults to an empty list. */ - private ASTNode.NodeList statements = + private ASTNode.NodeList statements = new ASTNode.NodeList(STATEMENTS_PROPERTY); /** @@ -75,7 +75,7 @@ public class Block extends Statement { * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ Block(AST ast) { @@ -88,7 +88,7 @@ public class Block extends Statement { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -137,28 +137,28 @@ public class Block extends Statement { } visitor.endVisit(this); } - + /** * Returns the live list of statements in this block. Adding and * removing nodes from this list affects this node dynamically. * All nodes in this list must be <code>Statement</code>s; * attempts to add any other type of node will trigger an * exception. - * + * * @return the live list of statements in this block * (element type: <code>Statement</code>) - */ + */ public List statements() { return this.statements; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int memSize() { return super.memSize() + 1 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BlockComment.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BlockComment.java index 88d89866d..72534c61f 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BlockComment.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BlockComment.java @@ -29,19 +29,19 @@ import java.util.List; * was found in a source string. It is not useful for creating * comments. * </p> - * + * * @since 3.0 * @noinstantiate This class is not intended to be instantiated by clients. */ public final class BlockComment extends Comment { - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List properyList = new ArrayList(1); createPropertyList(BlockComment.class, properyList); @@ -51,24 +51,24 @@ public final class BlockComment extends Comment { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** * Creates a new block comment node owned by the given AST. * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ BlockComment(AST ast) { @@ -81,7 +81,7 @@ public final class BlockComment extends Comment { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -113,14 +113,14 @@ public final class BlockComment extends Comment { visitor.visit(this); visitor.endVisit(this); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int memSize() { return super.memSize(); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BodyDeclaration.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BodyDeclaration.java index 6ac9d9c22..dd9ca6b0c 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BodyDeclaration.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BodyDeclaration.java @@ -15,7 +15,7 @@ import java.util.Iterator; import java.util.List; /** - * Abstract base class of all AST nodes that represent body declarations + * Abstract base class of all AST nodes that represent body declarations * that may appear in the body of some kind of class or interface declaration, * including anonymous class declarations, enumeration declarations, and * enumeration constant declarations. @@ -51,11 +51,11 @@ import java.util.List; * doc comment; Initializer is the only ones that does not. The source range * for body declarations always includes the doc comment if present. * </p> - * + * * @since 2.0 */ public abstract class BodyDeclaration extends ASTNode { - + /** * The doc comment, or <code>null</code> if none. * Defaults to none. @@ -68,20 +68,20 @@ public abstract class BodyDeclaration extends ASTNode { * @since 3.0 - field was moved up from subclasses */ private int modifierFlags = Modifier.NONE; - + /** - * The extended modifiers (element type: <code>IExtendedModifier</code>). + * The extended modifiers (element type: <code>IExtendedModifier</code>). * Null in JLS2. Added in JLS3; defaults to an empty list * (see constructor). - * + * * @since 3.0 */ ASTNode.NodeList modifiers = null; - + /** * Returns structural property descriptor for the "modifiers" property * of this node as used in JLS2. - * + * * @return the property descriptor */ abstract SimplePropertyDescriptor internalModifiersProperty(); @@ -89,7 +89,7 @@ public abstract class BodyDeclaration extends ASTNode { /** * Returns structural property descriptor for the "modifiers" property * of this node as used in JLS3. - * + * * @return the property descriptor */ abstract ChildListPropertyDescriptor internalModifiers2Property(); @@ -97,7 +97,7 @@ public abstract class BodyDeclaration extends ASTNode { /** * Returns structural property descriptor for the "modifiers" property * of this node as used in JLS3. - * + * * @return the property descriptor * @since 3.1 */ @@ -109,7 +109,7 @@ public abstract class BodyDeclaration extends ASTNode { /** * Returns structural property descriptor for the "javadoc" property * of this node. - * + * * @return the property descriptor */ abstract ChildPropertyDescriptor internalJavadocProperty(); @@ -117,7 +117,7 @@ public abstract class BodyDeclaration extends ASTNode { /** * Returns structural property descriptor for the "javadoc" property * of this node. - * + * * @return the property descriptor * @since 3.1 */ @@ -128,40 +128,40 @@ public abstract class BodyDeclaration extends ASTNode { /** * Creates and returns a structural property descriptor for the * "javadoc" property declared on the given concrete node type. - * + * * @return the property descriptor */ static final ChildPropertyDescriptor internalJavadocPropertyFactory(Class nodeClass) { return new ChildPropertyDescriptor(nodeClass, "javadoc", Javadoc.class, OPTIONAL, NO_CYCLE_RISK); //$NON-NLS-1$ } - + /** * Creates and returns a structural property descriptor for the * "modifiers" property declared on the given concrete node type. - * + * * @return the property descriptor */ static final SimplePropertyDescriptor internalModifiersPropertyFactory(Class nodeClass) { return new SimplePropertyDescriptor(nodeClass, "modifiers", int.class, MANDATORY); //$NON-NLS-1$ } - + /** * Creates and returns a structural property descriptor for the * "modifiers" property declared on the given concrete node type. - * + * * @return the property descriptor */ static final ChildListPropertyDescriptor internalModifiers2PropertyFactory(Class nodeClass) { return new ChildListPropertyDescriptor(nodeClass, "modifiers", IExtendedModifier.class, CYCLE_RISK); //$NON-NLS-1$ } - + /** - * Creates a new AST node for a body declaration node owned by the + * Creates a new AST node for a body declaration node owned by the * given AST. * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ BodyDeclaration(AST ast) { @@ -170,10 +170,10 @@ public abstract class BodyDeclaration extends ASTNode { this.modifiers = new ASTNode.NodeList(internalModifiers2Property()); } } - + /** * Returns the doc comment node. - * + * * @return the doc comment node, or <code>null</code> if none */ public Javadoc getJavadoc() { @@ -182,7 +182,7 @@ public abstract class BodyDeclaration extends ASTNode { /** * Sets or clears the doc comment node. - * + * * @param docComment the doc comment node, or <code>null</code> if none * @exception IllegalArgumentException if the doc comment string is invalid */ @@ -200,10 +200,10 @@ public abstract class BodyDeclaration extends ASTNode { * In the JLS3 API, this method is a convenience method that * computes these flags from <code>modifiers()</code>. * </p> - * + * * @return the bit-wise or of <code>Modifier</code> constants * @see Modifier - */ + */ public int getModifiers() { // more efficient than checking getAST().API_LEVEL if (this.modifiers == null) { @@ -226,18 +226,18 @@ public abstract class BodyDeclaration extends ASTNode { /** * Sets the modifiers explicitly specified on this declaration (JLS2 API only). - * + * * @param modifiers the given modifiers (bit-wise or of <code>Modifier</code> constants) * @exception UnsupportedOperationException if this operation is used in * an AST later than JLS2 * @see Modifier - * @deprecated In the JLS3 API, this method is replaced by + * @deprecated In the JLS3 API, this method is replaced by * {@link #modifiers()} which contains a list of a <code>Modifier</code> nodes. - */ + */ public void setModifiers(int modifiers) { internalSetModifiers(modifiers); } - + /** * Internal synonym for deprecated method. Used to avoid * deprecation warnings. @@ -257,13 +257,13 @@ public abstract class BodyDeclaration extends ASTNode { /** * Returns the live ordered list of modifiers and annotations * of this declaration (added in JLS3 API). - * + * * @return the live list of modifiers and annotations * (element type: <code>IExtendedModifier</code>) * @exception UnsupportedOperationException if this operation is used in * a JLS2 AST * @since 3.1 - */ + */ public List modifiers() { // more efficient than just calling unsupportedIn2() to check if (this.modifiers == null) { @@ -271,7 +271,7 @@ public abstract class BodyDeclaration extends ASTNode { } return this.modifiers; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BooleanLiteral.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BooleanLiteral.java index f9da563a9..7cc80cfe1 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BooleanLiteral.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BooleanLiteral.java @@ -16,32 +16,32 @@ import java.util.List; /** * Boolean literal node. - * + * * <pre> * BooleanLiteral: * <b>true</b> * <b>false</b> * </pre> - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ public class BooleanLiteral extends Expression { - + /** * The "booleanValue" structural property of this node type. * @since 3.0 */ - public static final SimplePropertyDescriptor BOOLEAN_VALUE_PROPERTY = + public static final SimplePropertyDescriptor BOOLEAN_VALUE_PROPERTY = new SimplePropertyDescriptor(BooleanLiteral.class, "booleanValue", boolean.class, MANDATORY); //$NON-NLS-1$ - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List properyList = new ArrayList(2); createPropertyList(BooleanLiteral.class, properyList); @@ -52,18 +52,18 @@ public class BooleanLiteral extends Expression { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** * The boolean; defaults to the literal for <code>false</code>. */ @@ -74,7 +74,7 @@ public class BooleanLiteral extends Expression { * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ BooleanLiteral(AST ast) { @@ -87,7 +87,7 @@ public class BooleanLiteral extends Expression { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -103,7 +103,7 @@ public class BooleanLiteral extends Expression { // allow default implementation to flag the error return super.internalGetSetBooleanProperty(property, get, newValue); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -136,25 +136,25 @@ public class BooleanLiteral extends Expression { visitor.visit(this); visitor.endVisit(this); } - + /** * Returns the boolean value of this boolean literal node. - * + * * @return <code>true</code> for the boolean literal spelled - * <code>"true"</code>, and <code>false</code> for the boolean literal + * <code>"true"</code>, and <code>false</code> for the boolean literal * spelled <code>"false"</code>. - */ + */ public boolean booleanValue() { return this.value; } - + /** * Sets the boolean value of this boolean literal node. - * + * * @param value <code>true</code> for the boolean literal spelled - * <code>"true"</code>, and <code>false</code> for the boolean literal + * <code>"true"</code>, and <code>false</code> for the boolean literal * spelled <code>"false"</code>. - */ + */ public void setBooleanValue(boolean value) { preValueChange(BOOLEAN_VALUE_PROPERTY); this.value = value; @@ -167,7 +167,7 @@ public class BooleanLiteral extends Expression { int memSize() { return BASE_NODE_SIZE + 1 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BreakStatement.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BreakStatement.java index 0086aa565..2f0c046e0 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BreakStatement.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/BreakStatement.java @@ -21,26 +21,26 @@ import java.util.List; * BreakStatement: * <b>break</b> [ Identifier ] <b>;</b> * </pre> - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ public class BreakStatement extends Statement { - + /** * The "label" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor LABEL_PROPERTY = + public static final ChildPropertyDescriptor LABEL_PROPERTY = new ChildPropertyDescriptor(BreakStatement.class, "label", SimpleName.class, OPTIONAL, NO_CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List properyList = new ArrayList(2); createPropertyList(BreakStatement.class, properyList); @@ -51,30 +51,30 @@ public class BreakStatement extends Statement { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** * The label, or <code>null</code> if none; none by default. */ private SimpleName optionalLabel = null; /** - * Creates a new unparented break statement node owned by the given + * Creates a new unparented break statement node owned by the given * AST. By default, the break statement has no label. * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ BreakStatement(AST ast) { @@ -87,7 +87,7 @@ public class BreakStatement extends Statement { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -103,7 +103,7 @@ public class BreakStatement extends Statement { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -140,42 +140,42 @@ public class BreakStatement extends Statement { } visitor.endVisit(this); } - + /** * Returns the label of this break statement, or <code>null</code> if * there is none. - * + * * @return the label, or <code>null</code> if there is none - */ + */ public SimpleName getLabel() { return this.optionalLabel; } - + /** * Sets or clears the label of this break statement. - * - * @param label the label, or <code>null</code> if + * + * @param label the label, or <code>null</code> if * there is none * @exception IllegalArgumentException if: * <ul> * <li>the node belongs to a different AST</li> * <li>the node already has a parent</li> * </ul> - */ + */ public void setLabel(SimpleName label) { ASTNode oldChild = this.optionalLabel; preReplaceChild(oldChild, label, LABEL_PROPERTY); this.optionalLabel = label; postReplaceChild(oldChild, label, LABEL_PROPERTY); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int memSize() { return super.memSize() + 1 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CallinMappingDeclaration.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CallinMappingDeclaration.java index 9ae92ffc4..79c8bdc54 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CallinMappingDeclaration.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CallinMappingDeclaration.java @@ -1,19 +1,19 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute for Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * $Id: CallinMappingDeclaration.java 23416 2010-02-03 19:59:31Z stephan $ - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation @@ -26,32 +26,32 @@ import java.util.List; /** * NEW for OTDT - * + * * Represents a callin binding of a role method with one ore more base methods (OTJLD §4). * Callin bindings must have one modifier (before, replace, after) * and may have parameter mappings. A replace callin may also have a result mapping. * e.g.: - * + * * ranges from: * <code>roleMethod <- after baseMethod;</code> * to: * <pre> * void roleMethod(MyObject obj) <- - * after char[] baseMethod(String name, SomeClass cls) with + * after char[] baseMethod(String name, SomeClass cls) with * { - * obj <- cls.foo(), + * obj <- cls.foo(), * } * </pre> * or: * <pre> * char[] roleMethod(MyObject obj) <- - * replace char[] baseMethod(MyObject o, String name) with + * replace char[] baseMethod(MyObject o, String name) with * { * obj <- o, - * result <- result + * result <- result * } * </pre> - * + * * Callin bindings consist of * <ol> * <li> a name as mentioned in source code or a generated name "<File:Line,Col>". @@ -66,27 +66,27 @@ import java.util.List; * <li> result mapping (only replace) * </ol> * </ol> - * + * * Callin bindinds can be used in the following AST-nodes: * TypeDeclaration (compiler ast) * RoleTypeDeclaration (dom/ast) - * + * * @author mkr */ public class CallinMappingDeclaration extends AbstractMethodMappingDeclaration { public static final String CALLIN = "<-"; //$NON-NLS-1$ - + /** - * Creates a new AST node for a callin mapping declaration owned + * Creates a new AST node for a callin mapping declaration owned * by the given AST. By default, the declaration is for a callin mapping * of an unspecified, but legal, name; * <p> - * N.B. This constructor is package-private; all subclasses must be - * declared in the same package; clients are unable to declare + * N.B. This constructor is package-private; all subclasses must be + * declared in the same package; clients are unable to declare * additional subclasses. * </p> - * + * * @param ast the AST that is to own this node */ CallinMappingDeclaration(AST ast) @@ -97,27 +97,27 @@ public class CallinMappingDeclaration extends AbstractMethodMappingDeclaration /** * The "names" structural property of this node type. */ - public static final ChildPropertyDescriptor NAME_PROPERTY = + public static final ChildPropertyDescriptor NAME_PROPERTY = new ChildPropertyDescriptor(CallinMappingDeclaration.class, "name", SimpleName.class, OPTIONAL, NO_CYCLE_RISK); //$NON-NLS-1$ - + /** * The "modifiers" structural property of this node type (added in JLS3 API). * @since 3.1 */ - public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = + public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = internalModifiers2PropertyFactory(CallinMappingDeclaration.class); - + /** * The "javadoc" structural property of this node type. */ - public static final ChildPropertyDescriptor JAVADOC_PROPERTY = + public static final ChildPropertyDescriptor JAVADOC_PROPERTY = internalJavadocPropertyFactory(CallinMappingDeclaration.class); /** * The "roleMappingElement" structural property of this node type. */ - public static final ChildPropertyDescriptor ROLE_MAPPING_ELEMENT_PROPERTY = + public static final ChildPropertyDescriptor ROLE_MAPPING_ELEMENT_PROPERTY = new ChildPropertyDescriptor(CallinMappingDeclaration.class, "roleMappingElement", MethodMappingElement.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ /** @@ -130,44 +130,44 @@ public class CallinMappingDeclaration extends AbstractMethodMappingDeclaration /** * The "baseMappingElements" structural property of this node type. */ - public static final ChildListPropertyDescriptor BASE_MAPPING_ELEMENTS_PROPERTY = + public static final ChildListPropertyDescriptor BASE_MAPPING_ELEMENTS_PROPERTY = new ChildListPropertyDescriptor(CallinMappingDeclaration.class, "baseMappingElements", MethodMappingElement.class, NO_CYCLE_RISK); //$NON-NLS-1$ - + /** * The "guardPredicate" structural property of this node type. * @since 0.9.25 */ - public static final ChildPropertyDescriptor GUARD_PROPERTY = + public static final ChildPropertyDescriptor GUARD_PROPERTY = new ChildPropertyDescriptor(CallinMappingDeclaration.class, "guardPredicate", GuardPredicateDeclaration.class, OPTIONAL, NO_CYCLE_RISK); //$NON-NLS-1$ /** * The "parameter mappings" structural property of this node type. */ - public static final ChildListPropertyDescriptor PARAMETER_MAPPINGS_PROPERTY = + public static final ChildListPropertyDescriptor PARAMETER_MAPPINGS_PROPERTY = internalParameterMappingPropertyFactory(CallinMappingDeclaration.class); - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS_2_0; - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS_3_0; - + private SimpleName _labelName = null; - + private MethodMappingElement _roleMappingElement = null; // FIXME(SH): should be MethodSpec?? ASTNode.NodeList _baseMappingElements = new ASTNode.NodeList(BASE_MAPPING_ELEMENTS_PROPERTY); - + GuardPredicateDeclaration _optionalGuardPredicate = null; - + static { List propertyList = new ArrayList(7); @@ -188,17 +188,17 @@ public class CallinMappingDeclaration extends AbstractMethodMappingDeclaration addProperty(ROLE_MAPPING_ELEMENT_PROPERTY, propertyList); addProperty(BINDING_OPERATOR_PROPERTY, propertyList); addProperty(BASE_MAPPING_ELEMENTS_PROPERTY, propertyList); - addProperty(GUARD_PROPERTY, propertyList); + addProperty(GUARD_PROPERTY, propertyList); addProperty(PARAMETER_MAPPINGS_PROPERTY, propertyList); PROPERTY_DESCRIPTORS_3_0 = reapPropertyList(propertyList); } - + /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the AST.JLS* constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) */ public static List propertyDescriptors(int apiLevel) @@ -208,13 +208,13 @@ public class CallinMappingDeclaration extends AbstractMethodMappingDeclaration else return PROPERTY_DESCRIPTORS_2_0; } - + final SimplePropertyDescriptor internalModifiersProperty() { throw new UnsupportedOperationException("JLS2 not supported"); //$NON-NLS-1$ } - final ChildListPropertyDescriptor internalModifiers2Property() + final ChildListPropertyDescriptor internalModifiers2Property() { return MODIFIERS2_PROPERTY; } @@ -275,7 +275,7 @@ public class CallinMappingDeclaration extends AbstractMethodMappingDeclaration // allow default implementation to flag the error (incl. handling of elements common to all method mappings): return super.internalGetSetChildProperty(property, get, child); } - + final List internalGetChildListProperty(ChildListPropertyDescriptor property) { if(property == MODIFIERS2_PROPERTY) @@ -286,11 +286,11 @@ public class CallinMappingDeclaration extends AbstractMethodMappingDeclaration if (property == PARAMETER_MAPPINGS_PROPERTY) return getParameterMappings(); - + // allow default implementation to flag the error return super.internalGetChildListProperty(property); } - + ChildPropertyDescriptor internalJavadocProperty() { return JAVADOC_PROPERTY; @@ -311,7 +311,7 @@ public class CallinMappingDeclaration extends AbstractMethodMappingDeclaration { CallinMappingDeclaration result = new CallinMappingDeclaration(target); result.setName(this.getName()); - if (this.ast.apiLevel >= AST.JLS3) + if (this.ast.apiLevel >= AST.JLS3) result.modifiers().addAll(ASTNode.copySubtrees(target, modifiers())); // annotations result.setSourceRange(this.getStartPosition(), this.getLength()); result.setJavadoc( @@ -353,7 +353,7 @@ public class CallinMappingDeclaration extends AbstractMethodMappingDeclaration } visitor.endVisit(this); } - + void appendDebugString(StringBuffer buffer) { if (getName() != null) { buffer.append(getName().getIdentifier()); @@ -361,18 +361,18 @@ public class CallinMappingDeclaration extends AbstractMethodMappingDeclaration } super.appendDebugString(buffer); } - + int treeSize() { - return memSize() + (super.optionalDocComment == null - ? 0 + return memSize() + (super.optionalDocComment == null + ? 0 : getJavadoc().treeSize()); } /** * Returns the method spec left of the callin arrow. * @return the left method spec, i.e. the declaring role method - */ + */ @Override public MethodMappingElement getRoleMappingElement() { @@ -391,18 +391,18 @@ public class CallinMappingDeclaration extends AbstractMethodMappingDeclaration } return _roleMappingElement; } - + /** * Sets the left method spec (role method spec) declared in this callin * mapping declaration to the given method spec. - * + * * @param roleMappingElement * @exception IllegalArgumentException if: * <ul> * <li>the node belongs to a different AST</li> * <li>the node already has a parent</li> * </ul> - */ + */ public void setRoleMappingElement(MethodMappingElement roleMappingElement) { if (roleMappingElement == null) @@ -418,12 +418,12 @@ public class CallinMappingDeclaration extends AbstractMethodMappingDeclaration /** * Returns the live ordered list of base method specs for this * callin mapping declaration. - * + * * @return the live list of base method specs * (element type: <code>IExtendedModifier</code>) * @exception UnsupportedOperationException if this operation is used in * a JLS2 AST - */ + */ public List getBaseMappingElements() { return _baseMappingElements; @@ -441,18 +441,18 @@ public class CallinMappingDeclaration extends AbstractMethodMappingDeclaration /** * Returns the callin modifiers explicitly specified on this declaration. - * + * * @return exactly one of before, after, replace using constants from Modifier * @see Modifier - */ + */ public int getCallinModifier() { return bindingOperator.getBindingModifier(); } - + /** * Sets the callin modifier explicitly specified on this declaration. - * + * * @param modifiers the given modifiers (bit-wise or of <code>Modifier</code> constants) * @see Modifier * @deprecated use setBindingOperator instead @@ -461,7 +461,7 @@ public class CallinMappingDeclaration extends AbstractMethodMappingDeclaration { setCallinModifier(this.ast.newModifier(Modifier.ModifierKeyword.fromFlagValue(modifiers))); } - + /** * @deprecated use setBindingOperator */ @@ -475,13 +475,13 @@ public class CallinMappingDeclaration extends AbstractMethodMappingDeclaration this.bindingOperator.setBindingModifier(modifier); } } - + /** * Returns the callin modifier for this callin mapping declaration. - * + * * @see Modifier * @return one of before, after, replace - */ + */ public Modifier callinModifier() { return this.bindingOperator.bindingModifier(); @@ -501,11 +501,11 @@ public class CallinMappingDeclaration extends AbstractMethodMappingDeclaration postReplaceChild(oldChild, name, NAME_PROPERTY); } - + public SimpleName getName() { return this._labelName; } - + public void setGuardPredicate(GuardPredicateDeclaration predicate) { ASTNode oldChild = this._optionalGuardPredicate; preReplaceChild(oldChild, predicate, GUARD_PROPERTY); @@ -517,9 +517,9 @@ public class CallinMappingDeclaration extends AbstractMethodMappingDeclaration return _optionalGuardPredicate; } - /** + /** * Return whether a static base method is bound such that - * no instance will be passed through this binding + * no instance will be passed through this binding * (one static base method suffices to determine staticness). */ public boolean isStatic() { diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CalloutMappingDeclaration.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CalloutMappingDeclaration.java index 09212ac55..0d5ce1016 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CalloutMappingDeclaration.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CalloutMappingDeclaration.java @@ -1,19 +1,19 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute for Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * $Id: CalloutMappingDeclaration.java 23416 2010-02-03 19:59:31Z stephan $ - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation @@ -25,56 +25,56 @@ import java.util.List; /** * NEW for OTDT - * - * Represents DOM-ASTNode for Callout Bindings (OTJLD §2.4.2), + * + * Represents DOM-ASTNode for Callout Bindings (OTJLD §2.4.2), * which has to handle code from e.g. : * foo => bar; * to e.g. : - * Integer absoluteValue(Integer integer) -> int abs(int i) with { + * Integer absoluteValue(Integer integer) -> int abs(int i) with { * integer.intValue() -> i, * result <- new Integer(result) * } * and also the callout to field binding: * - without value mapping: - * + * * setValue -> set value; - * + * * int getValue() -> get int value; - * + * * - with value mappings: - * + * * Integer getValue() -> get int val * with { result <- new Integer(result) } - * + * * void setValue(Integer i) -> set int val * with { integer.intValue() -> val } * - * + * * This class consists of one MethodSpec for bound role method and one MethodSpec for base method * or FieldAccessSpec for access to a field of the base class. Also it consists of * a callout kind and an optionally mapping of parameters. - * + * * This node is used in TypeDeclaration, particulary in RoleTypeDeclaration. - * + * * @author ike */ public class CalloutMappingDeclaration extends AbstractMethodMappingDeclaration { public static final String CALLOUT = "->"; //$NON-NLS-1$ public static final String CALLOUT_OVERRIDE = "=>"; //$NON-NLS-1$ - + /** - * Creates a new AST node for a callout mapping declaration owned + * Creates a new AST node for a callout mapping declaration owned * by the given AST. By default, the declaration is for a callout mapping * of an unspecified, but legal, name; * <p> - * N.B. This constructor is package-private; all subclasses must be - * declared in the same package; clients are unable to declare + * N.B. This constructor is package-private; all subclasses must be + * declared in the same package; clients are unable to declare * additional subclasses. * </p> - * + * * @param ast the AST that is to own this node - */ + */ CalloutMappingDeclaration(AST ast) { super(ast); @@ -83,13 +83,13 @@ public class CalloutMappingDeclaration extends AbstractMethodMappingDeclaration /** * The "javadoc" structural property of this node type. */ - public static final ChildPropertyDescriptor JAVADOC_PROPERTY = + public static final ChildPropertyDescriptor JAVADOC_PROPERTY = internalJavadocPropertyFactory(CalloutMappingDeclaration.class); - + /** * The left "methodSpec" structural property of this node type. */ - public static final ChildPropertyDescriptor ROLE_MAPPING_ELEMENT_PROPERTY = + public static final ChildPropertyDescriptor ROLE_MAPPING_ELEMENT_PROPERTY = new ChildPropertyDescriptor(CalloutMappingDeclaration.class, "roleMappingElement", MethodMappingElement.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ /** @@ -102,52 +102,52 @@ public class CalloutMappingDeclaration extends AbstractMethodMappingDeclaration /** * The right "methodSpec" structural property of this node type. */ - public static final ChildPropertyDescriptor BASE_MAPPING_ELEMENT_PROPERTY = + public static final ChildPropertyDescriptor BASE_MAPPING_ELEMENT_PROPERTY = new ChildPropertyDescriptor(CalloutMappingDeclaration.class, "baseMappingElement", MethodMappingElement.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ - + /** * The "signature" structural property of this node type. */ - public static final SimplePropertyDescriptor SIGNATURE_PROPERTY = + public static final SimplePropertyDescriptor SIGNATURE_PROPERTY = new SimplePropertyDescriptor(CalloutMappingDeclaration.class, "signature", boolean.class, MANDATORY); //$NON-NLS-1$ - + /** * The "parameterMappings" structural property of this node type. */ - public static final ChildListPropertyDescriptor PARAMETER_MAPPINGS_PROPERTY = + public static final ChildListPropertyDescriptor PARAMETER_MAPPINGS_PROPERTY = internalParameterMappingPropertyFactory(CalloutMappingDeclaration.class); - + /** * The "modifiers" structural property of this node type. */ - public static final SimplePropertyDescriptor MODIFIERS_PROPERTY = + public static final SimplePropertyDescriptor MODIFIERS_PROPERTY = internalModifiersPropertyFactory(CalloutMappingDeclaration.class); - + /** * The "modifiers2" structural property of this node type. */ - public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = + public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = internalModifiers2PropertyFactory(CalloutMappingDeclaration.class); - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS_2_0; - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS_3_0; - + private MethodMappingElement _baseMappingElement = null; private boolean _baseMappingInitialized= false; private boolean _hasSignature = false; - + static { List propertyList = new ArrayList(8); @@ -160,7 +160,7 @@ public class CalloutMappingDeclaration extends AbstractMethodMappingDeclaration addProperty(PARAMETER_MAPPINGS_PROPERTY, propertyList); addProperty(MODIFIERS_PROPERTY, propertyList); PROPERTY_DESCRIPTORS_2_0 = reapPropertyList(propertyList); - + propertyList = new ArrayList(8); createPropertyList(CalloutMappingDeclaration.class, propertyList); addProperty(JAVADOC_PROPERTY, propertyList); @@ -172,13 +172,13 @@ public class CalloutMappingDeclaration extends AbstractMethodMappingDeclaration addProperty(MODIFIERS2_PROPERTY, propertyList); PROPERTY_DESCRIPTORS_3_0 = reapPropertyList(propertyList); } - + /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the AST.JLS* constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) */ public static List propertyDescriptors(int apiLevel) @@ -198,7 +198,7 @@ public class CalloutMappingDeclaration extends AbstractMethodMappingDeclaration { return MODIFIERS2_PROPERTY; } - + final ChildListPropertyDescriptor internalParameterMappingsProperty() { return PARAMETER_MAPPINGS_PROPERTY; @@ -212,11 +212,11 @@ public class CalloutMappingDeclaration extends AbstractMethodMappingDeclaration public ChildPropertyDescriptor getRoleElementProperty() { return ROLE_MAPPING_ELEMENT_PROPERTY; } - + ChildPropertyDescriptor internalGetBindingOperatorProperty() { return BINDING_OPERATOR_PROPERTY; } - + final int internalGetSetIntProperty(SimplePropertyDescriptor property, boolean isGetRequest, int value) { if (property == MODIFIERS_PROPERTY) @@ -234,7 +234,7 @@ public class CalloutMappingDeclaration extends AbstractMethodMappingDeclaration // allow default implementation to flag the error return super.internalGetSetIntProperty(property, isGetRequest, value); } - + final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean isGet, ASTNode child) { if (property == JAVADOC_PROPERTY) @@ -261,11 +261,11 @@ public class CalloutMappingDeclaration extends AbstractMethodMappingDeclaration setBaseMappingElement((MethodSpec) child); return null; } - } + } // allow default implementation to flag the error (incl. handling of elements common to all method mappings): return super.internalGetSetChildProperty(property, isGet, child); } - + final boolean internalGetSetBooleanProperty(SimplePropertyDescriptor property, boolean get, boolean value) { if (property == SIGNATURE_PROPERTY) @@ -278,11 +278,11 @@ public class CalloutMappingDeclaration extends AbstractMethodMappingDeclaration { setSignatureFlag(value); return false; - } + } } return super.internalGetSetBooleanProperty(property, get, value); } - + final List internalGetChildListProperty(ChildListPropertyDescriptor property) { if (property == PARAMETER_MAPPINGS_PROPERTY) @@ -293,7 +293,7 @@ public class CalloutMappingDeclaration extends AbstractMethodMappingDeclaration { return modifiers(); } - + // allow default implementation to flag the error return super.internalGetChildListProperty(property); } @@ -312,8 +312,8 @@ public class CalloutMappingDeclaration extends AbstractMethodMappingDeclaration ASTNode clone0(AST target) { CalloutMappingDeclaration result = new CalloutMappingDeclaration(target); - if (this.ast.apiLevel >= AST.JLS3) - result.modifiers().addAll(ASTNode.copySubtrees(target, modifiers())); // annotations + if (this.ast.apiLevel >= AST.JLS3) + result.modifiers().addAll(ASTNode.copySubtrees(target, modifiers())); // annotations result.setSourceRange(this.getStartPosition(), this.getLength()); result.setJavadoc( (Javadoc) ASTNode.copySubtree(target, getJavadoc())); @@ -325,7 +325,7 @@ public class CalloutMappingDeclaration extends AbstractMethodMappingDeclaration result.setSignatureFlag(this.hasSignature()); result.getParameterMappings().addAll( ASTNode.copySubtrees(target, this.getParameterMappings())); - + return result; } @@ -343,7 +343,7 @@ public class CalloutMappingDeclaration extends AbstractMethodMappingDeclaration // visit children in normal left to right reading order acceptChild(visitor, getJavadoc()); if (this.ast.apiLevel >= AST.JLS3) - acceptChildren(visitor, modifiers); + acceptChildren(visitor, modifiers); acceptChild(visitor, roleMappingElement); acceptChild(visitor, bindingOperator); acceptChild(visitor, _baseMappingElement); @@ -354,8 +354,8 @@ public class CalloutMappingDeclaration extends AbstractMethodMappingDeclaration int treeSize() { - return memSize() + (super.optionalDocComment == null - ? 0 + return memSize() + (super.optionalDocComment == null + ? 0 : getJavadoc().treeSize()); } @@ -363,7 +363,7 @@ public class CalloutMappingDeclaration extends AbstractMethodMappingDeclaration * Returns the method spec right of the callout arrow. * @return the right method spec, i.e. the referenced base method * @see Modifier - */ + */ public MethodMappingElement getBaseMappingElement() { if (_baseMappingElement == null && !this._baseMappingInitialized) @@ -380,29 +380,29 @@ public class CalloutMappingDeclaration extends AbstractMethodMappingDeclaration } } } - return _baseMappingElement; + return _baseMappingElement; } /** * Sets the right method spec (base method spec) declared in this callout * mapping declaration to the given method spec. - * + * * @param baseMappingElement * @exception IllegalArgumentException if: * <ul> * <li>the node belongs to a different AST</li> * <li>the node already has a parent</li> * </ul> - */ + */ public void setBaseMappingElement(MethodMappingElement baseMappingElement) { this._baseMappingInitialized= true; ASTNode oldChild = _baseMappingElement; preReplaceChild(oldChild, baseMappingElement, BASE_MAPPING_ELEMENT_PROPERTY); _baseMappingElement = baseMappingElement; - postReplaceChild(oldChild, baseMappingElement, BASE_MAPPING_ELEMENT_PROPERTY); + postReplaceChild(oldChild, baseMappingElement, BASE_MAPPING_ELEMENT_PROPERTY); } - + /** * {@inheritDoc} */ @@ -413,21 +413,21 @@ public class CalloutMappingDeclaration extends AbstractMethodMappingDeclaration } /** - * + * * @return the flag, whether callout is a callout override or a simple callout - * true, if an override; - */ + * true, if an override; + */ public boolean isCalloutOverride() { return this.bindingOperator().getBindingKind() == MethodBindingOperator.KIND_CALLOUT_OVERRIDE; } - public boolean hasSignature() + public boolean hasSignature() { return _hasSignature; } - public void setSignatureFlag(boolean hasSignature) + public void setSignatureFlag(boolean hasSignature) { preValueChange(SIGNATURE_PROPERTY); _hasSignature = hasSignature; diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CastExpression.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CastExpression.java index 6e1f5485e..ca2b07b34 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CastExpression.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CastExpression.java @@ -19,9 +19,9 @@ import java.util.List; * * <pre> * CastExpression: - * <b>(</b> Type <b>)</b> Expression + * <b>(</b> Type <b>)</b> Expression * </pre> - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ @@ -31,23 +31,23 @@ public class CastExpression extends Expression { * The "type" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor TYPE_PROPERTY = + public static final ChildPropertyDescriptor TYPE_PROPERTY = new ChildPropertyDescriptor(CastExpression.class, "type", Type.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ /** * The "expression" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor EXPRESSION_PROPERTY = + public static final ChildPropertyDescriptor EXPRESSION_PROPERTY = new ChildPropertyDescriptor(CastExpression.class, "expression", Expression.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List properyList = new ArrayList(3); createPropertyList(CastExpression.class, properyList); @@ -59,17 +59,17 @@ public class CastExpression extends Expression { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** * The type; lazily initialized; defaults to a unspecified, * legal type. @@ -83,12 +83,12 @@ public class CastExpression extends Expression { private Expression expression = null; /** - * Creates a new AST node for a cast expression owned by the given + * Creates a new AST node for a cast expression owned by the given * AST. By default, the type and expression are unspecified (but legal). * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ CastExpression(AST ast) { @@ -101,7 +101,7 @@ public class CastExpression extends Expression { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -164,12 +164,12 @@ public class CastExpression extends Expression { } visitor.endVisit(this); } - + /** * Returns the type in this cast expression. - * + * * @return the type - */ + */ public Type getType() { if (this.type == null) { // lazy init must be thread-safe for readers @@ -186,14 +186,14 @@ public class CastExpression extends Expression { /** * Sets the type in this cast expression to the given type. - * + * * @param type the new type * @exception IllegalArgumentException if: * <ul> * <li>the node belongs to a different AST</li> * <li>the node already has a parent</li> * </ul> - */ + */ public void setType(Type type) { if (type == null) { throw new IllegalArgumentException(); @@ -203,12 +203,12 @@ public class CastExpression extends Expression { this.type = type; postReplaceChild(oldChild, type, TYPE_PROPERTY); } - + /** * Returns the expression of this cast expression. - * + * * @return the expression node - */ + */ public Expression getExpression() { if (this.expression == null) { // lazy init must be thread-safe for readers @@ -222,10 +222,10 @@ public class CastExpression extends Expression { } return this.expression; } - + /** * Sets the expression of this cast expression. - * + * * @param expression the new expression node * @exception IllegalArgumentException if: * <ul> @@ -233,7 +233,7 @@ public class CastExpression extends Expression { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setExpression(Expression expression) { if (expression == null) { throw new IllegalArgumentException(); @@ -251,12 +251,12 @@ public class CastExpression extends Expression { // treat Code as free return BASE_NODE_SIZE + 2 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int treeSize() { - return + return memSize() + (this.expression == null ? 0 : getExpression().treeSize()) + (this.type == null ? 0 : getType().treeSize()); diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CharacterLiteral.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CharacterLiteral.java index ebf8c9b71..456fdbbcc 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CharacterLiteral.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CharacterLiteral.java @@ -21,7 +21,7 @@ import org.eclipse.jdt.internal.compiler.parser.TerminalTokens; /** * Character literal nodes. - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ @@ -31,16 +31,16 @@ public class CharacterLiteral extends Expression { * The "escapedValue" structural property of this node type. * @since 3.0 */ - public static final SimplePropertyDescriptor ESCAPED_VALUE_PROPERTY = + public static final SimplePropertyDescriptor ESCAPED_VALUE_PROPERTY = new SimplePropertyDescriptor(CharacterLiteral.class, "escapedValue", String.class, MANDATORY); //$NON-NLS-1$ - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List properyList = new ArrayList(2); createPropertyList(CharacterLiteral.class, properyList); @@ -51,20 +51,20 @@ public class CharacterLiteral extends Expression { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** - * The literal string, including quotes and escapes; defaults to the + * The literal string, including quotes and escapes; defaults to the * literal for the character 'X'. */ private String escapedValue = "\'X\'";//$NON-NLS-1$ @@ -75,7 +75,7 @@ public class CharacterLiteral extends Expression { * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ CharacterLiteral(AST ast) { @@ -88,7 +88,7 @@ public class CharacterLiteral extends Expression { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -104,7 +104,7 @@ public class CharacterLiteral extends Expression { // allow default implementation to flag the error return super.internalGetSetObjectProperty(property, get, value); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -137,19 +137,19 @@ public class CharacterLiteral extends Expression { visitor.visit(this); visitor.endVisit(this); } - + /** * Returns the string value of this literal node. The value is the sequence * of characters that would appear in the source program, including * enclosing single quotes and embedded escapes. - * + * * @return the escaped string value, including enclosing single quotes * and embedded escapes - */ + */ public String getEscapedValue() { return this.escapedValue; } - + /** * Sets the string value of this literal node. The value is the sequence * of characters that would appear in the source program, including @@ -158,11 +158,11 @@ public class CharacterLiteral extends Expression { * <li><code>'a'</code> <code>setEscapedValue("\'a\'")</code></li> * <li><code>'\n'</code> <code>setEscapedValue("\'\\n\'")</code></li> * </ul> - * + * * @param value the string value, including enclosing single quotes * and embedded escapes * @exception IllegalArgumentException if the argument is incorrect - */ + */ public void setEscapedValue(String value) { // check setInternalEscapedValue(String) if this method is changed if (value == null) { @@ -199,7 +199,7 @@ public class CharacterLiteral extends Expression { } /** - * Returns the value of this literal node. + * Returns the value of this literal node. * <p> * For example, * <pre> @@ -208,11 +208,11 @@ public class CharacterLiteral extends Expression { * assert s.charValue() == 'x'; * </pre> * </p> - * + * * @return the character value without enclosing quotes and embedded * escapes * @exception IllegalArgumentException if the literal value cannot be converted - */ + */ public char charValue() { Scanner scanner = this.ast.scanner; char[] source = this.escapedValue.toCharArray(); @@ -298,7 +298,7 @@ public class CharacterLiteral extends Expression { return value; } /** - * Sets the value of this character literal node to the given character. + * Sets the value of this character literal node to the given character. * <p> * For example, * <pre> @@ -308,12 +308,12 @@ public class CharacterLiteral extends Expression { * assert s.getEscapedValue().equals("\'x\'"); * </pre> * </p> - * + * * @param value the character value */ public void setCharValue(char value) { StringBuffer b = new StringBuffer(3); - + b.append('\''); // opening delimiter switch(value) { case '\b' : @@ -363,14 +363,14 @@ public class CharacterLiteral extends Expression { break; case '\7' : b.append("\\7"); //$NON-NLS-1$ - break; + break; default: b.append(value); } b.append('\''); // closing delimiter setEscapedValue(b.toString()); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -378,7 +378,7 @@ public class CharacterLiteral extends Expression { int size = BASE_NODE_SIZE + 1 * 4 + stringSize(this.escapedValue); return size; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ChildListPropertyDescriptor.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ChildListPropertyDescriptor.java index b55cfe972..d624efc99 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ChildListPropertyDescriptor.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ChildListPropertyDescriptor.java @@ -14,13 +14,13 @@ package org.eclipse.jdt.core.dom; * Descriptor for a child list property of an AST node. * A child list property is one whose value is a list of * {@link ASTNode}. - * + * * @see org.eclipse.jdt.core.dom.ASTNode#getStructuralProperty(StructuralPropertyDescriptor) * @since 3.0 * @noinstantiate This class is not intended to be instantiated by clients. */ public final class ChildListPropertyDescriptor extends StructuralPropertyDescriptor { - + /** * Element type. For example, for a node type like * CompilationUnit, the "imports" property is ImportDeclaration.class. @@ -30,7 +30,7 @@ public final class ChildListPropertyDescriptor extends StructuralPropertyDescrip * </p> */ final Class elementType; - + /** * Indicates whether a cycle is possible. * <p> @@ -38,14 +38,14 @@ public final class ChildListPropertyDescriptor extends StructuralPropertyDescrip * access from ASTNode. * </p> */ - final boolean cycleRisk; - + final boolean cycleRisk; + /** * Creates a new child list property descriptor with the given property id. * Note that this constructor is declared package-private so that * property descriptors can only be created by the AST * implementation. - * + * * @param nodeClass concrete AST node type that owns this property * @param propertyId the property id * @param elementType the element type of this property @@ -60,20 +60,20 @@ public final class ChildListPropertyDescriptor extends StructuralPropertyDescrip this.elementType = elementType; this.cycleRisk = cycleRisk; } - + /** * Returns the element type of this list property. * <p> * For example, for a node type like CompilationUnit, * the "imports" property returns <code>ImportDeclaration.class</code>. * </p> - * + * * @return the element type of the property */ public final Class getElementType() { return this.elementType; } - + /** * Returns whether this property is vulnerable to cycles. * <p> @@ -82,13 +82,13 @@ public final class ChildListPropertyDescriptor extends StructuralPropertyDescrip * appear in the AST subtree below this property. For example, * the body property of a * {@link MethodDeclaration} node - * admits a body which might include statement that embeds + * admits a body which might include statement that embeds * another {@link MethodDeclaration} node. * On the other hand, the name property of a * MethodDeclaration node admits only names, and thereby excludes * another MethodDeclaration node. * </p> - * + * * @return <code>true</code> if cycles are possible, * and <code>false</code> if cycles are impossible */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ChildPropertyDescriptor.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ChildPropertyDescriptor.java index 2e6a8a288..86c2566e0 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ChildPropertyDescriptor.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ChildPropertyDescriptor.java @@ -14,39 +14,39 @@ package org.eclipse.jdt.core.dom; * Descriptor for a child property of an AST node. * A child property is one whose value is an * {@link ASTNode}. - * + * * @see org.eclipse.jdt.core.dom.ASTNode#getStructuralProperty(StructuralPropertyDescriptor) * @see org.eclipse.jdt.core.dom.ASTNode#setStructuralProperty(StructuralPropertyDescriptor, Object) * @since 3.0 * @noinstantiate This class is not intended to be instantiated by clients. */ public final class ChildPropertyDescriptor extends StructuralPropertyDescriptor { - + /** * Child type. For example, for a node type like * CompilationUnit, the "package" property is PackageDeclaration.class */ private final Class childClass; - + /** * Indicates whether the child is mandatory. A child property is allowed * to be <code>null</code> only if it is not mandatory. */ - private final boolean mandatory; - + private final boolean mandatory; + /** * Indicates whether a cycle is possible. * Field is private, but marked package-visible for fast * access from ASTNode. */ - final boolean cycleRisk; - + final boolean cycleRisk; + /** * Creates a new child property descriptor with the given property id. * Note that this constructor is declared package-private so that * property descriptors can only be created by the AST * implementation. - * + * * @param nodeClass concrete AST node type that owns this property * @param propertyId the property id * @param childType the child type of this property @@ -64,31 +64,31 @@ public final class ChildPropertyDescriptor extends StructuralPropertyDescriptor this.mandatory = mandatory; this.cycleRisk = cycleRisk; } - + /** * Returns the child type of this property. * <p> * For example, for a node type like CompilationUnit, * the "package" property returns <code>PackageDeclaration.class</code>. * </p> - * + * * @return the child type of the property */ public final Class getChildType() { return this.childClass; } - + /** * Returns whether this property is mandatory. A property value * is not allowed to be <code>null</code> if it is mandatory. - * + * * @return <code>true</code> if the property is mandatory, * and <code>false</code> if it is may be <code>null</code> */ public final boolean isMandatory() { return this.mandatory; } - + /** * Returns whether this property is vulnerable to cycles. * <p> @@ -97,13 +97,13 @@ public final class ChildPropertyDescriptor extends StructuralPropertyDescriptor * appear in the AST subtree below this property. For example, * the body property of a * {@link MethodDeclaration} node - * admits a body which might include statement that embeds + * admits a body which might include statement that embeds * another {@link MethodDeclaration} node. * On the other hand, the name property of a * MethodDeclaration node admits only names, and thereby excludes * another MethodDeclaration node. * </p> - * + * * @return <code>true</code> if cycles are possible, * and <code>false</code> if cycles are impossible */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ClassInstanceCreation.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ClassInstanceCreation.java index 9d8e42750..e95d569fb 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ClassInstanceCreation.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ClassInstanceCreation.java @@ -56,7 +56,7 @@ import java.util.List; * (Note also that the first form became possible as of JLS3; only the second * form existed in JLS2.) * </p> - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ @@ -66,60 +66,60 @@ public class ClassInstanceCreation extends Expression { * The "typeArguments" structural property of this node type (added in JLS3 API). * @since 3.1 */ - public static final ChildListPropertyDescriptor TYPE_ARGUMENTS_PROPERTY = + public static final ChildListPropertyDescriptor TYPE_ARGUMENTS_PROPERTY = new ChildListPropertyDescriptor(ClassInstanceCreation.class, "typeArguments", Type.class, NO_CYCLE_RISK); //$NON-NLS-1$ - + /** * The "expression" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor EXPRESSION_PROPERTY = + public static final ChildPropertyDescriptor EXPRESSION_PROPERTY = new ChildPropertyDescriptor(ClassInstanceCreation.class, "expression", Expression.class, OPTIONAL, CYCLE_RISK); //$NON-NLS-1$ /** * The "name" structural property of this node type (JLS2 API only). * @since 3.0 */ - public static final ChildPropertyDescriptor NAME_PROPERTY = + public static final ChildPropertyDescriptor NAME_PROPERTY = new ChildPropertyDescriptor(ClassInstanceCreation.class, "name", Name.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ /** * The "type" structural property of this node type (added in JLS3 API). * @since 3.1 */ - public static final ChildPropertyDescriptor TYPE_PROPERTY = + public static final ChildPropertyDescriptor TYPE_PROPERTY = new ChildPropertyDescriptor(ClassInstanceCreation.class, "type", Type.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ /** * The "arguments" structural property of this node type. * @since 3.0 */ - public static final ChildListPropertyDescriptor ARGUMENTS_PROPERTY = + public static final ChildListPropertyDescriptor ARGUMENTS_PROPERTY = new ChildListPropertyDescriptor(ClassInstanceCreation.class, "arguments", Expression.class, CYCLE_RISK); //$NON-NLS-1$ - + /** * The "anonymousClassDeclaration" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor ANONYMOUS_CLASS_DECLARATION_PROPERTY = + public static final ChildPropertyDescriptor ANONYMOUS_CLASS_DECLARATION_PROPERTY = new ChildPropertyDescriptor(ClassInstanceCreation.class, "anonymousClassDeclaration", AnonymousClassDeclaration.class, OPTIONAL, CYCLE_RISK); //$NON-NLS-1$ - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. * @since 3.0 */ private static final List PROPERTY_DESCRIPTORS_2_0; - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. * @since 3.1 */ private static final List PROPERTY_DESCRIPTORS_3_0; - + static { List properyList = new ArrayList(5); createPropertyList(ClassInstanceCreation.class, properyList); @@ -128,7 +128,7 @@ public class ClassInstanceCreation extends Expression { addProperty(ARGUMENTS_PROPERTY, properyList); addProperty(ANONYMOUS_CLASS_DECLARATION_PROPERTY, properyList); PROPERTY_DESCRIPTORS_2_0 = reapPropertyList(properyList); - + properyList = new ArrayList(6); createPropertyList(ClassInstanceCreation.class, properyList); addProperty(EXPRESSION_PROPERTY, properyList); @@ -142,11 +142,11 @@ public class ClassInstanceCreation extends Expression { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ @@ -157,14 +157,14 @@ public class ClassInstanceCreation extends Expression { return PROPERTY_DESCRIPTORS_3_0; } } - + /** * The optional expression; <code>null</code> for none; defaults to none. */ private Expression optionalExpression = null; - + /** - * The type arguments (element type: <code>Type</code>). + * The type arguments (element type: <code>Type</code>). * Null in JLS2. Added in JLS3; defaults to an empty list * (see constructor). * @since 3.1 @@ -176,37 +176,37 @@ public class ClassInstanceCreation extends Expression { * legal type name. Not used in JLS3. */ private Name typeName = null; - + /** * The type; lazily initialized; defaults to a unspecified type. * @since 3.0 */ private Type type = null; - + /** - * The list of argument expressions (element type: + * The list of argument expressions (element type: * <code>Expression</code>). Defaults to an empty list. */ private ASTNode.NodeList arguments = new ASTNode.NodeList(ARGUMENTS_PROPERTY); - + /** - * The optional anonymous class declaration; <code>null</code> for none; + * The optional anonymous class declaration; <code>null</code> for none; * defaults to none. */ private AnonymousClassDeclaration optionalAnonymousClassDeclaration = null; - + /** - * Creates a new AST node for a class instance creation expression owned + * Creates a new AST node for a class instance creation expression owned * by the given AST. By default, there is no qualifying expression, * an empty list of type parameters, an unspecified type, an empty * list of arguments, and does not declare an anonymous class. * <p> - * N.B. This constructor is package-private; all subclasses must be - * declared in the same package; clients are unable to declare + * N.B. This constructor is package-private; all subclasses must be + * declared in the same package; clients are unable to declare * additional subclasses. * </p> - * + * * @param ast the AST that is to own this node */ ClassInstanceCreation (AST ast) { @@ -223,7 +223,7 @@ public class ClassInstanceCreation extends Expression { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. @@ -264,7 +264,7 @@ public class ClassInstanceCreation extends Expression { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -278,7 +278,7 @@ public class ClassInstanceCreation extends Expression { // allow default implementation to flag the error return super.internalGetChildListProperty(property); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -303,7 +303,7 @@ public class ClassInstanceCreation extends Expression { } result.arguments().addAll(ASTNode.copySubtrees(target, arguments())); result.setAnonymousClassDeclaration( - (AnonymousClassDeclaration) + (AnonymousClassDeclaration) ASTNode.copySubtree(target, getAnonymousClassDeclaration())); return result; } @@ -336,21 +336,21 @@ public class ClassInstanceCreation extends Expression { } visitor.endVisit(this); } - + /** - * Returns the expression of this class instance creation expression, or + * Returns the expression of this class instance creation expression, or * <code>null</code> if there is none. - * + * * @return the expression node, or <code>null</code> if there is none - */ + */ public Expression getExpression() { return this.optionalExpression; } - + /** * Sets or clears the expression of this class instance creation expression. - * - * @param expression the expression node, or <code>null</code> if + * + * @param expression the expression node, or <code>null</code> if * there is none * @exception IllegalArgumentException if: * <ul> @@ -358,7 +358,7 @@ public class ClassInstanceCreation extends Expression { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setExpression(Expression expression) { // a ClassInstanceCreation may occur inside an Expression // must check cycles @@ -371,13 +371,13 @@ public class ClassInstanceCreation extends Expression { /** * Returns the live ordered list of type arguments of this class * instance creation (added in JLS3 API). - * + * * @return the live list of type arguments * (element type: <code>Type</code>) * @exception UnsupportedOperationException if this operation is used in * a JLS2 AST * @since 3.1 - */ + */ public List typeArguments() { // more efficient than just calling unsupportedIn2() to check if (this.typeArguments == null) { @@ -385,18 +385,18 @@ public class ClassInstanceCreation extends Expression { } return this.typeArguments; } - + /** - * Returns the name of the type instantiated in this class instance + * Returns the name of the type instantiated in this class instance * creation expression (JLS2 API only). - * + * * @return the type name node * @exception UnsupportedOperationException if this operation is used in * an AST later than JLS2 * @deprecated In the JLS3 API, this method is replaced by * {@link #getType()}, which returns a <code>Type</code> instead of a * <code>Name</code>. - */ + */ public Name getName() { return internalGetName(); } @@ -420,11 +420,11 @@ public class ClassInstanceCreation extends Expression { } return this.typeName; } - + /** - * Sets the name of the type instantiated in this class instance + * Sets the name of the type instantiated in this class instance * creation expression (JLS2 API only). - * + * * @param name the new type name * @exception IllegalArgumentException if: * <ul> @@ -433,10 +433,10 @@ public class ClassInstanceCreation extends Expression { * </ul> * @exception UnsupportedOperationException if this operation is used in * an AST later than JLS2 - * @deprecated In the JLS3 API, this method is replaced by + * @deprecated In the JLS3 API, this method is replaced by * {@link #setType(Type)}, which expects a <code>Type</code> instead of * a <code>Name</code>. - */ + */ public void setName(Name name) { internalSetName(name); } @@ -460,12 +460,12 @@ public class ClassInstanceCreation extends Expression { /** * Returns the type instantiated in this class instance creation * expression (added in JLS3 API). - * + * * @return the type node * @exception UnsupportedOperationException if this operation is used in * a JLS2 AST * @since 3.1 - */ + */ public Type getType() { unsupportedIn2(); if (this.type == null) { @@ -480,11 +480,11 @@ public class ClassInstanceCreation extends Expression { } return this.type; } - + /** * Sets the type instantiated in this class instance creation * expression (added in JLS3 API). - * + * * @param type the new type * @exception IllegalArgumentException if: * <ul> @@ -494,7 +494,7 @@ public class ClassInstanceCreation extends Expression { * @exception UnsupportedOperationException if this operation is used in * a JLS2 AST * @since 3.1 - */ + */ public void setType(Type type) { unsupportedIn2(); if (type == null) { @@ -509,31 +509,31 @@ public class ClassInstanceCreation extends Expression { /** * Returns the live ordered list of argument expressions in this class * instance creation expression. - * + * * @return the live list of argument expressions (possibly empty) * (element type: <code>Expression</code>) - */ + */ public List arguments() { return this.arguments; } - + /** * Returns the anonymous class declaration introduced by this * class instance creation expression, if it has one. - * + * * @return the anonymous class declaration, or <code>null</code> if none - */ + */ public AnonymousClassDeclaration getAnonymousClassDeclaration() { return this.optionalAnonymousClassDeclaration; } - + /** * Sets whether this class instance creation expression declares * an anonymous class (that is, has class body declarations). - * - * @param decl the anonymous class declaration, or <code>null</code> + * + * @param decl the anonymous class declaration, or <code>null</code> * if none - */ + */ public void setAnonymousClassDeclaration(AnonymousClassDeclaration decl) { ASTNode oldChild = this.optionalAnonymousClassDeclaration; preReplaceChild(oldChild, decl, ANONYMOUS_CLASS_DECLARATION_PROPERTY); @@ -549,10 +549,10 @@ public class ClassInstanceCreation extends Expression { * Note that bindings are generally unavailable unless requested when the * AST is being built. * </p> - * + * * @return the constructor binding, or <code>null</code> if the binding * cannot be resolved - */ + */ public IMethodBinding resolveConstructorBinding() { return this.ast.getBindingResolver().resolveConstructor(this); } @@ -564,7 +564,7 @@ public class ClassInstanceCreation extends Expression { // treat Code as free return BASE_NODE_SIZE + 6 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -572,7 +572,7 @@ public class ClassInstanceCreation extends Expression { // n.b. type == null for ast.API_LEVEL == JLS2 // n.b. typeArguments == null for ast.API_LEVEL == JLS2 // n.b. typeName == null for ast.API_LEVEL >= JLS3 - return + return memSize() + (this.typeName == null ? 0 : getName().treeSize()) + (this.type == null ? 0 : getType().treeSize()) diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Comment.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Comment.java index ca69b46e5..01cd412c9 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Comment.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Comment.java @@ -12,7 +12,7 @@ package org.eclipse.jdt.core.dom; /** * Abstract base class for all AST nodes that represent comments. - * There are exactly three kinds of comment: + * There are exactly three kinds of comment: * line comments ({@link LineComment}), * block comments ({@link BlockComment}), and * doc comments ({@link Javadoc}). @@ -24,11 +24,11 @@ package org.eclipse.jdt.core.dom; * Javadoc * </pre> * </p> - * + * * @since 3.0 */ public abstract class Comment extends ASTNode { - + /** * Alternate root node, or <code>null</code> if none. * Initially <code>null</code>. @@ -40,46 +40,46 @@ public abstract class Comment extends ASTNode { * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ Comment(AST ast) { super(ast); } - + /** * Returns whether this comment is a block comment * (<code>BlockComment</code>). - * - * @return <code>true</code> if this is a block comment, and + * + * @return <code>true</code> if this is a block comment, and * <code>false</code> otherwise */ public final boolean isBlockComment() { return (this instanceof BlockComment); } - + /** * Returns whether this comment is a line comment * (<code>LineComment</code>). - * - * @return <code>true</code> if this is a line comment, and + * + * @return <code>true</code> if this is a line comment, and * <code>false</code> otherwise */ public final boolean isLineComment() { return (this instanceof LineComment); } - + /** * Returns whether this comment is a doc comment * (<code>Javadoc</code>). - * - * @return <code>true</code> if this is a doc comment, and + * + * @return <code>true</code> if this is a doc comment, and * <code>false</code> otherwise */ public final boolean isDocComment() { return (this instanceof Javadoc); } - + /** * Returns the root AST node that this comment occurs * within, or <code>null</code> if none (or not recorded). @@ -87,29 +87,29 @@ public abstract class Comment extends ASTNode { * Typically, the comment nodes created while parsing a compilation * unit are not considered descendents of the normal AST * root, namely an {@link CompilationUnit}. Instead, these - * comment nodes exist outside the normal AST and each is + * comment nodes exist outside the normal AST and each is * a root in its own right. This optional property provides * a well-known way to navigate from the comment to the * compilation unit in such cases. Note that the alternate root * property is not one of the comment node's children. It is simply a * reference to a node. * </p> - * - * @return the alternate root node, or <code>null</code> + * + * @return the alternate root node, or <code>null</code> * if none * @see #setAlternateRoot(ASTNode) */ public final ASTNode getAlternateRoot() { return this.alternateRoot; } - + /** * Returns the root AST node that this comment occurs * within, or <code>null</code> if none (or not recorded). * <p> * </p> - * - * @param root the alternate root node, or <code>null</code> + * + * @param root the alternate root node, or <code>null</code> * if none * @see #getAlternateRoot() */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CompilationUnit.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CompilationUnit.java index ec7a585cd..6d868aeed 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CompilationUnit.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CompilationUnit.java @@ -178,7 +178,7 @@ public class CompilationUnit extends ASTNode { * Problems reported by the compiler during parsing or name resolution. */ private IProblem[] problems = EMPTY_PROBLEMS; - + /** * Internal data used to perform statements recovery. */ @@ -621,18 +621,18 @@ public class CompilationUnit extends ASTNode { /** * Internal method - * + * * This method return internal data used to perform statements recovery. - * + * * @return internal data used to perform statements recovery. - * + * * @noreference This method is not intended to be referenced by clients. * @since 3.5 */ public Object getStatementsRecoveryData() { return this.statementsRecoveryData; } - + /** * The Java type root (a {@link org.eclipse.jdt.core.ICompilationUnit compilation unit} or a {@link org.eclipse.jdt.core.IClassFile class file}) * this compilation unit was created from, or <code>null</code> if it was not created from a Java type root. @@ -1028,13 +1028,13 @@ public class CompilationUnit extends ASTNode { } this.problems = problems; } - + /** * Internal method - * + * * Sets internal data used to perform statements recovery. * @param data - * + * * @noreference This method is not intended to be referenced by clients. * @since 3.5 */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CompilationUnitResolver.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CompilationUnitResolver.java index f237a06f6..a08f7bbe2 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CompilationUnitResolver.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/CompilationUnitResolver.java @@ -113,7 +113,7 @@ class CompilationUnitResolver extends Compiler { boolean hasCompilationAborted; private IProgressMonitor monitor; - + /** * Set to <code>true</code> if the receiver was initialized using a java project name environment */ @@ -178,7 +178,7 @@ class CompilationUnitResolver extends Compiler { SourceTypeElementInfo sourceType = (SourceTypeElementInfo) sourceTypes[0]; accept((org.eclipse.jdt.internal.compiler.env.ICompilationUnit) sourceType.getHandle().getCompilationUnit(), accessRestriction); } - + public synchronized void accept(org.eclipse.jdt.internal.compiler.env.ICompilationUnit sourceUnit, AccessRestriction accessRestriction) { super.accept(sourceUnit, accessRestriction); } @@ -544,7 +544,7 @@ class CompilationUnitResolver extends Compiler { } } else { //fill the methods bodies in order for the code to be generated - //real parse of the method.... + //real parse of the method.... org.eclipse.jdt.internal.compiler.ast.TypeDeclaration[] types = compilationUnitDeclaration.types; if (types != null) { for (int j = 0, typeLength = types.length; j < typeLength; j++) { @@ -854,11 +854,11 @@ class CompilationUnitResolver extends Compiler { org.eclipse.jdt.internal.compiler.env.ICompilationUnit[] sourceUnits = new org.eclipse.jdt.internal.compiler.env.ICompilationUnit[length]; System.arraycopy(compilationUnits, 0, sourceUnits, 0, length); //{ObjectTeams: - Dependencies.setup(this, this.parser, this.lookupEnvironment, - true/*verify*/, !this.options.ignoreMethodBodies/*analyze*/, !this.options.ignoreMethodBodies/*generate*/, + Dependencies.setup(this, this.parser, this.lookupEnvironment, + true/*verify*/, !this.options.ignoreMethodBodies/*analyze*/, !this.options.ignoreMethodBodies/*generate*/, true, true, false); // SH+KM} - + beginToCompile(sourceUnits, bindingKeys); // process all units (some more could be injected in the loop by the lookup environment) for (int i = 0; i < this.totalUnits; i++) { @@ -996,8 +996,8 @@ class CompilationUnitResolver extends Compiler { sourceUnits[count++] = new org.eclipse.jdt.internal.compiler.batch.CompilationUnit(contents, sourceUnitPath, encoding); } //{ObjectTeams: - Dependencies.setup(this, this.parser, this.lookupEnvironment, - true/*verify*/, !this.options.ignoreMethodBodies/*analyze*/, !this.options.ignoreMethodBodies/*generate*/, + Dependencies.setup(this, this.parser, this.lookupEnvironment, + true/*verify*/, !this.options.ignoreMethodBodies/*analyze*/, !this.options.ignoreMethodBodies/*generate*/, true, true, false); // SH} beginToCompile(sourceUnits, bindingKeys); @@ -1099,7 +1099,7 @@ class CompilationUnitResolver extends Compiler { astRequestor.compilationUnitResolver = null; //{ObjectTeams: restore: Dependencies.release(this); -// SH} +// SH} } } @@ -1148,20 +1148,20 @@ class CompilationUnitResolver extends Compiler { try { //{ObjectTeams: - Dependencies.setup(this, this.parser, this.lookupEnvironment, + Dependencies.setup(this, this.parser, this.lookupEnvironment, verifyMethods, analyzeCode, generateCode, true, true, false); -// SH} +// SH} if (unit == null) { // build and record parsed units this.parseThreshold = 0; // will request a full parse beginToCompile(new org.eclipse.jdt.internal.compiler.env.ICompilationUnit[] { sourceUnit }); // process all units (some more could be injected in the loop by the lookup environment) -//{ObjectTeams: due to role files the unit corresponding to sourceUnit need not be in position 0: -/* orig: +//{ObjectTeams: due to role files the unit corresponding to sourceUnit need not be in position 0: +/* orig: unit = this.unitsToProcess[0]; :giro */ unit = findCorrespondingUnit(this.unitsToProcess, sourceUnit); -// SH} +// SH} } else { // initial type binding creation this.lookupEnvironment.buildTypeBindings(unit, null /*no access restriction*/); @@ -1206,12 +1206,12 @@ class CompilationUnitResolver extends Compiler { } //{ObjectTeams: no more method bodies, have explicitly parsed those we need: unit.parseMethodBodies = false; -// SH} +// SH} } } if (unit.scope != null) { -//{ObjectTeams: replace single step by Dependencies: +//{ObjectTeams: replace single step by Dependencies: /* orig: // fault in fields & methods unit.scope.faultInTypes(); @@ -1228,7 +1228,7 @@ class CompilationUnitResolver extends Compiler { // code generation if (generateCode) unit.generateCode(); -*/ +*/ if (generateCode) Dependencies.ensureState(unit, ITranslationStates.STATE_BYTE_CODE_GENERATED); else if (analyzeCode) @@ -1254,9 +1254,9 @@ class CompilationUnitResolver extends Compiler { this.handleInternalException(e, unit, null); throw e; // rethrow } finally { -//{ObjectTeams: +//{ObjectTeams: Dependencies.release(this); -// SH} +// SH} // No reset is performed there anymore since, // within the CodeAssist (or related tools), // the compiler may be called *after* a call @@ -1270,8 +1270,8 @@ class CompilationUnitResolver extends Compiler { // because a role file might have fetched its team. // So search through the array! private CompilationUnitDeclaration findCorrespondingUnit( - CompilationUnitDeclaration[] declarations, - org.eclipse.jdt.internal.compiler.env.ICompilationUnit sourceUnit) + CompilationUnitDeclaration[] declarations, + org.eclipse.jdt.internal.compiler.env.ICompilationUnit sourceUnit) { for(CompilationUnitDeclaration cud : declarations) { if (CharOperation.equals(sourceUnit.getFileName(), cud.getFileName())) @@ -1279,7 +1279,7 @@ class CompilationUnitResolver extends Compiler { } throw new InternalCompilerError("parsed unit not found in units: "+new String(sourceUnit.getFileName())); //$NON-NLS-1$ } -// SH} +// SH} /* * Internal API used to resolve a given compilation unit. Can run a subset of the compilation process diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ConditionalExpression.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ConditionalExpression.java index 633a985ac..8228fde81 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ConditionalExpression.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ConditionalExpression.java @@ -21,40 +21,40 @@ import java.util.List; * ConditionalExpression: * Expression <b>?</b> Expression <b>:</b> Expression * </pre> - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ public class ConditionalExpression extends Expression { - + /** * The "expression" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor EXPRESSION_PROPERTY = + public static final ChildPropertyDescriptor EXPRESSION_PROPERTY = new ChildPropertyDescriptor(ConditionalExpression.class, "expression", Expression.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ /** * The "thenExpression" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor THEN_EXPRESSION_PROPERTY = + public static final ChildPropertyDescriptor THEN_EXPRESSION_PROPERTY = new ChildPropertyDescriptor(ConditionalExpression.class, "thenExpression", Expression.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ /** * The "elseExpression" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor ELSE_EXPRESSION_PROPERTY = + public static final ChildPropertyDescriptor ELSE_EXPRESSION_PROPERTY = new ChildPropertyDescriptor(ConditionalExpression.class, "elseExpression", Expression.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List properyList = new ArrayList(4); createPropertyList(ConditionalExpression.class, properyList); @@ -67,18 +67,18 @@ public class ConditionalExpression extends Expression { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** * The condition expression; lazily initialized; defaults to an unspecified, * but legal, expression. @@ -98,13 +98,13 @@ public class ConditionalExpression extends Expression { private Expression elseExpression = null; /** - * Creates a new unparented conditional expression node owned by the given + * Creates a new unparented conditional expression node owned by the given * AST. By default, the condition, "then", and "else" expresssions are * unspecified, but legal. * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ ConditionalExpression(AST ast) { @@ -117,7 +117,7 @@ public class ConditionalExpression extends Expression { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -149,7 +149,7 @@ public class ConditionalExpression extends Expression { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -192,12 +192,12 @@ public class ConditionalExpression extends Expression { } visitor.endVisit(this); } - + /** * Returns the condition of this conditional expression. - * + * * @return the condition node - */ + */ public Expression getExpression() { if (this.conditionExpression == null) { // lazy init must be thread-safe for readers @@ -211,10 +211,10 @@ public class ConditionalExpression extends Expression { } return this.conditionExpression; } - + /** * Sets the condition of this conditional expression. - * + * * @param expression the condition node * @exception IllegalArgumentException if: * <ul> @@ -222,7 +222,7 @@ public class ConditionalExpression extends Expression { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setExpression(Expression expression) { if (expression == null) { throw new IllegalArgumentException(); @@ -232,12 +232,12 @@ public class ConditionalExpression extends Expression { this.conditionExpression = expression; postReplaceChild(oldChild, expression, EXPRESSION_PROPERTY); } - + /** * Returns the "then" part of this conditional expression. - * + * * @return the "then" expression node - */ + */ public Expression getThenExpression() { if (this.thenExpression == null) { // lazy init must be thread-safe for readers @@ -251,10 +251,10 @@ public class ConditionalExpression extends Expression { } return this.thenExpression; } - + /** * Sets the "then" part of this conditional expression. - * + * * @param expression the "then" expression node * @exception IllegalArgumentException if: * <ul> @@ -262,7 +262,7 @@ public class ConditionalExpression extends Expression { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setThenExpression(Expression expression) { if (expression == null) { throw new IllegalArgumentException(); @@ -275,9 +275,9 @@ public class ConditionalExpression extends Expression { /** * Returns the "else" part of this conditional expression. - * + * * @return the "else" expression node - */ + */ public Expression getElseExpression() { if (this.elseExpression == null) { // lazy init must be thread-safe for readers @@ -291,10 +291,10 @@ public class ConditionalExpression extends Expression { } return this.elseExpression; } - + /** * Sets the "else" part of this conditional expression. - * + * * @param expression the "else" expression node * @exception IllegalArgumentException if: * <ul> @@ -302,7 +302,7 @@ public class ConditionalExpression extends Expression { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setElseExpression(Expression expression) { if (expression == null) { throw new IllegalArgumentException(); @@ -320,12 +320,12 @@ public class ConditionalExpression extends Expression { // treat Code as free return BASE_NODE_SIZE + 3 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int treeSize() { - return + return memSize() + (this.conditionExpression == null ? 0 : getExpression().treeSize()) + (this.thenExpression == null ? 0 : getThenExpression().treeSize()) diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ConstructorInvocation.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ConstructorInvocation.java index 69f5657ec..e8fa8b206 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ConstructorInvocation.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ConstructorInvocation.java @@ -27,48 +27,48 @@ import java.util.List; * [ <b><</b> Type { <b>,</b> Type } <b>></b> ] * <b>this</b> <b>(</b> [ Expression { <b>,</b> Expression } ] <b>)</b> <b>;</b> * </pre> - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ public class ConstructorInvocation extends Statement { - + /** * The "typeArguments" structural property of this node type (added in JLS3 API). * @since 3.1 */ - public static final ChildListPropertyDescriptor TYPE_ARGUMENTS_PROPERTY = + public static final ChildListPropertyDescriptor TYPE_ARGUMENTS_PROPERTY = new ChildListPropertyDescriptor(ConstructorInvocation.class, "typeArguments", Type.class, NO_CYCLE_RISK); //$NON-NLS-1$ - + /** * The "arguments" structural property of this node type. * @since 3.0 */ - public static final ChildListPropertyDescriptor ARGUMENTS_PROPERTY = + public static final ChildListPropertyDescriptor ARGUMENTS_PROPERTY = new ChildListPropertyDescriptor(ConstructorInvocation.class, "arguments", Expression.class, CYCLE_RISK); //$NON-NLS-1$ - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. * @since 3.0 */ private static final List PROPERTY_DESCRIPTORS_2_0; - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. * @since 3.1 */ private static final List PROPERTY_DESCRIPTORS_3_0; - + static { List properyList = new ArrayList(2); createPropertyList(ConstructorInvocation.class, properyList); addProperty(ARGUMENTS_PROPERTY, properyList); PROPERTY_DESCRIPTORS_2_0 = reapPropertyList(properyList); - + properyList = new ArrayList(3); createPropertyList(ConstructorInvocation.class, properyList); addProperty(TYPE_ARGUMENTS_PROPERTY, properyList); @@ -79,11 +79,11 @@ public class ConstructorInvocation extends Statement { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ @@ -94,9 +94,9 @@ public class ConstructorInvocation extends Statement { return PROPERTY_DESCRIPTORS_3_0; } } - + /** - * The type arguments (element type: <code>Type</code>). + * The type arguments (element type: <code>Type</code>). * Null in JLS2. Added in JLS3; defaults to an empty list * (see constructor). * @since 3.1 @@ -104,7 +104,7 @@ public class ConstructorInvocation extends Statement { private ASTNode.NodeList typeArguments = null; /** - * The list of argument expressions (element type: + * The list of argument expressions (element type: * <code>Expression</code>). Defaults to an empty list. */ private ASTNode.NodeList arguments = @@ -113,11 +113,11 @@ public class ConstructorInvocation extends Statement { /** * Creates a new AST node for an alternate constructor invocation statement * owned by the given AST. By default, an empty list of arguments. - * + * * @param ast the AST that is to own this node */ ConstructorInvocation(AST ast) { - super(ast); + super(ast); if (ast.apiLevel >= AST.JLS3) { this.typeArguments = new ASTNode.NodeList(TYPE_ARGUMENTS_PROPERTY); } @@ -129,7 +129,7 @@ public class ConstructorInvocation extends Statement { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -186,17 +186,17 @@ public class ConstructorInvocation extends Statement { } visitor.endVisit(this); } - + /** * Returns the live ordered list of type arguments of this constructor * invocation (added in JLS3 API). - * + * * @return the live list of type arguments * (element type: <code>Type</code>) * @exception UnsupportedOperationException if this operation is used in * a JLS2 AST * @since 3.1 - */ + */ public List typeArguments() { // more efficient than just calling unsupportedIn2() to check if (this.typeArguments == null) { @@ -204,14 +204,14 @@ public class ConstructorInvocation extends Statement { } return this.typeArguments; } - + /** * Returns the live ordered list of argument expressions in this alternate * constructor invocation statement. - * - * @return the live list of argument expressions + * + * @return the live list of argument expressions * (element type: <code>Expression</code>) - */ + */ public List arguments() { return this.arguments; } @@ -223,10 +223,10 @@ public class ConstructorInvocation extends Statement { * Note that bindings are generally unavailable unless requested when the * AST is being built. * </p> - * + * * @return the constructor binding, or <code>null</code> if the binding * cannot be resolved - */ + */ public IMethodBinding resolveConstructorBinding() { return this.ast.getBindingResolver().resolveConstructor(this); } @@ -238,12 +238,12 @@ public class ConstructorInvocation extends Statement { // treat Code as free return BASE_NODE_SIZE + 2 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int treeSize() { - return + return memSize() + (this.typeArguments == null ? 0 : this.typeArguments.listSize()) + (this.arguments == null ? 0 : this.arguments.listSize()); diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ContinueStatement.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ContinueStatement.java index 48fde2419..605c91cf9 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ContinueStatement.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ContinueStatement.java @@ -21,26 +21,26 @@ import java.util.List; * ContinueStatement: * <b>continue</b> [ Identifier ] <b>;</b> * </pre> - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ public class ContinueStatement extends Statement { - + /** * The "label" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor LABEL_PROPERTY = + public static final ChildPropertyDescriptor LABEL_PROPERTY = new ChildPropertyDescriptor(ContinueStatement.class, "label", SimpleName.class, OPTIONAL, NO_CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List properyList = new ArrayList(2); createPropertyList(ContinueStatement.class, properyList); @@ -51,30 +51,30 @@ public class ContinueStatement extends Statement { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** * The label, or <code>null</code> if none; none by default. */ private SimpleName optionalLabel = null; /** - * Creates a new unparented continue statement node owned by the given + * Creates a new unparented continue statement node owned by the given * AST. By default, the continue statement has no label. * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ ContinueStatement(AST ast) { @@ -87,7 +87,7 @@ public class ContinueStatement extends Statement { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -103,7 +103,7 @@ public class ContinueStatement extends Statement { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -140,42 +140,42 @@ public class ContinueStatement extends Statement { } visitor.endVisit(this); } - + /** * Returns the label of this continue statement, or <code>null</code> if * there is none. - * + * * @return the label, or <code>null</code> if there is none - */ + */ public SimpleName getLabel() { return this.optionalLabel; } - + /** * Sets or clears the label of this continue statement. - * - * @param label the label, or <code>null</code> if + * + * @param label the label, or <code>null</code> if * there is none * @exception IllegalArgumentException if: * <ul> * <li>the node belongs to a different AST</li> * <li>the node already has a parent</li> * </ul> - */ + */ public void setLabel(SimpleName label) { ASTNode oldChild = this.optionalLabel; preReplaceChild(oldChild, label, LABEL_PROPERTY); this.optionalLabel = label; postReplaceChild(oldChild, label, LABEL_PROPERTY); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int memSize() { return super.memSize() + 1 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DefaultASTVisitor.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DefaultASTVisitor.java index d08c20151..fa175b1cd 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DefaultASTVisitor.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DefaultASTVisitor.java @@ -13,23 +13,23 @@ package org.eclipse.jdt.core.dom; */ class DefaultASTVisitor extends ASTVisitor { /** - * + * */ public DefaultASTVisitor() { super(); } - + /** - * + * */ public DefaultASTVisitor(boolean visitDocTags) { super(visitDocTags); } - + public void endVisit(AnnotationTypeDeclaration node) { endVisitNode(node); } - + public void endVisit(AnnotationTypeMemberDeclaration node) { endVisitNode(node); } @@ -389,7 +389,7 @@ class DefaultASTVisitor extends ASTVisitor { } public boolean visit(Javadoc node) { // do not visit Javadoc tags by default. Use constructor with boolean to enable. - if (super.visit(node)) { + if (super.visit(node)) { return visitNode(node); } return false; @@ -445,7 +445,7 @@ class DefaultASTVisitor extends ASTVisitor { public boolean visit(PrefixExpression node) { return visitNode(node); } - + public boolean visit(PrimitiveType node) { return visitNode(node); } diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DefaultBindingResolver.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DefaultBindingResolver.java index e77826049..27def9cb1 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DefaultBindingResolver.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DefaultBindingResolver.java @@ -147,12 +147,12 @@ class DefaultBindingResolver extends BindingResolver { * Toggle controlling whether DOM bindings should be created when missing internal compiler bindings.. */ boolean isRecoveringBindings; - + /** * Set to <code>true</code> if initialized from a java project */ boolean fromJavaProject; - + /** * Constructor for DefaultBindingResolver. */ @@ -951,7 +951,7 @@ class DefaultBindingResolver extends BindingResolver { } return null; } - + synchronized IMethodBinding resolveConstructor(TSuperConstructorInvocation constructor) { org.eclipse.jdt.internal.compiler.ast.ASTNode node = @@ -961,7 +961,7 @@ class DefaultBindingResolver extends BindingResolver { ExplicitConstructorCall explicitConstructorCall = (ExplicitConstructorCall)node; return this.getMethodBinding(explicitConstructorCall.binding.copyInheritanceSrc); } - return null; + return null; } synchronized IMethodBinding resolveMethod(org.eclipse.jdt.core.dom.BaseCallMessageSend method) @@ -974,8 +974,8 @@ class DefaultBindingResolver extends BindingResolver { return this.getMethodBinding(baseCall.getMessageSend().binding); } return null; - } - + } + synchronized IMethodBinding resolveMethod(org.eclipse.jdt.core.dom.MethodSpec method) { org.eclipse.jdt.internal.compiler.ast.ASTNode node = @@ -999,7 +999,7 @@ class DefaultBindingResolver extends BindingResolver { return this.getMethodBinding(msgSend.binding.copyInheritanceSrc); } return null; - } + } synchronized IMethodMappingBinding resolveMethodMapping(org.eclipse.jdt.core.dom.AbstractMethodMappingDeclaration mapping) { @@ -1025,7 +1025,7 @@ class DefaultBindingResolver extends BindingResolver { } return null; } - + synchronized IVariableBinding resolveVariable(org.eclipse.jdt.core.dom.FieldAccessSpec field) @@ -1040,7 +1040,7 @@ class DefaultBindingResolver extends BindingResolver { return null; } //mkr} - + synchronized ITypeBinding resolveTypeBindingForName(Name name) { org.eclipse.jdt.internal.compiler.ast.ASTNode node = (org.eclipse.jdt.internal.compiler.ast.ASTNode) this.newAstToOldAst.get(name); int index = name.index; @@ -1517,8 +1517,8 @@ class DefaultBindingResolver extends BindingResolver { org.eclipse.jdt.internal.compiler.ast.MemberValuePair memberValuePair = (org.eclipse.jdt.internal.compiler.ast.MemberValuePair) node; return getMethodBinding(memberValuePair.binding); } -//{ObjectTeams: Resolve bindings for OT-specific elements - else if (node instanceof MethodSpec) +//{ObjectTeams: Resolve bindings for OT-specific elements + else if (node instanceof MethodSpec) { if (!(node instanceof FieldAccessSpec)) { @@ -1536,7 +1536,7 @@ class DefaultBindingResolver extends BindingResolver { LiftingTypeReference liftingTypeRef = (LiftingTypeReference)node; return getTypeBinding(liftingTypeRef.resolvedType); } -//jsv} +//jsv} return null; } @@ -2021,7 +2021,7 @@ class DefaultBindingResolver extends BindingResolver { { return null; } - + if (callbinding.isValidBinding()) { MethodMappingBinding binding = @@ -2037,9 +2037,9 @@ class DefaultBindingResolver extends BindingResolver { return binding; } } - + return null; } //mkr} - + } diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DefaultCommentMapper.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DefaultCommentMapper.java index 0be0ff23b..170327e15 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DefaultCommentMapper.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DefaultCommentMapper.java @@ -18,13 +18,13 @@ import org.eclipse.jdt.internal.compiler.util.Util; /** * Internal class for associating comments with AST nodes. - * + * * @since 3.0 */ class DefaultCommentMapper { Comment[] comments; Scanner scanner; - + // extended nodes storage int leadingPtr; ASTNode[] leadingNodes; @@ -47,7 +47,7 @@ class DefaultCommentMapper { /** * Get comment of the list which includes a given position - * + * * @param position The position belonging to the looked up comment * @return comment which includes the given position or null if none was found */ @@ -113,7 +113,7 @@ class DefaultCommentMapper { * {@link ASTNode#getStartPosition()} and {@link ASTNode#getLength()}, * the extended source range may include comments and whitespace * immediately before or after the normal source range for the node. - * + * * @param node the node * @return the 0-based character index, or <code>-1</code> * if no source position information is recorded for this node @@ -169,7 +169,7 @@ class DefaultCommentMapper { * {@link ASTNode#getStartPosition()} and {@link ASTNode#getLength()}, * the extended source range may include comments and whitespace * immediately before or after the normal source range for the node. - * + * * @param node the node * @return a (possibly 0) length, or <code>0</code> * if no source position information is recorded for this node @@ -183,7 +183,7 @@ class DefaultCommentMapper { /** * Return index of first leading comment of a given node. - * + * * @param node * @return index of first leading comment or -1 if node has no leading comment */ @@ -200,7 +200,7 @@ class DefaultCommentMapper { /** * Return index of last trailing comment of a given node. - * + * * @param node * @return index of last trailing comment or -1 if node has no trailing comment */ @@ -226,7 +226,7 @@ class DefaultCommentMapper { // Init array pointers this.leadingPtr = -1; this.trailingPtr = -1; - + // Init comments this.comments = unit.optionalCommentTable; if (this.comments == null) { @@ -244,14 +244,14 @@ class DefaultCommentMapper { // Start unit visit DefaultASTVisitor commentVisitor = new CommentMapperVisitor(); unit.accept(commentVisitor); - + // Reduce leading arrays if necessary int leadingCount = this.leadingPtr + 1; if (leadingCount > 0 && leadingCount < this.leadingIndexes.length) { System.arraycopy(this.leadingNodes, 0, this.leadingNodes = new ASTNode[leadingCount], 0, leadingCount); System.arraycopy(this.leadingIndexes, 0, this.leadingIndexes= new long[leadingCount], 0, leadingCount); } - + // Reduce trailing arrays if necessary if (this.trailingPtr >= 0) { // remove last remaining unresolved nodes @@ -301,17 +301,17 @@ class DefaultCommentMapper { // Init extended position int nodeStart = node.getStartPosition(); int extended = nodeStart; - + // Get line of node start position int previousEndLine = getLineNumber(previousEnd, parentLineRange); int nodeStartLine = getLineNumber(nodeStart, parentLineRange); - + // Find first comment index int idx = getCommentIndex(0, nodeStart, -1); if (idx == -1) { return nodeStart; } - + // Look after potential comments int startIdx = -1; int endIdx = idx; @@ -437,10 +437,10 @@ class DefaultCommentMapper { return nodeEnd; } int extended = nodeEnd; - + // Get line number int nodeEndLine = getLineNumber(nodeEnd, parentLineRange); - + // Find comments range index int idx = getCommentIndex(0, nodeEnd, 1); if (idx == -1) { @@ -563,7 +563,7 @@ class DefaultCommentMapper { // Get default previous end ASTNode parent = node.getParent(); int previousEnd = parent.getStartPosition(); - + // Look for sibling node ASTNode sibling = parent == this.topSiblingParent ? (ASTNode) this.siblings[this.siblingPtr] : null; if (sibling != null) { @@ -587,7 +587,7 @@ class DefaultCommentMapper { } catch (Exception ex) { // Give up extended ranges at this level if unexpected exception happens... } - + // Store current node as waiting sibling for its parent if (this.topSiblingParent != parent) { if (this.siblings.length == ++this.siblingPtr) { @@ -616,7 +616,7 @@ class DefaultCommentMapper { // We're always ok to visit sub-levels return true; } - + protected void endVisitNode(ASTNode node) { // Look if a child node is waiting for trailing comments computing diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DoStatement.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DoStatement.java index 41204909c..3c12b9203 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DoStatement.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DoStatement.java @@ -21,7 +21,7 @@ import java.util.List; * DoStatement: * <b>do</b> Statement <b>while</b> <b>(</b> Expression <b>)</b> <b>;</b> * </pre> - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ @@ -31,23 +31,23 @@ public class DoStatement extends Statement { * The "expression" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor EXPRESSION_PROPERTY = + public static final ChildPropertyDescriptor EXPRESSION_PROPERTY = new ChildPropertyDescriptor(DoStatement.class, "expression", Expression.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ /** * The "body" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor BODY_PROPERTY = + public static final ChildPropertyDescriptor BODY_PROPERTY = new ChildPropertyDescriptor(DoStatement.class, "body", Statement.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List properyList = new ArrayList(3); createPropertyList(DoStatement.class, properyList); @@ -59,20 +59,20 @@ public class DoStatement extends Statement { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** - * The expression; lazily initialized; defaults to an unspecified, but + * The expression; lazily initialized; defaults to an unspecified, but * legal, expression. */ private Expression expression = null; @@ -83,13 +83,13 @@ public class DoStatement extends Statement { private Statement body = null; /** - * Creates a new unparented do statement node owned by the given + * Creates a new unparented do statement node owned by the given * AST. By default, the expresssion is unspecified, but legal, * and the body statement is an empty block. * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ DoStatement(AST ast) { @@ -102,7 +102,7 @@ public class DoStatement extends Statement { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -126,7 +126,7 @@ public class DoStatement extends Statement { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -166,12 +166,12 @@ public class DoStatement extends Statement { } visitor.endVisit(this); } - + /** * Returns the expression of this do statement. - * + * * @return the expression node - */ + */ public Expression getExpression() { if (this.expression == null) { // lazy init must be thread-safe for readers @@ -185,10 +185,10 @@ public class DoStatement extends Statement { } return this.expression; } - + /** * Sets the expression of this do statement. - * + * * @param expression the expression node * @exception IllegalArgumentException if: * <ul> @@ -196,7 +196,7 @@ public class DoStatement extends Statement { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setExpression(Expression expression) { if (expression == null) { throw new IllegalArgumentException(); @@ -209,9 +209,9 @@ public class DoStatement extends Statement { /** * Returns the body of this do statement. - * + * * @return the body statement node - */ + */ public Statement getBody() { if (this.body == null) { // lazy init must be thread-safe for readers @@ -225,7 +225,7 @@ public class DoStatement extends Statement { } return this.body; } - + /** * Sets the body of this do statement. * <p> @@ -236,7 +236,7 @@ public class DoStatement extends Statement { * compile, be sure to embed the <code>VariableDeclarationStatement</code> * inside a <code>Block</code>. * </p> - * + * * @param statement the body statement node * @exception IllegalArgumentException if: * <ul> @@ -244,7 +244,7 @@ public class DoStatement extends Statement { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setBody(Statement statement) { if (statement == null) { throw new IllegalArgumentException(); @@ -254,14 +254,14 @@ public class DoStatement extends Statement { this.body = statement; postReplaceChild(oldChild, statement, BODY_PROPERTY); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int memSize() { return super.memSize() + 2 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DocCommentParser.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DocCommentParser.java index 037b4728c..9d8617028 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DocCommentParser.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/DocCommentParser.java @@ -23,7 +23,7 @@ import org.eclipse.jdt.internal.compiler.parser.TerminalTokens; /** * Internal parser used for decoding doc comments. - * + * * @since 3.0 */ class DocCommentParser extends AbstractCommentParser { @@ -42,7 +42,7 @@ class DocCommentParser extends AbstractCommentParser { /* (non-Javadoc) * Returns true if tag @deprecated is present in annotation. - * + * * If annotation checking is enabled, will also construct an Annotation node, which will be stored into Parser.annotation * slot for being consumed later on. */ @@ -55,7 +55,7 @@ class DocCommentParser extends AbstractCommentParser { this.source = this.scanner.source; this.lineEnds = this.scanner.lineEnds; this.docComment = new Javadoc(this.ast); - + // Parse if (this.checkDocComment) { this.javadocStart = start; @@ -333,7 +333,7 @@ class DocCommentParser extends AbstractCommentParser { * @see org.eclipse.jdt.internal.compiler.parser.AbstractCommentParser#parseTag(int) */ protected boolean parseTag(int previousPosition) throws InvalidInputException { - + // Read tag name int currentPosition = this.index; int token = readTokenAndConsume(); diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/EmptyStatement.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/EmptyStatement.java index da132085f..e46e8978f 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/EmptyStatement.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/EmptyStatement.java @@ -21,19 +21,19 @@ import java.util.List; * EmptyStatement: * <b>;</b> * </pre> - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ public class EmptyStatement extends Statement { /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List properyList = new ArrayList(1); createPropertyList(EmptyStatement.class, properyList); @@ -43,37 +43,37 @@ public class EmptyStatement extends Statement { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** * Creates a new unparented null statement node owned by the given AST. * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ EmptyStatement(AST ast) { super(ast); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -106,7 +106,7 @@ public class EmptyStatement extends Statement { visitor.visit(this); visitor.endVisit(this); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/EnhancedForStatement.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/EnhancedForStatement.java index 0f2a85ad3..3625e8ab1 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/EnhancedForStatement.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/EnhancedForStatement.java @@ -22,7 +22,7 @@ import java.util.List; * <b>for</b> <b>(</b> FormalParameter <b>:</b> Expression <b>)</b> * Statement * </pre> - * + * * <p>The FormalParameter is represented by a {@link SingleVariableDeclaration} * (without an initializer).</p> * diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/EnumConstantDeclaration.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/EnumConstantDeclaration.java index cd194bbc9..9e633404a 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/EnumConstantDeclaration.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/EnumConstantDeclaration.java @@ -31,53 +31,53 @@ import java.util.List; * source range extends through the last character of the last character of * the "}" token following the body declarations. If there are arguments but * no class body declarations, the source range extends through the last - * character of the ")" token following the arguments. If there are no + * character of the ")" token following the arguments. If there are no * arguments and no class body declarations, the source range extends through * the last character of the identifier. * </p> - * + * * @since 3.1 * @noinstantiate This class is not intended to be instantiated by clients. */ public class EnumConstantDeclaration extends BodyDeclaration { - + /** * The "javadoc" structural property of this node type. */ - public static final ChildPropertyDescriptor JAVADOC_PROPERTY = + public static final ChildPropertyDescriptor JAVADOC_PROPERTY = internalJavadocPropertyFactory(EnumConstantDeclaration.class); /** * The "modifiers" structural property of this node type). */ - public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = + public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = internalModifiers2PropertyFactory(EnumConstantDeclaration.class); - + /** * The "name" structural property of this node type. */ - public static final ChildPropertyDescriptor NAME_PROPERTY = + public static final ChildPropertyDescriptor NAME_PROPERTY = new ChildPropertyDescriptor(EnumConstantDeclaration.class, "name", SimpleName.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ /** * The "arguments" structural property of this node type. */ - public static final ChildListPropertyDescriptor ARGUMENTS_PROPERTY = + public static final ChildListPropertyDescriptor ARGUMENTS_PROPERTY = new ChildListPropertyDescriptor(EnumConstantDeclaration.class, "arguments", Expression.class, NO_CYCLE_RISK); //$NON-NLS-1$ - + /** * The "anonymousClassDeclaration" structural property of this node type. */ - public static final ChildPropertyDescriptor ANONYMOUS_CLASS_DECLARATION_PROPERTY = + public static final ChildPropertyDescriptor ANONYMOUS_CLASS_DECLARATION_PROPERTY = new ChildPropertyDescriptor(EnumConstantDeclaration.class, "anonymousClassDeclaration", AnonymousClassDeclaration.class, OPTIONAL, CYCLE_RISK); //$NON-NLS-1$ - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List properyList = new ArrayList(6); createPropertyList(EnumConstantDeclaration.class, properyList); @@ -92,17 +92,17 @@ public class EnumConstantDeclaration extends BodyDeclaration { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** * The constant name; lazily initialized; defaults to a unspecified, * legal Java class identifier. @@ -110,29 +110,29 @@ public class EnumConstantDeclaration extends BodyDeclaration { private SimpleName constantName = null; /** - * The list of argument expressions (element type: + * The list of argument expressions (element type: * <code>Expression</code>). Defaults to an empty list. */ private ASTNode.NodeList arguments = new ASTNode.NodeList(ARGUMENTS_PROPERTY); - + /** - * The optional anonymous class declaration; <code>null</code> for none; + * The optional anonymous class declaration; <code>null</code> for none; * defaults to none. */ private AnonymousClassDeclaration optionalAnonymousClassDeclaration = null; - + /** * Creates a new AST node for an enumeration constants declaration owned by * the given AST. By default, the enumeration constant has an unspecified, * but legal, name; no javadoc; an empty list of modifiers and annotations; * an empty list of arguments; and does not declare an anonymous class. * <p> - * N.B. This constructor is package-private; all subclasses must be - * declared in the same package; clients are unable to declare + * N.B. This constructor is package-private; all subclasses must be + * declared in the same package; clients are unable to declare * additional subclasses. * </p> - * + * * @param ast the AST that is to own this node */ EnumConstantDeclaration(AST ast) { @@ -146,7 +146,7 @@ public class EnumConstantDeclaration extends BodyDeclaration { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -178,7 +178,7 @@ public class EnumConstantDeclaration extends BodyDeclaration { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -192,7 +192,7 @@ public class EnumConstantDeclaration extends BodyDeclaration { // allow default implementation to flag the error return super.internalGetChildListProperty(property); } - + /* (omit javadoc for this method) * Method declared on BodyDeclaration. */ @@ -245,7 +245,7 @@ public class EnumConstantDeclaration extends BodyDeclaration { // dispatch to correct overloaded match method return matcher.match(this, other); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -261,12 +261,12 @@ public class EnumConstantDeclaration extends BodyDeclaration { } visitor.endVisit(this); } - + /** * Returns the name of the constant declared in this enum declaration. - * + * * @return the constant name node - */ + */ public SimpleName getName() { if (this.constantName == null) { // lazy init must be thread-safe for readers @@ -280,18 +280,18 @@ public class EnumConstantDeclaration extends BodyDeclaration { } return this.constantName; } - + /** * Sets the name of the constant declared in this enum declaration to the * given name. - * + * * @param constantName the new constant name * @exception IllegalArgumentException if: * <ul> * <li>the node belongs to a different AST</li> * <li>the node already has a parent</li> * </ul> - */ + */ public void setName(SimpleName constantName) { if (constantName == null) { throw new IllegalArgumentException(); @@ -306,10 +306,10 @@ public class EnumConstantDeclaration extends BodyDeclaration { * Returns the live ordered list of argument expressions in this enumeration * constant declaration. Note that an empty list of arguments is equivalent * to not explicitly specifying arguments. - * - * @return the live list of argument expressions + * + * @return the live list of argument expressions * (element type: <code>Expression</code>) - */ + */ public List arguments() { return this.arguments; } @@ -317,27 +317,27 @@ public class EnumConstantDeclaration extends BodyDeclaration { /** * Returns the anonymous class declaration introduced by this * enum constant declaration, if it has one. - * + * * @return the anonymous class declaration, or <code>null</code> if none - */ + */ public AnonymousClassDeclaration getAnonymousClassDeclaration() { return this.optionalAnonymousClassDeclaration; } - + /** * Sets whether this enum constant declaration declares * an anonymous class (that is, has class body declarations). - * - * @param decl the anonymous class declaration, or <code>null</code> + * + * @param decl the anonymous class declaration, or <code>null</code> * if none - */ + */ public void setAnonymousClassDeclaration(AnonymousClassDeclaration decl) { ASTNode oldChild = this.optionalAnonymousClassDeclaration; preReplaceChild(oldChild, decl, ANONYMOUS_CLASS_DECLARATION_PROPERTY); this.optionalAnonymousClassDeclaration = decl; postReplaceChild(oldChild, decl, ANONYMOUS_CLASS_DECLARATION_PROPERTY); } - + /** * Resolves and returns the binding for the constructor invoked by this * enum constant. @@ -345,10 +345,10 @@ public class EnumConstantDeclaration extends BodyDeclaration { * Note that bindings are generally unavailable unless requested when the * AST is being built. * </p> - * + * * @return the constructor binding, or <code>null</code> if the binding * cannot be resolved - */ + */ public IMethodBinding resolveConstructorBinding() { return this.ast.getBindingResolver().resolveConstructor(this); } @@ -359,21 +359,21 @@ public class EnumConstantDeclaration extends BodyDeclaration { * Note that bindings are generally unavailable unless requested when the * AST is being built. * </p> - * - * @return the binding, or <code>null</code> if the binding cannot be + * + * @return the binding, or <code>null</code> if the binding cannot be * resolved - */ + */ public IVariableBinding resolveVariable() { return this.ast.getBindingResolver().resolveVariable(this); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int memSize() { return super.memSize() + 3 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/EnumDeclaration.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/EnumDeclaration.java index d6f61c878..9515f5a0a 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/EnumDeclaration.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/EnumDeclaration.java @@ -37,55 +37,55 @@ import java.util.List; * modifiers or annotations). The source range extends through the last * character of the "}" token following the body declarations. * </p> - * + * * @since 3.1 * @noinstantiate This class is not intended to be instantiated by clients. */ public class EnumDeclaration extends AbstractTypeDeclaration { - + /** * The "javadoc" structural property of this node type. */ - public static final ChildPropertyDescriptor JAVADOC_PROPERTY = + public static final ChildPropertyDescriptor JAVADOC_PROPERTY = internalJavadocPropertyFactory(EnumDeclaration.class); /** * The "modifiers" structural property of this node type (added in JLS3 API). */ - public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = + public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = internalModifiers2PropertyFactory(EnumDeclaration.class); - + /** * The "name" structural property of this node type. */ - public static final ChildPropertyDescriptor NAME_PROPERTY = + public static final ChildPropertyDescriptor NAME_PROPERTY = internalNamePropertyFactory(EnumDeclaration.class); /** * The "superInterfaceTypes" structural property of this node type. */ - public static final ChildListPropertyDescriptor SUPER_INTERFACE_TYPES_PROPERTY = + public static final ChildListPropertyDescriptor SUPER_INTERFACE_TYPES_PROPERTY = new ChildListPropertyDescriptor(EnumDeclaration.class, "superInterfaceTypes", Type.class, NO_CYCLE_RISK); //$NON-NLS-1$ - + /** * The "enumConstants" structural property of this node type. */ - public static final ChildListPropertyDescriptor ENUM_CONSTANTS_PROPERTY = + public static final ChildListPropertyDescriptor ENUM_CONSTANTS_PROPERTY = new ChildListPropertyDescriptor(EnumDeclaration.class, "enumConstants", EnumConstantDeclaration.class, CYCLE_RISK); //$NON-NLS-1$ - + /** * The "bodyDeclarations" structural property of this node type. */ - public static final ChildListPropertyDescriptor BODY_DECLARATIONS_PROPERTY = + public static final ChildListPropertyDescriptor BODY_DECLARATIONS_PROPERTY = internalBodyDeclarationPropertyFactory(EnumDeclaration.class); - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List properyList = new ArrayList(6); createPropertyList(EnumDeclaration.class, properyList); @@ -101,19 +101,19 @@ public class EnumDeclaration extends AbstractTypeDeclaration { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** - * The superinterface types (element type: <code>Type</code>). + * The superinterface types (element type: <code>Type</code>). * Defaults to an empty list. */ private ASTNode.NodeList superInterfaceTypes = @@ -124,20 +124,20 @@ public class EnumDeclaration extends AbstractTypeDeclaration { * (element type: <code>EnumConstantDeclaration</code>). * Defaults to an empty list. */ - private ASTNode.NodeList enumConstants = + private ASTNode.NodeList enumConstants = new ASTNode.NodeList(ENUM_CONSTANTS_PROPERTY); /** - * Creates a new AST node for an enum declaration owned by the given + * Creates a new AST node for an enum declaration owned by the given * AST. By default, the enum declaration has an unspecified, but legal, - * name; no modifiers; no javadoc; no superinterfaces; + * name; no modifiers; no javadoc; no superinterfaces; * and empty lists of enum constants and body declarations. * <p> - * N.B. This constructor is package-private; all subclasses must be - * declared in the same package; clients are unable to declare + * N.B. This constructor is package-private; all subclasses must be + * declared in the same package; clients are unable to declare * additional subclasses. * </p> - * + * * @param ast the AST that is to own this node */ EnumDeclaration(AST ast) { @@ -151,7 +151,7 @@ public class EnumDeclaration extends AbstractTypeDeclaration { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -175,7 +175,7 @@ public class EnumDeclaration extends AbstractTypeDeclaration { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -195,7 +195,7 @@ public class EnumDeclaration extends AbstractTypeDeclaration { // allow default implementation to flag the error return super.internalGetChildListProperty(property); } - + /* (omit javadoc for this method) * Method declared on BodyDeclaration. */ @@ -265,7 +265,7 @@ public class EnumDeclaration extends AbstractTypeDeclaration { // dispatch to correct overloaded match method return matcher.match(this, other); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -282,25 +282,25 @@ public class EnumDeclaration extends AbstractTypeDeclaration { } visitor.endVisit(this); } - + /** * Returns the live ordered list of superinterfaces of this enum * declaration. - * + * * @return the live list of super interface types * (element type: <code>Type</code>) - */ + */ public List superInterfaceTypes() { return this.superInterfaceTypes; } - + /** * Returns the live ordered list of enum constant declarations * of this enum declaration. - * + * * @return the live list of enum constant declarations * (element type: {@link EnumConstantDeclaration}) - */ + */ public List enumConstants() { return this.enumConstants; } @@ -311,14 +311,14 @@ public class EnumDeclaration extends AbstractTypeDeclaration { ITypeBinding internalResolveBinding() { return this.ast.getBindingResolver().resolveType(this); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int memSize() { return super.memSize() + 2 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Expression.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Expression.java index f0ed33ed2..210d6c96d 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Expression.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Expression.java @@ -45,17 +45,17 @@ package org.eclipse.jdt.core.dom; * VariableDeclarationExpression * </pre> * </p> - * + * * @since 2.0 */ public abstract class Expression extends ASTNode { - + /** * Creates a new AST node for an expression owned by the given AST. * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ Expression(AST ast) { @@ -63,7 +63,7 @@ public abstract class Expression extends ASTNode { } /** - * Resolves and returns the compile-time constant expression value as + * Resolves and returns the compile-time constant expression value as * specified in JLS2 15.28, if this expression has one. Constant expression * values are unavailable unless bindings are requested when the AST is * being built. If the type of the value is a primitive type, the result @@ -84,7 +84,7 @@ public abstract class Expression extends ASTNode { * So technically {@link NullLiteral} nodes are not constant expressions. * The result is <code>null</code> for these nonetheless. * </p> - * + * * @return the constant expression value, or <code>null</code> if this * expression has no constant expression value or if bindings were not * requested when the AST was created @@ -100,10 +100,10 @@ public abstract class Expression extends ASTNode { * Note that bindings are generally unavailable unless requested when the * AST is being built. * </p> - * + * * @return the binding for the type of this expression, or * <code>null</code> if the type cannot be resolved - */ + */ public final ITypeBinding resolveTypeBinding() { return this.ast.getBindingResolver().resolveExpressionType(this); } @@ -112,7 +112,7 @@ public abstract class Expression extends ASTNode { * Returns whether this expression node is the site of a boxing * conversion (JLS3 5.1.7). This information is available only * when bindings are requested when the AST is being built. - * + * * @return <code>true</code> if this expression is the site of a * boxing conversion, or <code>false</code> if either no boxing conversion * is involved or if bindings were not requested when the AST was created @@ -121,12 +121,12 @@ public abstract class Expression extends ASTNode { public final boolean resolveBoxing() { return this.ast.getBindingResolver().resolveBoxing(this); } - + /** * Returns whether this expression node is the site of an unboxing * conversion (JLS3 5.1.8). This information is available only * when bindings are requested when the AST is being built. - * + * * @return <code>true</code> if this expression is the site of an * unboxing conversion, or <code>false</code> if either no unboxing * conversion is involved or if bindings were not requested when the diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ExpressionStatement.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ExpressionStatement.java index 14854db28..d2313fe34 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ExpressionStatement.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ExpressionStatement.java @@ -24,26 +24,26 @@ import java.util.List; * ExpressionStatement: * StatementExpression <b>;</b> * </pre> - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ public class ExpressionStatement extends Statement { - + /** * The "expression" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor EXPRESSION_PROPERTY = + public static final ChildPropertyDescriptor EXPRESSION_PROPERTY = new ChildPropertyDescriptor(ExpressionStatement.class, "expression", Expression.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List properyList = new ArrayList(2); createPropertyList(ExpressionStatement.class, properyList); @@ -54,18 +54,18 @@ public class ExpressionStatement extends Statement { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** * The expression; lazily initialized; defaults to a unspecified, but legal, * expression. @@ -73,13 +73,13 @@ public class ExpressionStatement extends Statement { private Expression expression = null; /** - * Creates a new unparented expression statement node owned by the given + * Creates a new unparented expression statement node owned by the given * AST. By default, the expression statement is unspecified, but legal, * method invocation expression. * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ ExpressionStatement(AST ast) { @@ -92,7 +92,7 @@ public class ExpressionStatement extends Statement { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -126,7 +126,7 @@ public class ExpressionStatement extends Statement { result.setExpression((Expression) getExpression().clone(target)); return result; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -145,12 +145,12 @@ public class ExpressionStatement extends Statement { } visitor.endVisit(this); } - + /** * Returns the expression of this expression statement. - * + * * @return the expression node - */ + */ public Expression getExpression() { if (this.expression == null) { // lazy init must be thread-safe for readers @@ -164,10 +164,10 @@ public class ExpressionStatement extends Statement { } return this.expression; } - + /** * Sets the expression of this expression statement. - * + * * @param expression the new expression node * @exception IllegalArgumentException if: * <ul> @@ -175,7 +175,7 @@ public class ExpressionStatement extends Statement { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setExpression(Expression expression) { if (expression == null) { throw new IllegalArgumentException(); @@ -185,14 +185,14 @@ public class ExpressionStatement extends Statement { this.expression = expression; postReplaceChild(oldChild, expression, EXPRESSION_PROPERTY); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int memSize() { return super.memSize() + 1 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/FieldAccess.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/FieldAccess.java index 3c4e67bc8..e4ef8d71c 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/FieldAccess.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/FieldAccess.java @@ -18,10 +18,10 @@ import java.util.List; * Field access expression AST node type. * * <pre> - * FieldAccess: + * FieldAccess: * Expression <b>.</b> Identifier * </pre> - * + * * <p> * Note that there are several kinds of expressions that resemble field access * expressions: qualified names, this expressions, and super field access @@ -48,7 +48,7 @@ import java.util.List; * (<code>FieldAccess</code>).</li> * </ul> * </p> - * + * * @see QualifiedName * @see ThisExpression * @see SuperFieldAccess @@ -56,28 +56,28 @@ import java.util.List; * @noinstantiate This class is not intended to be instantiated by clients. */ public class FieldAccess extends Expression { - + /** * The "expression" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor EXPRESSION_PROPERTY = + public static final ChildPropertyDescriptor EXPRESSION_PROPERTY = new ChildPropertyDescriptor(FieldAccess.class, "expression", Expression.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ /** * The "name" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor NAME_PROPERTY = + public static final ChildPropertyDescriptor NAME_PROPERTY = new ChildPropertyDescriptor(FieldAccess.class, "name", SimpleName.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List properyList = new ArrayList(3); createPropertyList(FieldAccess.class, properyList); @@ -89,18 +89,18 @@ public class FieldAccess extends Expression { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** * The expression; lazily initialized; defaults to an unspecified, * but legal, simple name. @@ -120,7 +120,7 @@ public class FieldAccess extends Expression { * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ FieldAccess(AST ast) { @@ -133,7 +133,7 @@ public class FieldAccess extends Expression { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -157,7 +157,7 @@ public class FieldAccess extends Expression { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -196,12 +196,12 @@ public class FieldAccess extends Expression { } visitor.endVisit(this); } - + /** * Returns the expression of this field access expression. - * + * * @return the expression node - */ + */ public Expression getExpression() { if (this.expression == null) { // lazy init must be thread-safe for readers @@ -215,10 +215,10 @@ public class FieldAccess extends Expression { } return this.expression; } - + /** * Sets the expression of this field access expression. - * + * * @param expression the new expression * @exception IllegalArgumentException if: * <ul> @@ -226,7 +226,7 @@ public class FieldAccess extends Expression { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setExpression(Expression expression) { if (expression == null) { throw new IllegalArgumentException(); @@ -239,9 +239,9 @@ public class FieldAccess extends Expression { /** * Returns the name of the field accessed in this field access expression. - * + * * @return the field name - */ + */ public SimpleName getName() { if (this.fieldName == null) { // lazy init must be thread-safe for readers @@ -255,17 +255,17 @@ public class FieldAccess extends Expression { } return this.fieldName; } - + /** * Sets the name of the field accessed in this field access expression. - * + * * @param fieldName the field name * @exception IllegalArgumentException if: * <ul> * <li>the node belongs to a different AST</li> * <li>the node already has a parent</li> * </ul> - */ + */ public void setName(SimpleName fieldName) { if (fieldName == null) { throw new IllegalArgumentException(); @@ -283,7 +283,7 @@ public class FieldAccess extends Expression { // treat Code as free return BASE_NODE_SIZE + 2 * 4; } - + /** * Resolves and returns the binding for the field accessed by this * expression. @@ -299,12 +299,12 @@ public class FieldAccess extends Expression { public IVariableBinding resolveFieldBinding() { return this.ast.getBindingResolver().resolveField(this); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int treeSize() { - return + return memSize() + (this.expression == null ? 0 : getExpression().treeSize()) + (this.fieldName == null ? 0 : getName().treeSize()); diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/FieldAccessSpec.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/FieldAccessSpec.java index 30328e60c..2f3814f5f 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/FieldAccessSpec.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/FieldAccessSpec.java @@ -1,19 +1,19 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute for Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * $Id: FieldAccessSpec.java 23416 2010-02-03 19:59:31Z stephan $ - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation @@ -26,7 +26,7 @@ import java.util.List; /** * NEW for OTDT - * + * * * Represents DOM-ASTNode for callout binding to a field of the corresponding base class (OTJLD §3.5), * which has to handle code from e.g. : @@ -41,33 +41,33 @@ import java.util.List; * fieldType, * name, * signature - * + * * This node can be used only in CalloutMethodDeclaration. - * + * * @author jsv */ -public class FieldAccessSpec extends MethodMappingElement +public class FieldAccessSpec extends MethodMappingElement { /** * The "signature" structural property of this node type. */ - public static final SimplePropertyDescriptor SIGNATURE_PROPERTY = + public static final SimplePropertyDescriptor SIGNATURE_PROPERTY = internalSignaturePropertyFactory(FieldAccessSpec.class); - + /** * The "name" structural property of this node type. */ - public static final ChildPropertyDescriptor NAME_PROPERTY = + public static final ChildPropertyDescriptor NAME_PROPERTY = internalNamePropertyFactory(FieldAccessSpec.class); - + /** * The "fieldType" structural property of this node type. */ - public static final ChildPropertyDescriptor FIELD_TYPE_PROPERTY = + public static final ChildPropertyDescriptor FIELD_TYPE_PROPERTY = new ChildPropertyDescriptor(FieldAccessSpec.class, "fieldType", Type.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ @@ -95,9 +95,9 @@ public class FieldAccessSpec extends MethodMappingElement /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the AST.JLS* constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) */ public static List propertyDescriptors(int apiLevel) @@ -107,26 +107,26 @@ public class FieldAccessSpec extends MethodMappingElement else return PROPERTY_DESCRIPTORS_3_0; } - + boolean isSetter = false; - + /** * The field type. * JLS2 behevior: lazily initialized; defaults to void. * Note that this field is ignored for constructor declarations. */ private Type _fieldType = null; - + FieldAccessSpec(AST ast) { super(ast); } - + final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + final boolean internalGetSetBooleanProperty(SimplePropertyDescriptor property, boolean isGetRequest, boolean value) { if (property == SIGNATURE_PROPERTY) @@ -139,11 +139,11 @@ public class FieldAccessSpec extends MethodMappingElement { setSignatureFlag(value); return false; - } - } + } + } return super.internalGetSetBooleanProperty(property, isGetRequest, value); } - + final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean isGetRequest, ASTNode child) { if (property == NAME_PROPERTY) @@ -173,20 +173,20 @@ public class FieldAccessSpec extends MethodMappingElement // allow default implementation to flag the error return super.internalGetSetChildProperty(property, isGetRequest, child); } - + public SimplePropertyDescriptor signatureProperty() { return SIGNATURE_PROPERTY; } - + ChildPropertyDescriptor internalNameProperty() { return NAME_PROPERTY; } - + final int getNodeType0() { return FIELD_ACCESS_SPEC; } - + ASTNode clone0(AST target) { FieldAccessSpec result = new FieldAccessSpec(target); @@ -197,7 +197,7 @@ public class FieldAccessSpec extends MethodMappingElement (Type) ASTNode.copySubtree(target, getFieldType())); return result; } - + void accept0(ASTVisitor visitor) { boolean visitChildren = visitor.visit(this); @@ -209,30 +209,30 @@ public class FieldAccessSpec extends MethodMappingElement } visitor.endVisit(this); } - + final boolean subtreeMatch0(ASTMatcher matcher, Object other) { // dispatch to correct overloaded match method return matcher.match(this, other); } - + int treeSize() { return memSize() + (this.getName() == null ? 0 : getName().treeSize()) + (this.getFieldType() == null ? 0 : getFieldType().treeSize()); } - + int memSize() { return BASE_NODE_SIZE + 3 * 4; } - + /** * Returns the field type of the field in this FieldAccessSpec, - * exclusive of any extra array dimensions (JLS2 API only). + * exclusive of any extra array dimensions (JLS2 API only). * <p> - * + * * @return the field type, possibly null */ public Type getFieldType() { @@ -247,7 +247,7 @@ public class FieldAccessSpec extends MethodMappingElement * Note that this child is not relevant for constructor declarations * (although it does still figure in subtree equality comparisons and visits). * </p> - * + * * @param type the new return type, possibly the void primitive type * @exception IllegalArgumentException if: * <ul> @@ -262,9 +262,9 @@ public class FieldAccessSpec extends MethodMappingElement this._fieldType = type; postReplaceChild(oldChild, type, FIELD_TYPE_PROPERTY); } - + public IVariableBinding resolveBinding() { return this.ast.getBindingResolver().resolveVariable(this); } - + } diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/FieldDeclaration.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/FieldDeclaration.java index d82bf6f4b..628020b69 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/FieldDeclaration.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/FieldDeclaration.java @@ -32,63 +32,63 @@ import java.util.List; * the source range begins with the first character of the initial modifier or * type. The source range extends through the last character of the final ";". * </p> - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ public class FieldDeclaration extends BodyDeclaration { - + /** * The "javadoc" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor JAVADOC_PROPERTY = + public static final ChildPropertyDescriptor JAVADOC_PROPERTY = internalJavadocPropertyFactory(FieldDeclaration.class); /** * The "modifiers" structural property of this node type (JLS2 API only). * @since 3.0 */ - public static final SimplePropertyDescriptor MODIFIERS_PROPERTY = + public static final SimplePropertyDescriptor MODIFIERS_PROPERTY = internalModifiersPropertyFactory(FieldDeclaration.class); - + /** * The "modifiers" structural property of this node type (added in JLS3 API). * @since 3.1 */ - public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = + public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = internalModifiers2PropertyFactory(FieldDeclaration.class); - + /** * The "type" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor TYPE_PROPERTY = + public static final ChildPropertyDescriptor TYPE_PROPERTY = new ChildPropertyDescriptor(FieldDeclaration.class, "type", Type.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ /** * The "fragments" structural property of this node type). * @since 3.0 */ - public static final ChildListPropertyDescriptor FRAGMENTS_PROPERTY = + public static final ChildListPropertyDescriptor FRAGMENTS_PROPERTY = new ChildListPropertyDescriptor(FieldDeclaration.class, "fragments", VariableDeclarationFragment.class, CYCLE_RISK); //$NON-NLS-1$ - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. * @since 3.0 */ private static final List PROPERTY_DESCRIPTORS_2_0; - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. * @since 3.1 */ private static final List PROPERTY_DESCRIPTORS_3_0; - + static { List properyList = new ArrayList(5); createPropertyList(FieldDeclaration.class, properyList); @@ -97,7 +97,7 @@ public class FieldDeclaration extends BodyDeclaration { addProperty(TYPE_PROPERTY, properyList); addProperty(FRAGMENTS_PROPERTY, properyList); PROPERTY_DESCRIPTORS_2_0 = reapPropertyList(properyList); - + properyList = new ArrayList(5); createPropertyList(FieldDeclaration.class, properyList); addProperty(JAVADOC_PROPERTY, properyList); @@ -110,11 +110,11 @@ public class FieldDeclaration extends BodyDeclaration { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ @@ -125,7 +125,7 @@ public class FieldDeclaration extends BodyDeclaration { return PROPERTY_DESCRIPTORS_3_0; } } - + /** * The base type; lazily initialized; defaults to an unspecified, * legal type. @@ -133,21 +133,21 @@ public class FieldDeclaration extends BodyDeclaration { private Type baseType = null; /** - * The list of variable declaration fragments (element type: + * The list of variable declaration fragments (element type: * {@link VariableDeclarationFragment}). Defaults to an empty list. */ - private ASTNode.NodeList variableDeclarationFragments = + private ASTNode.NodeList variableDeclarationFragments = new ASTNode.NodeList(FRAGMENTS_PROPERTY); /** - * Creates a new unparented field declaration statement node owned + * Creates a new unparented field declaration statement node owned * by the given AST. By default, the field declaration has: no modifiers, - * an unspecified (but legal) type, and an empty list of variable + * an unspecified (but legal) type, and an empty list of variable * declaration fragments (which is syntactically illegal). * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ FieldDeclaration(AST ast) { @@ -161,7 +161,7 @@ public class FieldDeclaration extends BodyDeclaration { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -201,7 +201,7 @@ public class FieldDeclaration extends BodyDeclaration { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -215,7 +215,7 @@ public class FieldDeclaration extends BodyDeclaration { // allow default implementation to flag the error return super.internalGetChildListProperty(property); } - + /* (omit javadoc for this method) * Method declared on BodyDeclaration. */ @@ -263,7 +263,7 @@ public class FieldDeclaration extends BodyDeclaration { ASTNode.copySubtrees(target, fragments())); return result; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -271,7 +271,7 @@ public class FieldDeclaration extends BodyDeclaration { // dispatch to correct overloaded match method return matcher.match(this, other); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -288,17 +288,17 @@ public class FieldDeclaration extends BodyDeclaration { } visitor.endVisit(this); } - + /** * Returns the base type declared in this field declaration. * <p> - * N.B. The individual child variable declaration fragments may specify - * additional array dimensions. So the type of the variable are not + * N.B. The individual child variable declaration fragments may specify + * additional array dimensions. So the type of the variable are not * necessarily exactly this type. * </p> - * + * * @return the base type - */ + */ public Type getType() { if (this.baseType == null) { // lazy init must be thread-safe for readers @@ -315,14 +315,14 @@ public class FieldDeclaration extends BodyDeclaration { /** * Sets the base type declared in this field declaration to the given type. - * + * * @param type the new base type * @exception IllegalArgumentException if: * <ul> * <li>the node belongs to a different AST</li> * <li>the node already has a parent</li> * </ul> - */ + */ public void setType(Type type) { if (type == null) { throw new IllegalArgumentException(); @@ -334,26 +334,26 @@ public class FieldDeclaration extends BodyDeclaration { } /** - * Returns the live list of variable declaration fragments in this field + * Returns the live list of variable declaration fragments in this field * declaration. Adding and removing nodes from this list affects this node - * dynamically. All nodes in this list must be - * <code>VariableDeclarationFragment</code>s; attempts to add any other + * dynamically. All nodes in this list must be + * <code>VariableDeclarationFragment</code>s; attempts to add any other * type of node will trigger an exception. - * - * @return the live list of variable declaration fragments in this + * + * @return the live list of variable declaration fragments in this * statement (element type: <code>VariableDeclarationFragment</code>) - */ + */ public List fragments() { return this.variableDeclarationFragments; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int memSize() { return super.memSize() + 2 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ForStatement.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ForStatement.java index e9f56202e..1340426a9 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ForStatement.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ForStatement.java @@ -37,47 +37,47 @@ import java.util.List; * with two fragments, rather than being split up into a pair * of expressions. * </p> - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ public class ForStatement extends Statement { - + /** * The "initializers" structural property of this node type. * @since 3.0 */ - public static final ChildListPropertyDescriptor INITIALIZERS_PROPERTY = + public static final ChildListPropertyDescriptor INITIALIZERS_PROPERTY = new ChildListPropertyDescriptor(ForStatement.class, "initializers", Expression.class, CYCLE_RISK); //$NON-NLS-1$ /** * The "expression" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor EXPRESSION_PROPERTY = + public static final ChildPropertyDescriptor EXPRESSION_PROPERTY = new ChildPropertyDescriptor(ForStatement.class, "expression", Expression.class, OPTIONAL, CYCLE_RISK); //$NON-NLS-1$ /** * The "updaters" structural property of this node type. * @since 3.0 */ - public static final ChildListPropertyDescriptor UPDATERS_PROPERTY = + public static final ChildListPropertyDescriptor UPDATERS_PROPERTY = new ChildListPropertyDescriptor(ForStatement.class, "updaters", Expression.class, CYCLE_RISK); //$NON-NLS-1$ /** * The "body" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor BODY_PROPERTY = + public static final ChildPropertyDescriptor BODY_PROPERTY = new ChildPropertyDescriptor(ForStatement.class, "body", Statement.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List properyList = new ArrayList(5); createPropertyList(ForStatement.class, properyList); @@ -91,20 +91,20 @@ public class ForStatement extends Statement { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** - * The list of initializer expressions (element type: + * The list of initializer expressions (element type: * <code>Expression</code>). Defaults to an empty list. */ private ASTNode.NodeList initializers = @@ -114,9 +114,9 @@ public class ForStatement extends Statement { * The condition expression; <code>null</code> for none; defaults to none. */ private Expression optionalConditionExpression = null; - + /** - * The list of update expressions (element type: + * The list of update expressions (element type: * <code>Expression</code>). Defaults to an empty list. */ private ASTNode.NodeList updaters = @@ -127,12 +127,12 @@ public class ForStatement extends Statement { * statement. */ private Statement body = null; - + /** - * Creates a new AST node for a for statement owned by the given AST. - * By default, there are no initializers, no condition expression, + * Creates a new AST node for a for statement owned by the given AST. + * By default, there are no initializers, no condition expression, * no updaters, and the body is an empty block. - * + * * @param ast the AST that is to own this node */ ForStatement(AST ast) { @@ -145,7 +145,7 @@ public class ForStatement extends Statement { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. @@ -170,7 +170,7 @@ public class ForStatement extends Statement { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -230,37 +230,37 @@ public class ForStatement extends Statement { } visitor.endVisit(this); } - + /** * Returns the live ordered list of initializer expressions in this for * statement. * <p> - * The list should consist of either a list of so called statement - * expressions (JLS2, 14.8), or a single <code>VariableDeclarationExpression</code>. + * The list should consist of either a list of so called statement + * expressions (JLS2, 14.8), or a single <code>VariableDeclarationExpression</code>. * Otherwise, the for statement would have no Java source equivalent. * </p> - * - * @return the live list of initializer expressions + * + * @return the live list of initializer expressions * (element type: <code>Expression</code>) - */ + */ public List initializers() { return this.initializers; } - + /** - * Returns the condition expression of this for statement, or + * Returns the condition expression of this for statement, or * <code>null</code> if there is none. - * - * @return the condition expression node, or <code>null</code> if + * + * @return the condition expression node, or <code>null</code> if * there is none - */ + */ public Expression getExpression() { return this.optionalConditionExpression; } - + /** * Sets or clears the condition expression of this return statement. - * + * * @param expression the condition expression node, or <code>null</code> * if there is none * @exception IllegalArgumentException if: @@ -269,7 +269,7 @@ public class ForStatement extends Statement { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setExpression(Expression expression) { ASTNode oldChild = this.optionalConditionExpression; preReplaceChild(oldChild, expression, EXPRESSION_PROPERTY); @@ -284,19 +284,19 @@ public class ForStatement extends Statement { * The list should consist of so called statement expressions. Otherwise, * the for statement would have no Java source equivalent. * </p> - * - * @return the live list of update expressions + * + * @return the live list of update expressions * (element type: <code>Expression</code>) - */ + */ public List updaters() { return this.updaters; } - + /** * Returns the body of this for statement. - * + * * @return the body statement node - */ + */ public Statement getBody() { if (this.body == null) { // lazy init must be thread-safe for readers @@ -310,7 +310,7 @@ public class ForStatement extends Statement { } return this.body; } - + /** * Sets the body of this for statement. * <p> @@ -321,7 +321,7 @@ public class ForStatement extends Statement { * compile, be sure to embed the <code>VariableDeclarationStatement</code> * inside a <code>Block</code>. * </p> - * + * * @param statement the body statement node * @exception IllegalArgumentException if: * <ul> @@ -329,7 +329,7 @@ public class ForStatement extends Statement { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setBody(Statement statement) { if (statement == null) { throw new IllegalArgumentException(); @@ -339,14 +339,14 @@ public class ForStatement extends Statement { this.body = statement; postReplaceChild(oldChild, statement, BODY_PROPERTY); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int memSize() { return super.memSize() + 4 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/GuardPredicateDeclaration.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/GuardPredicateDeclaration.java index ee9ace527..e3b7fd5e9 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/GuardPredicateDeclaration.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/GuardPredicateDeclaration.java @@ -1,19 +1,19 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2006 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute for Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * $Id: GuardPredicateDeclaration.java 23417 2010-02-03 20:13:55Z stephan $ - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation @@ -25,7 +25,7 @@ import java.util.List; /** * This class represents a declaration of a guard predicate in OT/J (OTJLD §5.4). - * + * * @author stephan */ public class GuardPredicateDeclaration extends ASTNode { @@ -39,12 +39,12 @@ public class GuardPredicateDeclaration extends ASTNode { /** * The "base" structural property of this node type, marking whether it is a "base guard" or not. */ - public static final SimplePropertyDescriptor BASE_PROPERTY = + public static final SimplePropertyDescriptor BASE_PROPERTY = new SimplePropertyDescriptor(GuardPredicateDeclaration.class, "base", boolean.class, MANDATORY); //$NON-NLS-1$ - + private static final List PROPERTY_DESCRIPTORS_3_0; - + static { List propertyList = new ArrayList(3); createPropertyList(GuardPredicateDeclaration.class, propertyList); @@ -52,7 +52,7 @@ public class GuardPredicateDeclaration extends ASTNode { addProperty(EXPRESSION_PROPERTY, propertyList); PROPERTY_DESCRIPTORS_3_0 = reapPropertyList(propertyList); } - + public static List propertyDescriptors(int apiLevel) { if (apiLevel == AST.JLS2_INTERNAL) { throw new UnsupportedOperationException("JLS2 not supported"); //$NON-NLS-1$ @@ -60,15 +60,15 @@ public class GuardPredicateDeclaration extends ASTNode { return PROPERTY_DESCRIPTORS_3_0; } } - + private Expression expression = null; private boolean isBase = false; - + GuardPredicateDeclaration(AST ast) { super(ast); } - + @Override boolean internalGetSetBooleanProperty(SimplePropertyDescriptor property, boolean get, boolean value) { @@ -78,7 +78,7 @@ public class GuardPredicateDeclaration extends ASTNode { } else { setBase(value); return false; - } + } } // allow default implementation to flag the error return super.internalGetSetBooleanProperty(property, get, value); @@ -103,7 +103,7 @@ public class GuardPredicateDeclaration extends ASTNode { int getNodeType0() { return GUARD_PREDICATE_DECLARATION; } - + @Override void accept0(ASTVisitor visitor) { boolean visitChildren = visitor.visit(this); @@ -126,7 +126,7 @@ public class GuardPredicateDeclaration extends ASTNode { @Override ASTNode clone0(AST target) { - if (this.ast.apiLevel == AST.JLS2_INTERNAL) + if (this.ast.apiLevel == AST.JLS2_INTERNAL) unsupportedIn2(); GuardPredicateDeclaration result = new GuardPredicateDeclaration(target); result.setSourceRange(this.getStartPosition(), this.getLength()); @@ -134,7 +134,7 @@ public class GuardPredicateDeclaration extends ASTNode { result.setExpression((Expression)ASTNode.copySubtree(target, getExpression())); return result; } - + public boolean isBase() { return isBase; @@ -143,7 +143,7 @@ public class GuardPredicateDeclaration extends ASTNode { public void setBase(boolean isBase) { preValueChange(BASE_PROPERTY); - this.isBase = isBase; + this.isBase = isBase; postValueChange(BASE_PROPERTY); } @@ -161,7 +161,7 @@ public class GuardPredicateDeclaration extends ASTNode { } return this.expression; } - + public void setExpression(Expression expression) { if (expression == null) { throw new IllegalArgumentException(); @@ -176,7 +176,7 @@ public class GuardPredicateDeclaration extends ASTNode { List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + @Override void appendDebugString(StringBuffer buffer) { if (this.isBase) diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IAnnotationBinding.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IAnnotationBinding.java index 5f6c10e5f..516692b77 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IAnnotationBinding.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IAnnotationBinding.java @@ -15,7 +15,7 @@ package org.eclipse.jdt.core.dom; /** * Represents a resolved annotation. Resolved annotations are computed along with other * bindings; they correspond to {@link Annotation} nodes. - * + * * @since 3.2 * @noimplement This interface is not intended to be implemented by clients. */ @@ -23,21 +23,21 @@ public interface IAnnotationBinding extends IBinding { /** * Returns the complete list of member value pairs for this annotation, including - * ones explicitly listed in the annotation as well as entries for + * ones explicitly listed in the annotation as well as entries for * annotation type members with default values that are implied. - * + * * @return a possibly empty list of resolved member value pairs */ IMemberValuePairBinding[] getAllMemberValuePairs(); - + /** * Returns the type of the annotation. The resulting type binding will always * return <code>true</code> to <code>ITypeBinding.isAnnotation()</code>. - * + * * @return the type of the annotation */ ITypeBinding getAnnotationType(); - + /** * Returns the list of declared member value pairs for this annotation. * Returns an empty list for a {@link MarkerAnnotation}, a one element @@ -45,20 +45,20 @@ public interface IAnnotationBinding extends IBinding { * of the explicitly listed values in a {@link NormalAnnotation}. * <p> * Note that the list only includes entries for annotation type members that are - * explicitly mentioned in the annotation. The list does not include any + * explicitly mentioned in the annotation. The list does not include any * annotation type members with default values that are merely implied. * Use {@link #getAllMemberValuePairs()} to get those as well. * </p> - * + * * @return a possibly empty list of resolved member value pairs */ IMemberValuePairBinding[] getDeclaredMemberValuePairs(); - + /** * Returns the name of the annotation type. - * + * * @return the name of the annotation type */ public String getName(); - + } diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IBinding.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IBinding.java index e15474ba0..7ca284a48 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IBinding.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IBinding.java @@ -91,11 +91,11 @@ public interface IBinding { */ public static final int MEMBER_VALUE_PAIR = 6; -//{ObjectTeams: Binding for method mappings. +//{ObjectTeams: Binding for method mappings. /** * Kind constant (value 7) indicating a callin/callout method mapping. * Bindings of this kind can be safely cast to <code>IMethodMappingBinding</code>. - * + * * @see #getKind() * @see IMethodMappingBinding */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IExtendedModifier.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IExtendedModifier.java index 50b831cf3..7872c3f28 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IExtendedModifier.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IExtendedModifier.java @@ -21,22 +21,22 @@ package org.eclipse.jdt.core.dom; * @since 3.1 */ public interface IExtendedModifier { - + /** * Returns whether this extended modifier is a standard modifier. - * + * * @return <code>true</code> if this is a standard modifier * (instance of {@link Modifier}), and <code>false</code> otherwise - */ + */ public boolean isModifier(); - + /** * Returns whether this extended modifier is an annotation. - * + * * @return <code>true</code> if this is an annotation - * (instance of a subclass of {@link Annotation}), and + * (instance of a subclass of {@link Annotation}), and * <code>false</code> otherwise - */ + */ public boolean isAnnotation(); } diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IMemberValuePairBinding.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IMemberValuePairBinding.java index 1d8fb5183..e1813a5d6 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IMemberValuePairBinding.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IMemberValuePairBinding.java @@ -16,21 +16,21 @@ package org.eclipse.jdt.core.dom; * Represents a resolved instance of an annotation's member value pair. * Resolved annotation are computed along with other bindings; these objects * correspond to {@link MemberValuePair} nodes. - * + * * @since 3.2 * @noimplement This interface is not intended to be implemented by clients. */ public interface IMemberValuePairBinding extends IBinding { /** * Returns the name of the annotation type member. - * + * * @return the name of the member */ public String getName(); /** * Returns the method binding corresponding to the named annotation type member. - * + * * @return the method binding for the annotation type member */ public IMethodBinding getMethodBinding(); @@ -46,7 +46,7 @@ public IMethodBinding getMethodBinding(); * <li>array type - an <code>Object[]</code> whose elements are as per above * (the language only allows single dimensional arrays in annotations)</li> * </ul> - * + * * @return the resolved value, or <code>null</code> if none exists */ public Object getValue(); diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IMethodBinding.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IMethodBinding.java index e6ee64fc6..94971db5f 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IMethodBinding.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IMethodBinding.java @@ -34,18 +34,18 @@ package org.eclipse.jdt.core.dom; * @noimplement This interface is not intended to be implemented by clients. */ public interface IMethodBinding extends IBinding { - + /** * Returns whether this binding is for a constructor or a method. - * + * * @return <code>true</code> if this is the binding for a constructor, * and <code>false</code> if this is the binding for a method - */ + */ public boolean isConstructor(); /** - * Returns whether this binding is known to be a compiler-generated - * default constructor. + * Returns whether this binding is known to be a compiler-generated + * default constructor. * <p> * This method returns <code>false</code> for: * <ul> @@ -59,35 +59,35 @@ public interface IMethodBinding extends IBinding { * class file whether a 0-argument constructor was present in the source * code versus generated automatically by a Java compiler)</li> * </ul> - * - * @return <code>true</code> if this is known to be the binding for a + * + * @return <code>true</code> if this is known to be the binding for a * compiler-generated default constructor, and <code>false</code> * otherwise * @since 3.0 - */ + */ public boolean isDefaultConstructor(); - + /** * Returns the name of the method declared in this binding. The method name * is always a simple identifier. The name of a constructor is always the * same as the declared name of its declaring class. - * + * * @return the name of this method, or the declared name of this * constructor's declaring class */ public String getName(); - + /** * Returns the type binding representing the class or interface * that declares this method or constructor. - * + * * @return the binding of the class or interface that declares this method * or constructor */ public ITypeBinding getDeclaringClass(); /** - * Returns the resolved default value of an annotation type member, + * Returns the resolved default value of an annotation type member, * or <code>null</code> if the member has no default value, or if this * is not the binding for an annotation type member. * <p> @@ -102,7 +102,7 @@ public interface IMethodBinding extends IBinding { * <li>array type - an <code>Object[]</code> whose elements are as per above * (the language only allows single dimensional arrays in annotations)</li> * </ul> - * + * * @return the default value of this annotation type member, or <code>null</code> * if none or not applicable * @since 3.2 @@ -111,13 +111,13 @@ public interface IMethodBinding extends IBinding { /** * Returns the resolved annotations of a parameter of this method. - * The result returned is the same regardless of whether + * The result returned is the same regardless of whether * this is a parameterized method. - * + * * @param paramIndex the index of the parameter of interest * @return the resolved annotations of the <code>paramIndex</code>th parameter, * or an empty list if there are none - * @throws ArrayIndexOutOfBoundsException if <code>paramIndex</code> is + * @throws ArrayIndexOutOfBoundsException if <code>paramIndex</code> is * not a valid index * @since 3.2 */ @@ -140,7 +140,7 @@ public interface IMethodBinding extends IBinding { * Note: The result does not include synthetic parameters introduced by * inner class emulation. * </p> - * + * * @return a (possibly empty) list of type bindings for the formal * parameters of this method or constructor */ @@ -149,7 +149,7 @@ public interface IMethodBinding extends IBinding { /** * Returns the binding for the return type of this method. Returns the * special primitive <code>void</code> return type for constructors. - * + * * @return the binding for the return type of this method, or the * <code>void</code> return type for constructors */ @@ -159,12 +159,12 @@ public interface IMethodBinding extends IBinding { * Returns a list of type bindings representing the types of the exceptions thrown * by this method or constructor. Returns an array of length 0 if this method * throws no exceptions. The resulting types are in no particular order. - * + * * @return a list of type bindings for exceptions * thrown by this method or constructor */ public ITypeBinding[] getExceptionTypes(); - + /** * Returns the type parameters of this method or constructor binding. * <p> @@ -184,7 +184,7 @@ public interface IMethodBinding extends IBinding { /** * Returns whether this is the binding for an annotation type member. - * + * * @return <code>true</code> iff this is the binding for an annotation type member * and <code>false</code> otherwise * @since 3.2 @@ -208,13 +208,13 @@ public interface IMethodBinding extends IBinding { * and {@link #isRawMethod()} are mutually exclusive. * </p> * - * @return <code>true</code> if this method binding represents a + * @return <code>true</code> if this method binding represents a * declaration of a generic method, and <code>false</code> otherwise * @see #getTypeParameters() * @since 3.1 */ public boolean isGenericMethod(); - + /** * Returns whether this method binding represents an instance of * a generic method corresponding to a parameterized method reference. @@ -224,7 +224,7 @@ public interface IMethodBinding extends IBinding { * and {@link #isRawMethod()} are mutually exclusive. * </p> * - * @return <code>true</code> if this method binding represents a + * @return <code>true</code> if this method binding represents a * an instance of a generic method corresponding to a parameterized * method reference, and <code>false</code> otherwise * @see #getMethodDeclaration() @@ -232,7 +232,7 @@ public interface IMethodBinding extends IBinding { * @since 3.1 */ public boolean isParameterizedMethod(); - + /** * Returns the type arguments of this generic method instance, or the * empty list for other method bindings. @@ -242,7 +242,7 @@ public interface IMethodBinding extends IBinding { * reference to a generic method. Do not confuse these with type parameters * which only occur on the method binding corresponding directly to the * declaration of a generic method. - * </p> + * </p> * * @return the list of type bindings for the type arguments used to * instantiate the corrresponding generic method, or otherwise the empty list @@ -252,7 +252,7 @@ public interface IMethodBinding extends IBinding { * @since 3.1 */ public ITypeBinding[] getTypeArguments(); - + /** * Returns the binding for the method declaration corresponding to this * method binding. For parameterized methods ({@link #isParameterizedMethod()}) @@ -260,17 +260,17 @@ public interface IMethodBinding extends IBinding { * for the corresponding generic method. For other method bindings, this * returns the same binding. * - * <p>Note: The one notable exception is the method <code>Object.getClass()</code>, - * which is declared to return <code>Class<? extends Object></code>, but - * when invoked its return type becomes <code>Class<? extends - * </code><em>R</em><code>></code>, where <em>R</em> is the compile type of + * <p>Note: The one notable exception is the method <code>Object.getClass()</code>, + * which is declared to return <code>Class<? extends Object></code>, but + * when invoked its return type becomes <code>Class<? extends + * </code><em>R</em><code>></code>, where <em>R</em> is the compile type of * the receiver of the method invocation.</p> * * @return the method binding * @since 3.1 */ public IMethodBinding getMethodDeclaration(); - + /** * Returns whether this method binding represents an instance of * a generic method corresponding to a raw method reference. @@ -280,7 +280,7 @@ public interface IMethodBinding extends IBinding { * and {@link #isRawMethod()} are mutually exclusive. * </p> * - * @return <code>true</code> if this method binding represents a + * @return <code>true</code> if this method binding represents a * an instance of a generic method corresponding to a raw * method reference, and <code>false</code> otherwise * @see #getMethodDeclaration() @@ -288,33 +288,33 @@ public interface IMethodBinding extends IBinding { * @since 3.1 */ public boolean isRawMethod(); - + /** * Returns whether this method's signature is a subsignature of the given method as - * specified in section 8.4.2 of <em>The Java Language Specification, Third Edition</em> (JLS3). - * + * specified in section 8.4.2 of <em>The Java Language Specification, Third Edition</em> (JLS3). + * * @return <code>true</code> if this method's signature is a subsignature of the given method * @since 3.1 */ public boolean isSubsignature(IMethodBinding otherMethod); - + /** * Returns whether this is a variable arity method. * <p> * Note: Variable arity ("varargs") methods were added in JLS3. * </p> - * + * * @return <code>true</code> if this is a variable arity method, * and <code>false</code> otherwise * @since 3.1 - */ + */ public boolean isVarargs(); - + /** * Returns whether this method overrides the given method, - * as specified in section 8.4.8.1 of <em>The Java Language + * as specified in section 8.4.8.1 of <em>The Java Language * Specification, Third Edition</em> (JLS3). - * + * * @param method the method that is possibly overriden * @return <code>true</code> if this method overrides the given method, * and <code>false</code> otherwise @@ -322,12 +322,12 @@ public interface IMethodBinding extends IBinding { */ public boolean overrides(IMethodBinding method); -//{ObjectTeams: - /** +//{ObjectTeams: + /** * Is method copied due to implicit inheritance? * (beware: copied methods don't have a java element.) - * - * @since OTDT 1.1.3 + * + * @since OTDT 1.1.3 */ public boolean isCopied(); // SH} diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IMethodMappingBinding.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IMethodMappingBinding.java index d354b2a4f..a851ee25c 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IMethodMappingBinding.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IMethodMappingBinding.java @@ -1,19 +1,19 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2005, 2007 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute for Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * $Id: IMethodMappingBinding.java 23417 2010-02-03 20:13:55Z stephan $ - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation @@ -25,31 +25,31 @@ import org.eclipse.objectteams.otdt.core.compiler.InferenceKind; /** * A callin/callout binding represents a callin-/callout method mapping * or a callout to field. - * + * * @author mkr * @noimplement This interface is not intended to be implemented by clients. */ public interface IMethodMappingBinding extends IBinding { - + public String getName(); - + /** * Returns the type binding representing the role class * that declares this callin-/callout mapping. - * + * * @return the binding of the role class that declares this mapping */ public ITypeBinding getDeclaringRoleClass(); - + public ITypeBinding getReferencedBaseClass(); - + public IMethodBinding getRoleMethod(); public IMethodBinding[] getBaseMethods(); - + public String[] getBaseArgumentNames(); - + /** * @return true if this is a callin binding (vs. callout) */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IPackageBinding.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IPackageBinding.java index 8f3c7aa87..cd6ac47f7 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IPackageBinding.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IPackageBinding.java @@ -13,7 +13,7 @@ package org.eclipse.jdt.core.dom; /** * A package binding represents a named or unnamed package. - * + * * @since 2.0 * @noimplement This interface is not intended to be implemented by clients. */ @@ -21,14 +21,14 @@ public interface IPackageBinding extends IBinding { /** * Returns the name of the package represented by this binding. For named - * packages, this is the fully qualified package name (using "." for + * packages, this is the fully qualified package name (using "." for * separators). For unnamed packages, this is an empty string. - * + * * @return the name of the package represented by this binding, or * an empty string for an unnamed package */ public String getName(); - + /** * Returns whether this package is an unnamed package. * See <em>The Java Language Specification</em> section 7.4.2 for details. @@ -37,25 +37,25 @@ public interface IPackageBinding extends IBinding { * <code>false</code> otherwise */ public boolean isUnnamed(); - + /** * Returns the list of name component making up the name of the package * represented by this binding. For example, for the package named * "com.example.tool", this method returns {"com", "example", "tool"}. * Returns the empty list for unnamed packages. - * + * * @return the name of the package represented by this binding, or the * empty list for unnamed packages */ public String[] getNameComponents(); - + // /** // * Finds and returns the binding for the class or interface with the given // * name declared in this package. // * <p> // * For top-level classes and interfaces, the name here is just the simple // * name of the class or interface. For nested classes and interfaces, the -// * name is the VM class name (in other words, a name like +// * name is the VM class name (in other words, a name like // * <code>"Outer$Inner"</code> as used to name the class file; see // * <code>ITypeBinding.getName</code>). // * </p> diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ITypeBinding.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ITypeBinding.java index c5d8b48a3..ad5d4a6c8 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ITypeBinding.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ITypeBinding.java @@ -17,7 +17,7 @@ package org.eclipse.jdt.core.dom; /** * MIGRATION_STATE: 3.4 - * + * * <h4>OTDT changes:</h4> * <dl> * <dt>What:<dd> new lookup functions for teams and roles. @@ -121,7 +121,7 @@ public interface ITypeBinding extends IBinding { * @since 3.5 */ public int getRank(); - + /** * Returns the binding representing the component type of this array type, * or <code>null</code> if this is not an array type binding. The component @@ -137,7 +137,7 @@ public interface ITypeBinding extends IBinding { /** * Returns a list of bindings representing all the fields declared * as members of this class, interface, or enum type. - * + * * <p>These include public, protected, default (package-private) access, * and private fields declared by the class, but excludes inherited fields. * Synthetic fields may or may not be included. Fields from binary types that @@ -408,7 +408,7 @@ public interface ITypeBinding extends IBinding { * the package of the enclosing type, or, if the type name is the name of a * {@linkplain AST#resolveWellKnownType(String) well-known type}, * the package of the matching well-known type.</p> - * + * * @return the binding for the package in which this class, interface, * enum, or annotation type is declared, or <code>null</code> if this type * binding represents a primitive type, an array type, the null type, @@ -768,7 +768,7 @@ public interface ITypeBinding extends IBinding { * and <code>false</code> otherwise */ public boolean isTeam(); - + /** * Returns whether this type binding represents a role type. * @@ -780,22 +780,22 @@ public interface ITypeBinding extends IBinding { /** * Returns whether this binding is the classpart of other binding * (which must then be the interface part ;-) - * + * * @param other * @return */ public boolean isClassPartOf(ITypeBinding other); - + /** * Returns whether this binding is the synthetic interface part of a role */ public boolean isSynthRoleIfc(); - + /** * For a role class returns the corresponding interface part. */ public ITypeBinding getIfcPart(); - + /** * Returns the type binding for the baseclass of the type represented * by this class binding. @@ -803,11 +803,11 @@ public interface ITypeBinding extends IBinding { * or <code>null</code> if none */ public ITypeBinding getBaseClass(); - + /** * Returns the name of this type as getQualifiedName() would do, * but respect anchored types. - * + * * @return */ public String getOptimalName(); @@ -819,7 +819,7 @@ public interface ITypeBinding extends IBinding { * @return super roles or null, if not a role. */ public ITypeBinding[] getSuperRoles(); -//mkr} +//mkr} /** * Returns whether this type binding represents a local class. * <p> @@ -1023,19 +1023,19 @@ public interface ITypeBinding extends IBinding { * @see #isUpperbound() */ public boolean isWildcardType(); - + //{ObjectTeams: new queries /** * Returns whether this type binding represents a dependent type. * @param onlyRelevant only report dependence on relevant (non-tthis) anchors */ boolean isDependentType(boolean onlyRelevant); - + /** * If this type binding represents a dependent type * return the path of its type anchor. * @return path or empty array. */ public String[] getAnchorPath(); -// SH} +// SH} } diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IVariableBinding.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IVariableBinding.java index c86e397c4..789b5685d 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IVariableBinding.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IVariableBinding.java @@ -12,8 +12,8 @@ package org.eclipse.jdt.core.dom; /** - * A variable binding represents either a field of a class or interface, or - * a local variable declaration (including formal parameters, local variables, + * A variable binding represents either a field of a class or interface, or + * a local variable declaration (including formal parameters, local variables, * and exception variables). * * @see ITypeBinding#getDeclaredFields() @@ -21,32 +21,32 @@ package org.eclipse.jdt.core.dom; * @noimplement This interface is not intended to be implemented by clients. */ public interface IVariableBinding extends IBinding { - + /** * Returns whether this binding is for a field. * Note that this method returns <code>true</code> for constants, * including enum constants. This method returns <code>false</code> * for local variables. - * + * * @return <code>true</code> if this is the binding for a field, * and <code>false</code> otherwise - */ + */ public boolean isField(); - + /** * Returns whether this binding is for an enum constant. * Note that this method returns <code>false</code> for local variables * and for fields other than enum constants. - * + * * @return <code>true</code> if this is the binding for an enum constant, * and <code>false</code> otherwise * @since 3.1 - */ + */ public boolean isEnumConstant(); - + /** - * Returns whether this binding corresponds to a parameter. - * + * Returns whether this binding corresponds to a parameter. + * * @return <code>true</code> if this is the binding for a parameter, * and <code>false</code> otherwise * @since 3.2 @@ -56,20 +56,20 @@ public interface IVariableBinding extends IBinding { /** * Returns the name of the field or local variable declared in this binding. * The name is always a simple identifier. - * + * * @return the name of this field or local variable */ public String getName(); - + /** * Returns the type binding representing the class or interface * that declares this field. * <p> * The declaring class of a field is the class or interface of which it is - * a member. Local variables have no declaring class. The field length of an + * a member. Local variables have no declaring class. The field length of an * array type has no declaring class. * </p> - * + * * @return the binding of the class or interface that declares this field, * or <code>null</code> if none */ @@ -77,11 +77,11 @@ public interface IVariableBinding extends IBinding { /** * Returns the binding for the type of this field or local variable. - * + * * @return the binding for the type of this field or local variable */ public ITypeBinding getType(); - + /** * Returns a small integer variable id for this variable binding. * <p> @@ -97,20 +97,20 @@ public interface IVariableBinding extends IBinding { * declared in a type's instance initializers (or initializer expressions * of non-static fields) are assigned ascending ids in normal code reading * order. These ids are useful when checking definite assignment for - * static initializers (JLS 16.7) and instance initializers (JLS 16.8), + * static initializers (JLS 16.7) and instance initializers (JLS 16.8), * respectively. * </p> * <p> - * <b>Fields:</b> Fields declared as members of a type are assigned - * ascending ids in normal code reading order; + * <b>Fields:</b> Fields declared as members of a type are assigned + * ascending ids in normal code reading order; * field1.getVariableId()<field2.getVariableId() means that field1 is declared before * field2. * </p> - * + * * @return a small non-negative variable id */ public int getVariableId(); - + /** * Returns this binding's constant value if it has one. * Some variables may have a value computed at compile-time. If the type of @@ -120,12 +120,12 @@ public interface IVariableBinding extends IBinding { * no compile-time computed value, the result is <code>null</code>. * (Note: compile-time constant expressions cannot denote <code>null</code>; * JLS2 15.28.). The result is always <code>null</code> for enum constants. - * + * * @return the constant value, or <code>null</code> if none * @since 3.0 */ public Object getConstantValue(); - + /** * Returns the method binding representing the method containing the scope * in which this local variable is declared. @@ -138,13 +138,13 @@ public interface IVariableBinding extends IBinding { * declared in a static or instance initializer; this method returns * <code>null</code> in those cases. * </p> - * + * * @return the binding of the method or constructor that declares this * local variable, or <code>null</code> if none * @since 3.1 */ public IMethodBinding getDeclaringMethod(); - + /** * Returns the binding for the variable declaration corresponding to this * variable binding. For a binding for a field declaration in an instance diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IfStatement.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IfStatement.java index e35db215e..e5f8aa25e 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IfStatement.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/IfStatement.java @@ -20,40 +20,40 @@ import java.util.List; * IfStatement: * <b>if</b> <b>(</b> Expression <b>)</b> Statement [ <b>else</b> Statement] * </pre> - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ public class IfStatement extends Statement { - + /** * The "expression" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor EXPRESSION_PROPERTY = + public static final ChildPropertyDescriptor EXPRESSION_PROPERTY = new ChildPropertyDescriptor(IfStatement.class, "expression", Expression.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ /** * The "thenStatement" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor THEN_STATEMENT_PROPERTY = + public static final ChildPropertyDescriptor THEN_STATEMENT_PROPERTY = new ChildPropertyDescriptor(IfStatement.class, "thenStatement", Statement.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ /** * The "elseStatement" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor ELSE_STATEMENT_PROPERTY = + public static final ChildPropertyDescriptor ELSE_STATEMENT_PROPERTY = new ChildPropertyDescriptor(IfStatement.class, "elseStatement", Statement.class, OPTIONAL, CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List properyList = new ArrayList(4); createPropertyList(IfStatement.class, properyList); @@ -66,26 +66,26 @@ public class IfStatement extends Statement { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** - * The expression; lazily initialized; defaults to an unspecified, but + * The expression; lazily initialized; defaults to an unspecified, but * legal, expression. */ private Expression expression = null; /** - * The then statement; lazily initialized; defaults to an unspecified, but + * The then statement; lazily initialized; defaults to an unspecified, but * legal, statement. */ private Statement thenStatement = null; @@ -96,27 +96,27 @@ public class IfStatement extends Statement { private Statement optionalElseStatement = null; /** - * Creates a new unparented if statement node owned by the given + * Creates a new unparented if statement node owned by the given * AST. By default, the expresssion is unspecified, * but legal, the then statement is an empty block, and there is no else * statement. * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ IfStatement(AST ast) { super(ast); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -148,7 +148,7 @@ public class IfStatement extends Statement { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -192,12 +192,12 @@ public class IfStatement extends Statement { } visitor.endVisit(this); } - + /** * Returns the expression of this if statement. - * + * * @return the expression node - */ + */ public Expression getExpression() { if (this.expression == null) { // lazy init must be thread-safe for readers @@ -211,10 +211,10 @@ public class IfStatement extends Statement { } return this.expression; } - + /** * Sets the condition of this if statement. - * + * * @param expression the expression node * @exception IllegalArgumentException if: * <ul> @@ -222,7 +222,7 @@ public class IfStatement extends Statement { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setExpression(Expression expression) { if (expression == null) { throw new IllegalArgumentException(); @@ -235,9 +235,9 @@ public class IfStatement extends Statement { /** * Returns the "then" part of this if statement. - * + * * @return the "then" statement node - */ + */ public Statement getThenStatement() { if (this.thenStatement == null) { // lazy init must be thread-safe for readers @@ -251,7 +251,7 @@ public class IfStatement extends Statement { } return this.thenStatement; } - + /** * Sets the "then" part of this if statement. * <p> @@ -262,7 +262,7 @@ public class IfStatement extends Statement { * compile, be sure to embed the <code>VariableDeclarationStatement</code> * inside a <code>Block</code>. * </p> - * + * * @param statement the "then" statement node * @exception IllegalArgumentException if: * <ul> @@ -270,7 +270,7 @@ public class IfStatement extends Statement { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setThenStatement(Statement statement) { if (statement == null) { throw new IllegalArgumentException(); @@ -285,12 +285,12 @@ public class IfStatement extends Statement { * Returns the "else" part of this if statement, or <code>null</code> if * this if statement has <b>no</b> "else" part. * <p> - * Note that there is a subtle difference between having no else + * Note that there is a subtle difference between having no else * statement and having an empty statement ("{}") or null statement (";"). * </p> - * + * * @return the "else" statement node, or <code>null</code> if none - */ + */ public Statement getElseStatement() { return this.optionalElseStatement; } @@ -300,7 +300,7 @@ public class IfStatement extends Statement { * <p> * Note that there is a subtle difference between having no else part * (as in <code>"if(true){}"</code>) and having an empty block (as in - * "if(true){}else{}") or null statement (as in "if(true){}else;"). + * "if(true){}else{}") or null statement (as in "if(true){}else;"). * </p> * <p> * Special note: The Java language does not allow a local variable declaration @@ -310,8 +310,8 @@ public class IfStatement extends Statement { * compile, be sure to embed the <code>VariableDeclarationStatement</code> * inside a <code>Block</code>. * </p> - * - * @param statement the "else" statement node, or <code>null</code> if + * + * @param statement the "else" statement node, or <code>null</code> if * there is none * @exception IllegalArgumentException if: * <ul> @@ -319,21 +319,21 @@ public class IfStatement extends Statement { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setElseStatement(Statement statement) { ASTNode oldChild = this.optionalElseStatement; preReplaceChild(oldChild, statement, ELSE_STATEMENT_PROPERTY); this.optionalElseStatement = statement; postReplaceChild(oldChild, statement, ELSE_STATEMENT_PROPERTY); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int memSize() { return super.memSize() + 3 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ImportDeclaration.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ImportDeclaration.java index 7ad6c7da7..5c2175aa1 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ImportDeclaration.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ImportDeclaration.java @@ -32,60 +32,60 @@ import java.util.List; * @noinstantiate This class is not intended to be instantiated by clients. */ public class ImportDeclaration extends ASTNode { - + /** * The "name" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor NAME_PROPERTY = + public static final ChildPropertyDescriptor NAME_PROPERTY = new ChildPropertyDescriptor(ImportDeclaration.class, "name", Name.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ /** * The "onDemand" structural property of this node type. * @since 3.0 */ - public static final SimplePropertyDescriptor ON_DEMAND_PROPERTY = + public static final SimplePropertyDescriptor ON_DEMAND_PROPERTY = new SimplePropertyDescriptor(ImportDeclaration.class, "onDemand", boolean.class, MANDATORY); //$NON-NLS-1$ - + /** * The "static" structural property of this node type (added in JLS3 API). * @since 3.1 */ - public static final SimplePropertyDescriptor STATIC_PROPERTY = + public static final SimplePropertyDescriptor STATIC_PROPERTY = new SimplePropertyDescriptor(ImportDeclaration.class, "static", boolean.class, MANDATORY); //$NON-NLS-1$ - -//{ObjectTeams: new flag + +//{ObjectTeams: new flag /** * The "base" structural property of this node type (added in JLS3 API). * @since 3.2 */ - public static final SimplePropertyDescriptor BASE_PROPERTY = + public static final SimplePropertyDescriptor BASE_PROPERTY = new SimplePropertyDescriptor(ImportDeclaration.class, "base", boolean.class, MANDATORY); //$NON-NLS-1$ // SH} - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. * @since 3.0 */ private static final List PROPERTY_DESCRIPTORS_2_0; - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. * @since 3.1 */ private static final List PROPERTY_DESCRIPTORS_3_0; - + static { List properyList = new ArrayList(3); createPropertyList(ImportDeclaration.class, properyList); addProperty(NAME_PROPERTY, properyList); addProperty(ON_DEMAND_PROPERTY, properyList); PROPERTY_DESCRIPTORS_2_0 = reapPropertyList(properyList); - + properyList = new ArrayList(4); createPropertyList(ImportDeclaration.class, properyList); addProperty(STATIC_PROPERTY, properyList); @@ -100,11 +100,11 @@ public class ImportDeclaration extends ASTNode { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ @@ -115,7 +115,7 @@ public class ImportDeclaration extends ASTNode { return PROPERTY_DESCRIPTORS_3_0; } } - + /** * The import name; lazily initialized; defaults to a unspecified, * legal Java identifier. @@ -134,7 +134,7 @@ public class ImportDeclaration extends ASTNode { */ private boolean isStatic = false; -//{ObjectTeams: +//{ObjectTeams: /** * Base versus regular; defaults to regular import. * Added in JLS3; not used in JLS2. @@ -147,11 +147,11 @@ public class ImportDeclaration extends ASTNode { * given AST. The import declaration initially is a regular (non-static) * single type import for an unspecified, but legal, Java type name. * <p> - * N.B. This constructor is package-private; all subclasses must be - * declared in the same package; clients are unable to declare + * N.B. This constructor is package-private; all subclasses must be + * declared in the same package; clients are unable to declare * additional subclasses. * </p> - * + * * @param ast the AST that is to own this node */ ImportDeclaration(AST ast) { @@ -164,7 +164,7 @@ public class ImportDeclaration extends ASTNode { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -185,7 +185,7 @@ public class ImportDeclaration extends ASTNode { return false; } } -//{ObjectTeams: +//{ObjectTeams: if (property == BASE_PROPERTY) { if (get) { return isBase(); @@ -198,7 +198,7 @@ public class ImportDeclaration extends ASTNode { // allow default implementation to flag the error return super.internalGetSetBooleanProperty(property, get, value); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -214,7 +214,7 @@ public class ImportDeclaration extends ASTNode { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -259,19 +259,19 @@ public class ImportDeclaration extends ASTNode { } visitor.endVisit(this); } - + /** * Returns the name imported by this declaration. * <p> - * For a regular on-demand import, this is the name of a package. + * For a regular on-demand import, this is the name of a package. * For a static on-demand import, this is the qualified name of * a type. For a regular single-type import, this is the qualified name * of a type. For a static single-type import, this is the qualified name * of a static member of a type. * </p> - * + * * @return the imported name node - */ + */ public Name getName() { if (this.importName == null) { // lazy init must be thread-safe for readers @@ -286,24 +286,24 @@ public class ImportDeclaration extends ASTNode { } return this.importName; } - + /** * Sets the name of this import declaration to the given name. * <p> - * For a regular on-demand import, this is the name of a package. + * For a regular on-demand import, this is the name of a package. * For a static on-demand import, this is the qualified name of * a type. For a regular single-type import, this is the qualified name * of a type. For a static single-type import, this is the qualified name * of a static member of a type. * </p> - * + * * @param name the new import name * @exception IllegalArgumentException if: * <ul> * <li>the node belongs to a different AST</li> * <li>the node already has a parent</li> * </ul> - */ + */ public void setName(Name name) { if (name == null) { throw new IllegalArgumentException(); @@ -313,85 +313,85 @@ public class ImportDeclaration extends ASTNode { this.importName = name; postReplaceChild(oldChild, name, NAME_PROPERTY); } - + /** - * Returns whether this import declaration is an on-demand or a + * Returns whether this import declaration is an on-demand or a * single-type import. - * + * * @return <code>true</code> if this is an on-demand import, * and <code>false</code> if this is a single type import - */ + */ public boolean isOnDemand() { return this.onDemand; } - + /** - * Sets whether this import declaration is an on-demand or a + * Sets whether this import declaration is an on-demand or a * single-type import. - * + * * @param onDemand <code>true</code> if this is an on-demand import, * and <code>false</code> if this is a single type import - */ + */ public void setOnDemand(boolean onDemand) { preValueChange(ON_DEMAND_PROPERTY); this.onDemand = onDemand; postValueChange(ON_DEMAND_PROPERTY); } - + /** * Returns whether this import declaration is a static import (added in JLS3 API). - * + * * @return <code>true</code> if this is a static import, * and <code>false</code> if this is a regular import * @exception UnsupportedOperationException if this operation is used in * a JLS2 AST * @since 3.1 - */ + */ public boolean isStatic() { unsupportedIn2(); return this.isStatic; } - + /** * Sets whether this import declaration is a static import (added in JLS3 API). - * + * * @param isStatic <code>true</code> if this is a static import, * and <code>false</code> if this is a regular import * @exception UnsupportedOperationException if this operation is used in * a JLS2 AST * @since 3.1 - */ + */ public void setStatic(boolean isStatic) { unsupportedIn2(); preValueChange(STATIC_PROPERTY); this.isStatic = isStatic; postValueChange(STATIC_PROPERTY); } - + //{ObjectTeams: new flag: /** * Returns whether this import declaration is a base import (added in JLS3 API). - * + * * @return <code>true</code> if this is a base import, * and <code>false</code> if this is a regular import * @exception UnsupportedOperationException if this operation is used in * a JLS2 AST * @since 3.2 - */ + */ public boolean isBase() { unsupportedIn2(); return isBase; } - + /** * Sets whether this import declaration is a base import (added in JLS3 API). - * + * * @param isBase <code>true</code> if this is a base import, * and <code>false</code> if this is a regular import * @exception UnsupportedOperationException if this operation is used in * a JLS2 AST * @since 3.1 - */ + */ public void setBase(boolean isBase) { unsupportedIn2(); preValueChange(BASE_PROPERTY); @@ -399,7 +399,7 @@ public class ImportDeclaration extends ASTNode { postValueChange(BASE_PROPERTY); } // SH} - + /** * Resolves and returns the binding for the package, type, field, or * method named in this import declaration. @@ -419,21 +419,21 @@ public class ImportDeclaration extends ASTNode { * Note that bindings are generally unavailable unless requested when the * AST is being built. * </p> - * + * * @return a package, type, field, or method binding, or <code>null</code> * if the binding cannot be resolved - */ + */ public IBinding resolveBinding() { return this.ast.getBindingResolver().resolveImport(this); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int memSize() { return BASE_NODE_SIZE + 3 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/InfixExpression.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/InfixExpression.java index 314aef52f..647d2d09b 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/InfixExpression.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/InfixExpression.java @@ -20,9 +20,9 @@ import java.util.Map; * Infix expression AST node type. * <pre> * InfixExpression: - * Expression InfixOperator Expression { InfixOperator Expression } + * Expression InfixOperator Expression { InfixOperator Expression } * </pre> - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ @@ -54,34 +54,34 @@ public class InfixExpression extends Expression { * </pre> */ public static class Operator { - + /** * The token for the operator. */ private String token; - + /** * Creates a new infix operator with the given token. * <p> * Note: this constructor is private. The only instances * ever created are the ones for the standard operators. * </p> - * + * * @param token the character sequence for the operator */ private Operator(String token) { this.token = token; } - + /** * Returns the character sequence for the operator. - * + * * @return the character sequence for the operator */ public String toString() { return this.token; } - + /** Multiplication "*" operator. */ public static final Operator TIMES = new Operator("*");//$NON-NLS-1$ /** Division "/" operator. */ @@ -97,7 +97,7 @@ public class InfixExpression extends Expression { /** Signed right shift ">>" operator. */ public static final Operator RIGHT_SHIFT_SIGNED = new Operator(">>");//$NON-NLS-1$ /** Unsigned right shift ">>>" operator. */ - public static final Operator RIGHT_SHIFT_UNSIGNED = + public static final Operator RIGHT_SHIFT_UNSIGNED = new Operator(">>>");//$NON-NLS-1$ /** Less than "<" operator. */ public static final Operator LESS = new Operator("<");//$NON-NLS-1$ @@ -121,7 +121,7 @@ public class InfixExpression extends Expression { public static final Operator CONDITIONAL_OR = new Operator("||");//$NON-NLS-1$ /** Conditional AND "&&" operator. */ public static final Operator CONDITIONAL_AND = new Operator("&&");//$NON-NLS-1$ - + /** * Map from token to operator (key type: <code>String</code>; * value type: <code>Operator</code>). @@ -160,54 +160,54 @@ public class InfixExpression extends Expression { * or <code>null</code> if none. * <p> * <code>toOperator</code> is the converse of <code>toString</code>: - * that is, <code>Operator.toOperator(op.toString()) == op</code> for + * that is, <code>Operator.toOperator(op.toString()) == op</code> for * all operators <code>op</code>. * </p> - * + * * @param token the character sequence for the operator * @return the infix operator, or <code>null</code> if none */ public static Operator toOperator(String token) { return (Operator) CODES.get(token); } - + } - + /** * The "leftOperand" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor LEFT_OPERAND_PROPERTY = + public static final ChildPropertyDescriptor LEFT_OPERAND_PROPERTY = new ChildPropertyDescriptor(InfixExpression.class, "leftOperand", Expression.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ /** * The "operator" structural property of this node type. * @since 3.0 */ - public static final SimplePropertyDescriptor OPERATOR_PROPERTY = + public static final SimplePropertyDescriptor OPERATOR_PROPERTY = new SimplePropertyDescriptor(InfixExpression.class, "operator", InfixExpression.Operator.class, MANDATORY); //$NON-NLS-1$ - + /** * The "rightOperand" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor RIGHT_OPERAND_PROPERTY = + public static final ChildPropertyDescriptor RIGHT_OPERAND_PROPERTY = new ChildPropertyDescriptor(InfixExpression.class, "rightOperand", Expression.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ /** * The "extendedOperands" structural property of this node type. * @since 3.0 */ - public static final ChildListPropertyDescriptor EXTENDED_OPERANDS_PROPERTY = + public static final ChildListPropertyDescriptor EXTENDED_OPERANDS_PROPERTY = new ChildListPropertyDescriptor(InfixExpression.class, "extendedOperands", Expression.class, CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List properyList = new ArrayList(5); createPropertyList(InfixExpression.class, properyList); @@ -221,18 +221,18 @@ public class InfixExpression extends Expression { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** * The infix operator; defaults to InfixExpression.Operator.PLUS. */ @@ -251,16 +251,16 @@ public class InfixExpression extends Expression { private Expression rightOperand = null; /** - * The list of extended operand expressions (element type: + * The list of extended operand expressions (element type: * <code>Expression</code>). Lazily initialized; defaults to an empty list. */ private ASTNode.NodeList extendedOperands = null; /** - * Creates a new AST node for an infix expression owned by the given + * Creates a new AST node for an infix expression owned by the given * AST. By default, the node has unspecified (but legal) operator, * left and right operands, and an empty list of additional operands. - * + * * @param ast the AST that is to own this node */ InfixExpression(AST ast) { @@ -273,7 +273,7 @@ public class InfixExpression extends Expression { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -313,7 +313,7 @@ public class InfixExpression extends Expression { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -373,22 +373,22 @@ public class InfixExpression extends Expression { } visitor.endVisit(this); } - + /** * Returns the operator of this infix expression. - * + * * @return the infix operator - */ + */ public InfixExpression.Operator getOperator() { return this.operator; } /** * Sets the operator of this infix expression. - * + * * @param operator the infix operator * @exception IllegalArgumentException if the argument is incorrect - */ + */ public void setOperator(InfixExpression.Operator operator) { if (operator == null) { throw new IllegalArgumentException(); @@ -400,9 +400,9 @@ public class InfixExpression extends Expression { /** * Returns the left operand of this infix expression. - * + * * @return the left operand node - */ + */ public Expression getLeftOperand() { if (this.leftOperand == null) { // lazy init must be thread-safe for readers @@ -416,10 +416,10 @@ public class InfixExpression extends Expression { } return this.leftOperand; } - + /** * Sets the left operand of this infix expression. - * + * * @param expression the left operand node * @exception IllegalArgumentException if: * <ul> @@ -427,7 +427,7 @@ public class InfixExpression extends Expression { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setLeftOperand(Expression expression) { if (expression == null) { throw new IllegalArgumentException(); @@ -440,9 +440,9 @@ public class InfixExpression extends Expression { /** * Returns the right operand of this infix expression. - * + * * @return the right operand node - */ + */ public Expression getRightOperand() { if (this.rightOperand == null) { // lazy init must be thread-safe for readers @@ -456,10 +456,10 @@ public class InfixExpression extends Expression { } return this.rightOperand; } - + /** * Sets the right operand of this infix expression. - * + * * @param expression the right operand node * @exception IllegalArgumentException if: * <ul> @@ -467,7 +467,7 @@ public class InfixExpression extends Expression { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setRightOperand(Expression expression) { if (expression == null) { throw new IllegalArgumentException(); @@ -477,24 +477,24 @@ public class InfixExpression extends Expression { this.rightOperand = expression; postReplaceChild(oldChild, expression, RIGHT_OPERAND_PROPERTY); } - + /** * Returns where there are any extended operands. - * + * * @return <code>true</code> if there are one or more extended operands, * and <code>false</code> if there are no extended operands */ public boolean hasExtendedOperands() { - return + return (this.extendedOperands != null) && this.extendedOperands.size() > 0; } - + /** * Returns the live list of extended operands. * <p> * The extended operands is the preferred way of representing deeply nested * expressions of the form <code>L op R op R2 op R3...</code> where - * the same operator appears between all the operands (the most + * the same operator appears between all the operands (the most * common case being lengthy string concatenation expressions). Using * the extended operands keeps the trees from getting too deep; this * decreases the risk is running out of thread stack space at runtime @@ -505,7 +505,7 @@ public class InfixExpression extends Expression { * extendedOperands: {c, d} * operator: + * </p> - * + * * @return the live list of extended operands * (element type: <code>Expression</code>) */ @@ -524,12 +524,12 @@ public class InfixExpression extends Expression { // treat Operator as free return BASE_NODE_SIZE + 4 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int treeSize() { - return + return memSize() + (this.leftOperand == null ? 0 : getLeftOperand().treeSize()) + (this.rightOperand == null ? 0 : getRightOperand().treeSize()) diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Initializer.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Initializer.java index b0d5382ed..405628003 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Initializer.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Initializer.java @@ -20,56 +20,56 @@ import java.util.List; * Initializer: * [ <b>static</b> ] Block * </pre> - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ public class Initializer extends BodyDeclaration { - + /** * The "javadoc" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor JAVADOC_PROPERTY = + public static final ChildPropertyDescriptor JAVADOC_PROPERTY = internalJavadocPropertyFactory(Initializer.class); /** * The "modifiers" structural property of this node type (JLS2 API only). * @since 3.0 */ - public static final SimplePropertyDescriptor MODIFIERS_PROPERTY = + public static final SimplePropertyDescriptor MODIFIERS_PROPERTY = internalModifiersPropertyFactory(Initializer.class); - + /** * The "modifiers" structural property of this node type (added in JLS3 API). * @since 3.1 */ - public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = + public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = internalModifiers2PropertyFactory(Initializer.class); - + /** * The "body" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor BODY_PROPERTY = + public static final ChildPropertyDescriptor BODY_PROPERTY = new ChildPropertyDescriptor(Initializer.class, "body", Block.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. * @since 3.0 */ private static final List PROPERTY_DESCRIPTORS_2_0; - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. * @since 3.1 */ private static final List PROPERTY_DESCRIPTORS_3_0; - + static { List properyList = new ArrayList(4); createPropertyList(Initializer.class, properyList); @@ -77,7 +77,7 @@ public class Initializer extends BodyDeclaration { addProperty(MODIFIERS_PROPERTY, properyList); addProperty(BODY_PROPERTY, properyList); PROPERTY_DESCRIPTORS_2_0 = reapPropertyList(properyList); - + properyList = new ArrayList(4); createPropertyList(Initializer.class, properyList); addProperty(JAVADOC_PROPERTY, properyList); @@ -89,11 +89,11 @@ public class Initializer extends BodyDeclaration { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ @@ -104,20 +104,20 @@ public class Initializer extends BodyDeclaration { return PROPERTY_DESCRIPTORS_3_0; } } - + /** * The initializer body; lazily initialized; defaults to an empty block. */ private Block body = null; /** - * Creates a new AST node for an initializer declaration owned by the given + * Creates a new AST node for an initializer declaration owned by the given * AST. By default, the initializer has no modifiers and an empty block. * The javadoc comment is not used for initializers. * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ Initializer(AST ast) { @@ -131,7 +131,7 @@ public class Initializer extends BodyDeclaration { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -171,7 +171,7 @@ public class Initializer extends BodyDeclaration { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -182,7 +182,7 @@ public class Initializer extends BodyDeclaration { // allow default implementation to flag the error return super.internalGetChildListProperty(property); } - + /* (omit javadoc for this method) * Method declared on BodyDeclaration. */ @@ -251,12 +251,12 @@ public class Initializer extends BodyDeclaration { } visitor.endVisit(this); } - + /** * Returns the body of this initializer declaration. - * + * * @return the initializer body - */ + */ public Block getBody() { if (this.body == null) { // lazy init must be thread-safe for readers @@ -270,10 +270,10 @@ public class Initializer extends BodyDeclaration { } return this.body; } - + /** * Sets the body of this initializer declaration. - * + * * @param body the block node * @exception IllegalArgumentException if: * <ul> @@ -281,7 +281,7 @@ public class Initializer extends BodyDeclaration { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setBody(Block body) { if (body == null) { throw new IllegalArgumentException(); @@ -291,14 +291,14 @@ public class Initializer extends BodyDeclaration { this.body = body; postReplaceChild(oldChild, body, BODY_PROPERTY); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int memSize() { return super.memSize() + 1 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/InstanceofExpression.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/InstanceofExpression.java index 9c8396060..0f083532b 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/InstanceofExpression.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/InstanceofExpression.java @@ -20,7 +20,7 @@ import java.util.List; * InstanceofExpression: * Expression <b>instanceof</b> Type * </pre> - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ @@ -30,23 +30,23 @@ public class InstanceofExpression extends Expression { * The "leftOperand" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor LEFT_OPERAND_PROPERTY = + public static final ChildPropertyDescriptor LEFT_OPERAND_PROPERTY = new ChildPropertyDescriptor(InstanceofExpression.class, "leftOperand", Expression.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ /** * The "rightOperand" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor RIGHT_OPERAND_PROPERTY = + public static final ChildPropertyDescriptor RIGHT_OPERAND_PROPERTY = new ChildPropertyDescriptor(InstanceofExpression.class, "rightOperand", Type.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List properyList = new ArrayList(3); createPropertyList(InstanceofExpression.class, properyList); @@ -58,18 +58,18 @@ public class InstanceofExpression extends Expression { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** * The left operand; lazily initialized; defaults to an unspecified, * but legal, simple name. @@ -83,10 +83,10 @@ public class InstanceofExpression extends Expression { private Type rightOperand = null; /** - * Creates a new AST node for an instanceof expression owned by the given + * Creates a new AST node for an instanceof expression owned by the given * AST. By default, the node has unspecified (but legal) operator, * left and right operands. - * + * * @param ast the AST that is to own this node */ InstanceofExpression(AST ast) { @@ -99,7 +99,7 @@ public class InstanceofExpression extends Expression { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -123,7 +123,7 @@ public class InstanceofExpression extends Expression { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -162,12 +162,12 @@ public class InstanceofExpression extends Expression { } visitor.endVisit(this); } - + /** * Returns the left operand of this instanceof expression. - * + * * @return the left operand node - */ + */ public Expression getLeftOperand() { if (this.leftOperand == null) { // lazy init must be thread-safe for readers @@ -181,10 +181,10 @@ public class InstanceofExpression extends Expression { } return this.leftOperand; } - + /** * Sets the left operand of this instanceof expression. - * + * * @param expression the left operand node * @exception IllegalArgumentException if: * <ul> @@ -192,7 +192,7 @@ public class InstanceofExpression extends Expression { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setLeftOperand(Expression expression) { if (expression == null) { throw new IllegalArgumentException(); @@ -205,9 +205,9 @@ public class InstanceofExpression extends Expression { /** * Returns the right operand of this instanceof expression. - * + * * @return the right operand node - */ + */ public Type getRightOperand() { if (this.rightOperand == null) { // lazy init must be thread-safe for readers @@ -221,10 +221,10 @@ public class InstanceofExpression extends Expression { } return this.rightOperand; } - + /** * Sets the right operand of this instanceof expression. - * + * * @param referenceType the right operand node * @exception IllegalArgumentException if: * <ul> @@ -232,7 +232,7 @@ public class InstanceofExpression extends Expression { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setRightOperand(Type referenceType) { if (referenceType == null) { throw new IllegalArgumentException(); @@ -242,7 +242,7 @@ public class InstanceofExpression extends Expression { this.rightOperand = referenceType; postReplaceChild(oldChild, referenceType, RIGHT_OPERAND_PROPERTY); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -250,12 +250,12 @@ public class InstanceofExpression extends Expression { // treat Operator as free return BASE_NODE_SIZE + 2 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int treeSize() { - return + return memSize() + (this.leftOperand == null ? 0 : getLeftOperand().treeSize()) + (this.rightOperand == null ? 0 : getRightOperand().treeSize()); diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Javadoc.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Javadoc.java index 952039b0b..b5eefc3dc 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Javadoc.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Javadoc.java @@ -24,51 +24,51 @@ import org.eclipse.jdt.internal.compiler.parser.TerminalTokens; * Javadoc: * <b>/** </b> { TagElement } <b>*</b><b>/</b> * </pre> - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ public class Javadoc extends Comment { - + /** * The "comment" structural property of this node type (JLS2 API only). * @since 3.0 * @deprecated Replaced by {@link #TAGS_PROPERTY} in the JLS3 API. */ - public static final SimplePropertyDescriptor COMMENT_PROPERTY = + public static final SimplePropertyDescriptor COMMENT_PROPERTY = new SimplePropertyDescriptor(Javadoc.class, "comment", String.class, MANDATORY); //$NON-NLS-1$ - + /** * The "tags" structural property of this node type. * @since 3.1 */ - public static final ChildListPropertyDescriptor TAGS_PROPERTY = + public static final ChildListPropertyDescriptor TAGS_PROPERTY = new ChildListPropertyDescriptor(Javadoc.class, "tags", TagElement.class, CYCLE_RISK); //$NON-NLS-1$ - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. * @since 3.0 */ private static final List PROPERTY_DESCRIPTORS_2_0; - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. * @since 3.1 */ private static final List PROPERTY_DESCRIPTORS_3_0; - + static { List properyList = new ArrayList(3); createPropertyList(Javadoc.class, properyList); addProperty(COMMENT_PROPERTY, properyList); addProperty(TAGS_PROPERTY, properyList); PROPERTY_DESCRIPTORS_2_0 = reapPropertyList(properyList); - + properyList = new ArrayList(2); createPropertyList(Javadoc.class, properyList); addProperty(TAGS_PROPERTY, properyList); @@ -78,10 +78,10 @@ public class Javadoc extends Comment { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ @@ -92,7 +92,7 @@ public class Javadoc extends Comment { return PROPERTY_DESCRIPTORS_3_0; } } - + /** * Canonical minimal doc comment. * @since 3.0 @@ -100,20 +100,20 @@ public class Javadoc extends Comment { private static final String MINIMAL_DOC_COMMENT = "/** */";//$NON-NLS-1$ /** - * The doc comment string, including opening and closing comment + * The doc comment string, including opening and closing comment * delimiters; defaults to a minimal Javadoc comment. * @deprecated The comment string was replaced in the 3.0 release * by a representation of the structure of the doc comment. * For backwards compatibility, it is still funcational as before. */ private String comment = MINIMAL_DOC_COMMENT; - + /** - * The list of tag elements (element type: <code>TagElement</code>). + * The list of tag elements (element type: <code>TagElement</code>). * Defaults to an empty list. * @since 3.0 */ - private ASTNode.NodeList tags = + private ASTNode.NodeList tags = new ASTNode.NodeList(TAGS_PROPERTY); /** @@ -121,24 +121,24 @@ public class Javadoc extends Comment { * The new node has an empty list of tag elements (and, for backwards * compatability, an unspecified, but legal, doc comment string). * <p> - * N.B. This constructor is package-private; all subclasses must be - * declared in the same package; clients are unable to declare + * N.B. This constructor is package-private; all subclasses must be + * declared in the same package; clients are unable to declare * additional subclasses. * </p> - * + * * @param ast the AST that is to own this node */ Javadoc(AST ast) { super(ast); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -165,7 +165,7 @@ public class Javadoc extends Comment { // allow default implementation to flag the error return super.internalGetChildListProperty(property); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -185,7 +185,7 @@ public class Javadoc extends Comment { result.tags().addAll(ASTNode.copySubtrees(target, tags())); return result; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -209,7 +209,7 @@ public class Javadoc extends Comment { /** * Returns the doc comment string, including the starting * and ending comment delimiters, and any embedded line breaks. - * + * * @return the doc comment string * @exception UnsupportedOperationException if this operation is used in * an AST later than JLS2 @@ -226,7 +226,7 @@ public class Javadoc extends Comment { * Sets or clears the doc comment string. The documentation * string must include the starting and ending comment delimiters, * and any embedded line breaks. - * + * * @param docComment the doc comment string * @exception IllegalArgumentException if the Java comment string is invalid * @exception UnsupportedOperationException if this operation is used in @@ -269,13 +269,13 @@ public class Javadoc extends Comment { this.comment = docComment; postValueChange(COMMENT_PROPERTY); } - + /** - * Returns the live list of tag elements that make up this doc + * Returns the live list of tag elements that make up this doc * comment. * <p> * The tag elements cover everything except the starting and ending - * comment delimiters, and generally omit leading whitespace + * comment delimiters, and generally omit leading whitespace * (including a leading "*") and embedded line breaks. * The first tag element of a typical doc comment represents * all the material before the first explicit doc tag; this @@ -290,15 +290,15 @@ public class Javadoc extends Comment { * Adding and removing nodes from this list affects this node * dynamically. * </p> - * + * * @return the live list of tag elements in this doc comment * (element type: <code>TagElement</code>) * @since 3.0 - */ + */ public List tags() { return this.tags; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -310,7 +310,7 @@ public class Javadoc extends Comment { } return size; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/LabeledStatement.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/LabeledStatement.java index b1e9c4c02..632d1ea05 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/LabeledStatement.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/LabeledStatement.java @@ -21,33 +21,33 @@ import java.util.List; * LabeledStatement: * Identifier <b>:</b> Statement * </pre> - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ public class LabeledStatement extends Statement { - + /** * The "label" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor LABEL_PROPERTY = + public static final ChildPropertyDescriptor LABEL_PROPERTY = new ChildPropertyDescriptor(LabeledStatement.class, "label", SimpleName.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ /** * The "body" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor BODY_PROPERTY = + public static final ChildPropertyDescriptor BODY_PROPERTY = new ChildPropertyDescriptor(LabeledStatement.class, "body", Statement.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List propertyList = new ArrayList(3); createPropertyList(LabeledStatement.class, propertyList); @@ -59,18 +59,18 @@ public class LabeledStatement extends Statement { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** * The label; lazily initialized; defaults to a unspecified, * legal Java identifier. @@ -78,19 +78,19 @@ public class LabeledStatement extends Statement { private SimpleName labelName = null; /** - * The body statement; lazily initialized; defaults to an unspecified, but + * The body statement; lazily initialized; defaults to an unspecified, but * legal, statement. */ private Statement body = null; /** - * Creates a new AST node for a labeled statement owned by the given + * Creates a new AST node for a labeled statement owned by the given * AST. By default, the statement has an unspecified (but legal) label * and an unspecified (but legal) statement. * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ LabeledStatement(AST ast) { @@ -103,7 +103,7 @@ public class LabeledStatement extends Statement { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -127,7 +127,7 @@ public class LabeledStatement extends Statement { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -168,12 +168,12 @@ public class LabeledStatement extends Statement { } visitor.endVisit(this); } - + /** * Returns the label of this labeled statement. - * + * * @return the variable name node - */ + */ public SimpleName getLabel() { if (this.labelName == null) { // lazy init must be thread-safe for readers @@ -187,17 +187,17 @@ public class LabeledStatement extends Statement { } return this.labelName; } - + /** * Sets the label of this labeled statement. - * + * * @param label the new label * @exception IllegalArgumentException if: * <ul> * <li>the node belongs to a different AST</li> * <li>the node already has a parent</li> * </ul> - */ + */ public void setLabel(SimpleName label) { if (label == null) { throw new IllegalArgumentException(); @@ -207,12 +207,12 @@ public class LabeledStatement extends Statement { this.labelName = label; postReplaceChild(oldChild, label, LABEL_PROPERTY); } - + /** * Returns the body of this labeled statement. - * + * * @return the body statement node - */ + */ public Statement getBody() { if (this.body == null) { // lazy init must be thread-safe for readers @@ -226,7 +226,7 @@ public class LabeledStatement extends Statement { } return this.body; } - + /** * Sets the body of this labeled statement. * <p> @@ -237,7 +237,7 @@ public class LabeledStatement extends Statement { * compile, be sure to embed the <code>VariableDeclarationStatement</code> * inside a <code>Block</code>. * </p> - * + * * @param statement the body statement node * @exception IllegalArgumentException if: * <ul> @@ -245,7 +245,7 @@ public class LabeledStatement extends Statement { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setBody(Statement statement) { if (statement == null) { throw new IllegalArgumentException(); @@ -255,14 +255,14 @@ public class LabeledStatement extends Statement { this.body = statement; postReplaceChild(oldChild, statement, BODY_PROPERTY); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int memSize() { return super.memSize() + 2 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/LiftingType.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/LiftingType.java index 4a432c4a1..2712697ab 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/LiftingType.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/LiftingType.java @@ -1,19 +1,19 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute for Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * $Id: LiftingType.java 23416 2010-02-03 19:59:31Z stephan $ - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation @@ -26,52 +26,52 @@ import java.util.List; /** * NEW for OTDT - * + * * Represents DOM-ASTNode for declared lifting (OTJLD §2.3.2) * which has to handle code like: - * (MyClass as MyRole role) - * + * (MyClass as MyRole role) + * * This class has following properties: * Name * baseType * roleType - * + * * This node represents a Type. - * - * This node inherits from Type and is handled like other types. - * - typically used in team level methods (declared lifting) + * + * This node inherits from Type and is handled like other types. + * - typically used in team level methods (declared lifting) * * @author jsv */ public class LiftingType extends Type { - + /** * The "BaseType" structural property of this node type. */ - public static final ChildPropertyDescriptor BASE_TYPE_PROPERTY = + public static final ChildPropertyDescriptor BASE_TYPE_PROPERTY = new ChildPropertyDescriptor(LiftingType.class, "baseType", Type.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ - + /** * The "roleType" structural property of this node type. */ - public static final ChildPropertyDescriptor ROLE_TYPE_PROPERTY = + public static final ChildPropertyDescriptor ROLE_TYPE_PROPERTY = new ChildPropertyDescriptor(LiftingType.class, "roleType", Type.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ - + /** * The "name" structural property of this node type. */ - public static final ChildPropertyDescriptor NAME_PROPERTY = + public static final ChildPropertyDescriptor NAME_PROPERTY = new ChildPropertyDescriptor(LiftingType.class, "name", Name.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List propertyList = new ArrayList(4); @@ -85,44 +85,44 @@ public class LiftingType extends Type /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - - /** + + /** * The type name node; lazily initialized; defaults to a type with * an unspecified, but legal, name. */ private Name typeName = null; - + /** * The base type. * JLS2 behevior: lazily initialized; defaults to void. * Note that this field is ignored for constructor declarations. */ private Type _baseType = null; - + /** * The role type. * JLS2 behevior: lazily initialized; defaults to void. * Note that this field is ignored for constructor declarations. */ private Type _roleType = null; - + /** * Creates a new unparented node for a lifting type owned by the given AST. * By default, an unspecified, but legal, name. * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ LiftingType(AST ast) @@ -134,7 +134,7 @@ public class LiftingType extends Type { return propertyDescriptors(apiLevel); } - + final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) { if (property == NAME_PROPERTY) @@ -149,7 +149,7 @@ public class LiftingType extends Type return null; } } - + if (property == BASE_TYPE_PROPERTY) { if (get) @@ -162,7 +162,7 @@ public class LiftingType extends Type return null; } } - + if (property == ROLE_TYPE_PROPERTY) { if (get) @@ -178,7 +178,7 @@ public class LiftingType extends Type // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + final int getNodeType0() { return LIFTING_TYPE; @@ -191,7 +191,7 @@ public class LiftingType extends Type result.setName((Name) (getName()).clone(target)); result.setBaseType((Type) ASTNode.copySubtree(target, getBaseType())); result.setRoleType((Type) ASTNode.copySubtree(target, getRoleType())); - + return result; } @@ -212,12 +212,12 @@ public class LiftingType extends Type } visitor.endVisit(this); } - + /** * Returns the name of this lifting type. - * + * * @return the name of this lifting type - */ + */ public Name getName() { if (this.typeName == null) { @@ -232,17 +232,17 @@ public class LiftingType extends Type } return this.typeName; } - + /** * Sets the name of this lifting type to the given name. - * + * * @param typeName the new name of this lifting type * @exception IllegalArgumentException if: * <ul> * <li>the node belongs to a different AST</li> * <li>the node already has a parent</li> * </ul> - */ + */ public void setName(Name typeName) { if (typeName == null) @@ -275,7 +275,7 @@ public class LiftingType extends Type } return this._baseType; } - + /** * Returns the role type in this LiftingType, */ @@ -296,7 +296,7 @@ public class LiftingType extends Type } return this._roleType; } - + /** * Sets the base type of in this LiftingType */ @@ -311,7 +311,7 @@ public class LiftingType extends Type this._baseType = type; postReplaceChild(oldChild, type, BASE_TYPE_PROPERTY); } - + /** * Sets the role type of in this LiftingType */ @@ -320,22 +320,22 @@ public class LiftingType extends Type if (type == null) { throw new IllegalArgumentException(); - } + } ASTNode oldChild = this._roleType; preReplaceChild(oldChild, type, ROLE_TYPE_PROPERTY); this._roleType = type; postReplaceChild(oldChild, type, ROLE_TYPE_PROPERTY); } - + int memSize() { // treat Code as free return BASE_NODE_SIZE + 3 * 4; } - + int treeSize() { - return memSize() + return memSize() + (this.typeName == null ? 0 : getName().treeSize()) + (this.getBaseType() == null ? 0 : getBaseType().treeSize()) + (this.getRoleType() == null ? 0 : getRoleType().treeSize()); diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/LineComment.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/LineComment.java index d1f73ef69..2ed2bc0b1 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/LineComment.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/LineComment.java @@ -26,19 +26,19 @@ import java.util.List; * was found in a source string. It is not useful for creating * comments. * </p> - * + * * @since 3.0 * @noinstantiate This class is not intended to be instantiated by clients. */ public final class LineComment extends Comment { - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List propertyList = new ArrayList(1); createPropertyList(LineComment.class, propertyList); @@ -48,24 +48,24 @@ public final class LineComment extends Comment { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** * Creates a new line comment node owned by the given AST. * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ LineComment(AST ast) { @@ -78,7 +78,7 @@ public final class LineComment extends Comment { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -110,14 +110,14 @@ public final class LineComment extends Comment { visitor.visit(this); visitor.endVisit(this); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int memSize() { return super.memSize(); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MarkerAnnotation.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MarkerAnnotation.java index 46e303fd6..ab31286ca 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MarkerAnnotation.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MarkerAnnotation.java @@ -14,7 +14,7 @@ import java.util.ArrayList; import java.util.List; /** - * Marker annotation node (added in JLS3 API). The marker annotation + * Marker annotation node (added in JLS3 API). The marker annotation * "@foo" is equivalent to the normal annotation "@foo()". * <p> * <pre> @@ -22,7 +22,7 @@ import java.util.List; * <b>@</b> TypeName * </pre> * </p> - * + * * @since 3.1 * @noinstantiate This class is not intended to be instantiated by clients. */ @@ -31,43 +31,43 @@ public final class MarkerAnnotation extends Annotation { /** * The "typeName" structural property of this node type. */ - public static final ChildPropertyDescriptor TYPE_NAME_PROPERTY = + public static final ChildPropertyDescriptor TYPE_NAME_PROPERTY = internalTypeNamePropertyFactory(MarkerAnnotation.class); /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List propertyList = new ArrayList(2); createPropertyList(MarkerAnnotation.class, propertyList); addProperty(TYPE_NAME_PROPERTY, propertyList); PROPERTY_DESCRIPTORS = reapPropertyList(propertyList); } - + /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the AST.JLS* constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** - * Creates a new unparented marker annotation node owned + * Creates a new unparented marker annotation node owned * by the given AST. By default, the annotation has an * unspecified type name . * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ MarkerAnnotation(AST ast) { @@ -81,7 +81,7 @@ public final class MarkerAnnotation extends Annotation { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -97,7 +97,7 @@ public final class MarkerAnnotation extends Annotation { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on BodyDeclaration. */ @@ -121,7 +121,7 @@ public final class MarkerAnnotation extends Annotation { result.setTypeName((Name) ASTNode.copySubtree(target, getTypeName())); return result; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -129,7 +129,7 @@ public final class MarkerAnnotation extends Annotation { // dispatch to correct overloaded match method return matcher.match(this, other); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -141,14 +141,14 @@ public final class MarkerAnnotation extends Annotation { } visitor.endVisit(this); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int memSize() { return super.memSize(); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MemberRef.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MemberRef.java index da4d55b19..da408a15e 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MemberRef.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MemberRef.java @@ -23,34 +23,34 @@ import java.util.List; * MemberRef: * [ Name ] <b>#</b> Identifier * </pre> - * + * * @see Javadoc * @since 3.0 * @noinstantiate This class is not intended to be instantiated by clients. */ public class MemberRef extends ASTNode implements IDocElement { - + /** * The "qualifier" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor QUALIFIER_PROPERTY = + public static final ChildPropertyDescriptor QUALIFIER_PROPERTY = new ChildPropertyDescriptor(MemberRef.class, "qualifier", Name.class, OPTIONAL, NO_CYCLE_RISK); //$NON-NLS-1$ /** * The "name" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor NAME_PROPERTY = + public static final ChildPropertyDescriptor NAME_PROPERTY = new ChildPropertyDescriptor(MemberRef.class, "name", SimpleName.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List propertyList = new ArrayList(3); createPropertyList(MemberRef.class, propertyList); @@ -62,16 +62,16 @@ public class MemberRef extends ASTNode implements IDocElement { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the AST.JLS* constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** * The optional qualifier; <code>null</code> for none; defaults to none. */ @@ -82,17 +82,17 @@ public class MemberRef extends ASTNode implements IDocElement { * legal Java method name. */ private SimpleName memberName = null; - + /** - * Creates a new AST node for a member reference owned by the given + * Creates a new AST node for a member reference owned by the given * AST. By default, the method reference is for a member with an * unspecified, but legal, name; and no qualifier. * <p> - * N.B. This constructor is package-private; all subclasses must be - * declared in the same package; clients are unable to declare + * N.B. This constructor is package-private; all subclasses must be + * declared in the same package; clients are unable to declare * additional subclasses. * </p> - * + * * @param ast the AST that is to own this node */ MemberRef(AST ast) { @@ -105,7 +105,7 @@ public class MemberRef extends ASTNode implements IDocElement { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -129,7 +129,7 @@ public class MemberRef extends ASTNode implements IDocElement { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -155,7 +155,7 @@ public class MemberRef extends ASTNode implements IDocElement { // dispatch to correct overloaded match method return matcher.match(this, other); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -168,28 +168,28 @@ public class MemberRef extends ASTNode implements IDocElement { } visitor.endVisit(this); } - + /** - * Returns the qualifier of this member reference, or + * Returns the qualifier of this member reference, or * <code>null</code> if there is none. - * + * * @return the qualifier name node, or <code>null</code> if there is none - */ + */ public Name getQualifier() { return this.optionalQualifier; } - + /** * Sets or clears the qualifier of this member reference. - * - * @param name the qualifier name node, or <code>null</code> if + * + * @param name the qualifier name node, or <code>null</code> if * there is none * @exception IllegalArgumentException if: * <ul> * <li>the node belongs to a different AST</li> * <li>the node already has a parent</li> * </ul> - */ + */ public void setQualifier(Name name) { ASTNode oldChild = this.optionalQualifier; preReplaceChild(oldChild, name, QUALIFIER_PROPERTY); @@ -199,9 +199,9 @@ public class MemberRef extends ASTNode implements IDocElement { /** * Returns the name of the referenced member. - * + * * @return the member name node - */ + */ public SimpleName getName() { if (this.memberName == null) { // lazy init must be thread-safe for readers @@ -215,10 +215,10 @@ public class MemberRef extends ASTNode implements IDocElement { } return this.memberName; } - + /** * Sets the name of the referenced member to the given name. - * + * * @param name the new member name node * @exception IllegalArgumentException if: * <ul> @@ -226,7 +226,7 @@ public class MemberRef extends ASTNode implements IDocElement { * <li>the node belongs to a different AST</li> * <li>the node already has a parent</li> * </ul> - */ + */ public void setName(SimpleName name) { if (name == null) { throw new IllegalArgumentException(); @@ -244,10 +244,10 @@ public class MemberRef extends ASTNode implements IDocElement { * Note that bindings are generally unavailable unless requested when the * AST is being built. * </p> - * - * @return the binding, or <code>null</code> if the binding cannot be + * + * @return the binding, or <code>null</code> if the binding cannot be * resolved - */ + */ public final IBinding resolveBinding() { return this.ast.getBindingResolver().resolveReference(this); } @@ -258,7 +258,7 @@ public class MemberRef extends ASTNode implements IDocElement { int memSize() { return BASE_NODE_SIZE + 2 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MemberValuePair.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MemberValuePair.java index fcf231904..6bf20e16d 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MemberValuePair.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MemberValuePair.java @@ -30,26 +30,26 @@ import java.util.List; * @noinstantiate This class is not intended to be instantiated by clients. */ public class MemberValuePair extends ASTNode { - + /** * The "name" structural property of this node type. */ - public static final ChildPropertyDescriptor NAME_PROPERTY = + public static final ChildPropertyDescriptor NAME_PROPERTY = new ChildPropertyDescriptor(MemberValuePair.class, "name", SimpleName.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ /** * The "value" structural property of this node type. */ - public static final ChildPropertyDescriptor VALUE_PROPERTY = + public static final ChildPropertyDescriptor VALUE_PROPERTY = new ChildPropertyDescriptor(MemberValuePair.class, "value", Expression.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List propertyList = new ArrayList(3); createPropertyList(MemberValuePair.class, propertyList); @@ -61,15 +61,15 @@ public class MemberValuePair extends ASTNode { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the AST.JLS* constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** * The member name; lazily initialized; defaults to a unspecified, * legal name. @@ -81,15 +81,15 @@ public class MemberValuePair extends ASTNode { * legal expression. */ private Expression value = null; - + /** - * Creates a new AST node for a member value pair owned by the given + * Creates a new AST node for a member value pair owned by the given * AST. By default, the node has an unspecified (but legal) member * name and value. * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ MemberValuePair(AST ast) { @@ -103,7 +103,7 @@ public class MemberValuePair extends ASTNode { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -127,7 +127,7 @@ public class MemberValuePair extends ASTNode { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -153,7 +153,7 @@ public class MemberValuePair extends ASTNode { // dispatch to correct overloaded match method return matcher.match(this, other); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -166,12 +166,12 @@ public class MemberValuePair extends ASTNode { } visitor.endVisit(this); } - + /** * Returns the member name. - * + * * @return the member name node - */ + */ public SimpleName getName() { if (this.name == null) { // lazy init must be thread-safe for readers @@ -185,32 +185,32 @@ public class MemberValuePair extends ASTNode { } return this.name; } - + /** * Resolves and returns the member value pair binding for this member value pair. * <p> * Note that bindings are generally unavailable unless requested when the * AST is being built. * </p> - * - * @return the binding, or <code>null</code> if the binding cannot be + * + * @return the binding, or <code>null</code> if the binding cannot be * resolved * @since 3.2 - */ + */ public final IMemberValuePairBinding resolveMemberValuePairBinding() { return this.ast.getBindingResolver().resolveMemberValuePair(this); } /** * Sets the member name. - * + * * @param name the member name node * @exception IllegalArgumentException if: * <ul> * <li>the node belongs to a different AST</li> * <li>the node already has a parent</li> * </ul> - */ + */ public void setName(SimpleName name) { if (name == null) { throw new IllegalArgumentException(); @@ -223,9 +223,9 @@ public class MemberValuePair extends ASTNode { /** * Returns the value expression. - * + * * @return the value expression - */ + */ public Expression getValue() { if (this.value == null) { // lazy init must be thread-safe for readers @@ -242,7 +242,7 @@ public class MemberValuePair extends ASTNode { /** * Sets the value of this pair. - * + * * @param value the new value * @exception IllegalArgumentException if: * <ul> @@ -250,7 +250,7 @@ public class MemberValuePair extends ASTNode { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setValue(Expression value) { if (value == null) { throw new IllegalArgumentException(); @@ -267,12 +267,12 @@ public class MemberValuePair extends ASTNode { int memSize() { return BASE_NODE_SIZE + 2 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int treeSize() { - return + return memSize() + (this.name == null ? 0 : getName().treeSize()) + (this.value == null ? 0 : getValue().treeSize()); diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Message.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Message.java index 998cb8e11..cf231c82a 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Message.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Message.java @@ -18,32 +18,32 @@ package org.eclipse.jdt.core.dom; * @since 2.0 */ public class Message { - + /** * The message. */ private String message; - + /** * The character index into the original source string, or -1 if none. */ private int startPosition; - + /** * The length in characters of the original source file indicating * where the source fragment corresponding to this message ends. */ private int length; - + /** * Creates a message. - * + * * @param message the localized message reported by the compiler - * @param startPosition the 0-based character index into the + * @param startPosition the 0-based character index into the * original source file, or <code>-1</code> if no source position * information is to be recorded for this message * @throws IllegalArgumentException if the message is null - * @throws IllegalArgumentException if the startPosition is lower than -1. + * @throws IllegalArgumentException if the startPosition is lower than -1. */ public Message(String message, int startPosition) { if (message == null) { @@ -59,16 +59,16 @@ public class Message { /** * Creates a message. - * + * * @param message the localized message reported by the compiler - * @param startPosition the 0-based character index into the + * @param startPosition the 0-based character index into the * original source file, or <code>-1</code> if no source position * information is to be recorded for this message * @param length the length in character of the original source file indicating - * where the source fragment corresponding to this message ends. 0 or a negative number + * where the source fragment corresponding to this message ends. 0 or a negative number * if none. A negative number will be converted to a 0-length. * @throws IllegalArgumentException if the message is null - * @throws IllegalArgumentException if the startPosition is lower than -1. + * @throws IllegalArgumentException if the startPosition is lower than -1. */ public Message(String message, int startPosition, int length) { if (message == null) { @@ -85,19 +85,19 @@ public class Message { this.length = length; } } - + /** * Returns the localized message. - * + * * @return the localized message */ public String getMessage() { return this.message; } - + /** * Returns the character index into the original source file. - * + * * @return the 0-based character index, or <code>-1</code> * if no source position information is recorded for this * message @@ -110,7 +110,7 @@ public class Message { /** * Returns the character index into the original source file. - * + * * @return the 0-based character index, or <code>-1</code> * if no source position information is recorded for this * message @@ -119,11 +119,11 @@ public class Message { public int getStartPosition() { return this.startPosition; } - + /** * Returns the length in characters of the original source file indicating * where the source fragment corresponding to this message ends. - * + * * @return a length, or <code>0</code> * if no source length information is recorded for this message * @see #getStartPosition() diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodBinding.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodBinding.java index 9b56179cc..d01368f30 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodBinding.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodBinding.java @@ -37,7 +37,7 @@ class MethodBinding implements IMethodBinding { private static final int VALID_MODIFIERS = Modifier.PUBLIC | Modifier.PROTECTED | Modifier.PRIVATE | //{ObjectTeams: callin: Modifier.OT_CALLIN | -// SH} +// SH} Modifier.ABSTRACT | Modifier.STATIC | Modifier.FINAL | Modifier.SYNCHRONIZED | Modifier.NATIVE | Modifier.STRICTFP; private static final ITypeBinding[] NO_TYPE_BINDINGS = new ITypeBinding[0]; @@ -136,14 +136,14 @@ class MethodBinding implements IMethodBinding { */ public ITypeBinding getDeclaringClass() { if (this.declaringClass == null) { -//{ObjectTeams: a role-ifc-method representing a one that is inherited from a non-role? - if (this.binding.copyInheritanceSrc != null) +//{ObjectTeams: a role-ifc-method representing a one that is inherited from a non-role? + if (this.binding.copyInheritanceSrc != null) { this.declaringClass = this.resolver.getTypeBinding(this.binding.copyInheritanceSrc.declaringClass); if (!this.declaringClass.isRole()) return this.declaringClass; } -// SH} +// SH} this.declaringClass = this.resolver.getTypeBinding(this.binding.declaringClass); } return this.declaringClass; @@ -472,7 +472,7 @@ class MethodBinding implements IMethodBinding { } //{ObjectTeams: new query: public boolean isCopied() { - return this.binding.copyInheritanceSrc != null; + return this.binding.copyInheritanceSrc != null; } // SH} } diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodBindingOperator.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodBindingOperator.java index 71afb89c7..7d5c12f83 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodBindingOperator.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodBindingOperator.java @@ -1,16 +1,16 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2009 Stephan Herrmann - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * $Id$ - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Stephan Herrmann - Initial API and implementation **********************************************************************/ @@ -35,7 +35,7 @@ public class MethodBindingOperator extends ASTNode { public static final int KIND_CALLOUT = 1; public static final int KIND_CALLOUT_OVERRIDE = 2; public static final int KIND_CALLIN = 3; - + /** * The "binding-kind" property of this node type. */ @@ -45,19 +45,19 @@ public class MethodBindingOperator extends ASTNode { /** * The "binding-modifier" structural property of this node type, none if regular callout. */ - public static final ChildPropertyDescriptor BINDING_MODIFIER_PROPERTY = + public static final ChildPropertyDescriptor BINDING_MODIFIER_PROPERTY = new ChildPropertyDescriptor(MethodBindingOperator.class, "bindingModifier", Modifier.class, OPTIONAL, NO_CYCLE_RISK); //$NON-NLS-1$ - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS_2_0; - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ @@ -77,13 +77,13 @@ public class MethodBindingOperator extends ASTNode { addProperty(BINDING_MODIFIER_PROPERTY, propertyList); // one flag, not a bitset PROPERTY_DESCRIPTORS_3_0 = reapPropertyList(propertyList); } - + /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the AST.JLS* constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) */ public static List propertyDescriptors(int apiLevel) @@ -93,7 +93,7 @@ public class MethodBindingOperator extends ASTNode { else return PROPERTY_DESCRIPTORS_2_0; } - + private int bindingKind = 0; // one of KIND_CALLIN, KIND_CALLOUT, KIND_CALLOUT_OVERRIDE; /** * The modifier flags; exactly one of before, after, replace. @@ -121,7 +121,7 @@ public class MethodBindingOperator extends ASTNode { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + @Override int internalGetSetIntProperty(SimplePropertyDescriptor property, boolean get, int value) { if (property == BINDING_KIND_PROPERTY) { @@ -155,22 +155,22 @@ public class MethodBindingOperator extends ASTNode { /** * Returns the callin modifiers explicitly specified on this declaration. - * + * * @return exactly one of before, after, replace using constants from Modifier * @see Modifier - */ + */ public int getBindingModifier() { - if (this.bindingModifierFlag == 0 && this.bindingModifier != null) + if (this.bindingModifierFlag == 0 && this.bindingModifier != null) { this.bindingModifierFlag = this.bindingModifier.getKeyword().toFlagValue(); } return bindingModifierFlag; } - + /** * Sets the callin or c-t-f modifier explicitly specified on this declaration. - * + * * @param modifiers the given modifiers (bit-wise or of <code>Modifier</code> constants) * @see Modifier */ @@ -178,27 +178,27 @@ public class MethodBindingOperator extends ASTNode { { setBindingModifier(this.ast.newModifier(Modifier.ModifierKeyword.fromFlagValue(modifiers))); } - + public void setBindingModifier(Modifier modifier) { ChildPropertyDescriptor propertyDescriptor = BINDING_MODIFIER_PROPERTY; Modifier oldModifier = this.bindingModifier; preReplaceChild(oldModifier, modifier, propertyDescriptor); this.bindingModifierFlag = 0; // clear cached flags this.bindingModifier = modifier; - postReplaceChild(oldModifier, modifier, propertyDescriptor); + postReplaceChild(oldModifier, modifier, propertyDescriptor); } - + /** * Returns the callin or c-t-f modifier for this mapping declaration. - * + * * @see Modifier * @return one of before, after, replace - */ + */ public Modifier bindingModifier() { return bindingModifier; } - + /** Returns whether this method mapping is a callout to field (get or set). */ public boolean isCalloutToField() { int modifier = this.getBindingModifier(); diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodDeclaration.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodDeclaration.java index 903e65af5..93259be1c 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodDeclaration.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodDeclaration.java @@ -18,12 +18,12 @@ import java.util.List; /** * Method declaration AST node type. A method declaration * is the union of a method declaration and a constructor declaration. - * + * * For JLS2: * <pre> * MethodDeclaration: * [ Javadoc ] { Modifier } ( Type | <b>void</b> ) Identifier <b>(</b> - * [ FormalParameter + * [ FormalParameter * { <b>,</b> FormalParameter } ] <b>)</b> {<b>[</b> <b>]</b> } * [ <b>throws</b> TypeName { <b>,</b> TypeName } ] ( Block | <b>;</b> ) * ConstructorDeclaration: @@ -39,7 +39,7 @@ import java.util.List; * [ Javadoc ] { ExtendedModifier } * [ <b><</b> TypeParameter { <b>,</b> TypeParameter } <b>></b> ] * ( Type | <b>void</b> ) Identifier <b>(</b> - * [ FormalParameter + * [ FormalParameter * { <b>,</b> FormalParameter } ] <b>)</b> {<b>[</b> <b>]</b> } * [ <b>throws</b> TypeName { <b>,</b> TypeName } ] ( Block | <b>;</b> ) * ConstructorDeclaration: @@ -55,9 +55,9 @@ import java.util.List; * range begins with the first character of the "/**" comment delimiter. * When there is no Javadoc comment, the source range begins with the first * character of the first modifier keyword (if modifiers), or the - * first character of the "<" token (method, no modifiers, type parameters), + * first character of the "<" token (method, no modifiers, type parameters), * or the first character of the return type (method, no modifiers, no type - * parameters), or the first character of the identifier (constructor, + * parameters), or the first character of the identifier (constructor, * no modifiers). The source range extends through the last character of the * ";" token (if no body), or the last character of the block (if body). * </p> @@ -67,116 +67,116 @@ import java.util.List; * @noinstantiate This class is not intended to be instantiated by clients. */ public class MethodDeclaration extends BodyDeclaration { - + /** * The "javadoc" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor JAVADOC_PROPERTY = + public static final ChildPropertyDescriptor JAVADOC_PROPERTY = internalJavadocPropertyFactory(MethodDeclaration.class); /** * The "modifiers" structural property of this node type (JLS2 API only). * @since 3.0 */ - public static final SimplePropertyDescriptor MODIFIERS_PROPERTY = + public static final SimplePropertyDescriptor MODIFIERS_PROPERTY = internalModifiersPropertyFactory(MethodDeclaration.class); - + /** * The "modifiers" structural property of this node type (added in JLS3 API). * @since 3.1 */ - public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = + public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = internalModifiers2PropertyFactory(MethodDeclaration.class); - + /** * The "constructor" structural property of this node type. * @since 3.0 */ - public static final SimplePropertyDescriptor CONSTRUCTOR_PROPERTY = + public static final SimplePropertyDescriptor CONSTRUCTOR_PROPERTY = new SimplePropertyDescriptor(MethodDeclaration.class, "constructor", boolean.class, MANDATORY); //$NON-NLS-1$ - + /** * The "name" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor NAME_PROPERTY = + public static final ChildPropertyDescriptor NAME_PROPERTY = new ChildPropertyDescriptor(MethodDeclaration.class, "name", SimpleName.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ /** * The "returnType" structural property of this node type (JLS2 API only). * @since 3.0 */ - public static final ChildPropertyDescriptor RETURN_TYPE_PROPERTY = + public static final ChildPropertyDescriptor RETURN_TYPE_PROPERTY = new ChildPropertyDescriptor(MethodDeclaration.class, "returnType", Type.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ /** * The "returnType2" structural property of this node type (added in JLS3 API). * @since 3.1 */ - public static final ChildPropertyDescriptor RETURN_TYPE2_PROPERTY = + public static final ChildPropertyDescriptor RETURN_TYPE2_PROPERTY = new ChildPropertyDescriptor(MethodDeclaration.class, "returnType2", Type.class, OPTIONAL, NO_CYCLE_RISK); //$NON-NLS-1$ /** * The "extraDimensions" structural property of this node type. * @since 3.0 */ - public static final SimplePropertyDescriptor EXTRA_DIMENSIONS_PROPERTY = + public static final SimplePropertyDescriptor EXTRA_DIMENSIONS_PROPERTY = new SimplePropertyDescriptor(MethodDeclaration.class, "extraDimensions", int.class, MANDATORY); //$NON-NLS-1$ - + /** * The "typeParameters" structural property of this node type (added in JLS3 API). * @since 3.1 */ - public static final ChildListPropertyDescriptor TYPE_PARAMETERS_PROPERTY = + public static final ChildListPropertyDescriptor TYPE_PARAMETERS_PROPERTY = new ChildListPropertyDescriptor(MethodDeclaration.class, "typeParameters", TypeParameter.class, NO_CYCLE_RISK); //$NON-NLS-1$ - + /** * The "parameters" structural property of this node type). * @since 3.0 */ - public static final ChildListPropertyDescriptor PARAMETERS_PROPERTY = + public static final ChildListPropertyDescriptor PARAMETERS_PROPERTY = new ChildListPropertyDescriptor(MethodDeclaration.class, "parameters", SingleVariableDeclaration.class, CYCLE_RISK); //$NON-NLS-1$ - + /** * The "thrownExceptions" structural property of this node type). * @since 3.0 */ - public static final ChildListPropertyDescriptor THROWN_EXCEPTIONS_PROPERTY = + public static final ChildListPropertyDescriptor THROWN_EXCEPTIONS_PROPERTY = new ChildListPropertyDescriptor(MethodDeclaration.class, "thrownExceptions", Name.class, NO_CYCLE_RISK); //$NON-NLS-1$ - + //{ObjectTeams: new element: /** * The "guardPredicate" structural property of this node type. * @since 0.9.25 */ - public static final ChildPropertyDescriptor GUARD_PROPERTY = + public static final ChildPropertyDescriptor GUARD_PROPERTY = new ChildPropertyDescriptor(MethodDeclaration.class, "guardPredicate", GuardPredicateDeclaration.class, OPTIONAL, NO_CYCLE_RISK); //$NON-NLS-1$ // SH} - + /** * The "body" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor BODY_PROPERTY = + public static final ChildPropertyDescriptor BODY_PROPERTY = new ChildPropertyDescriptor(MethodDeclaration.class, "body", Block.class, OPTIONAL, CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. * @since 3.0 */ private static final List PROPERTY_DESCRIPTORS_2_0; - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. * @since 3.1 */ private static final List PROPERTY_DESCRIPTORS_3_0; - + static { List propertyList = new ArrayList(10); createPropertyList(MethodDeclaration.class, propertyList); @@ -189,11 +189,11 @@ public class MethodDeclaration extends BodyDeclaration { addProperty(EXTRA_DIMENSIONS_PROPERTY, propertyList); addProperty(THROWN_EXCEPTIONS_PROPERTY, propertyList); //{ObjectTeams: - addProperty(GUARD_PROPERTY, propertyList); + addProperty(GUARD_PROPERTY, propertyList); // SH} addProperty(BODY_PROPERTY, propertyList); PROPERTY_DESCRIPTORS_2_0 = reapPropertyList(propertyList); - + propertyList = new ArrayList(12); createPropertyList(MethodDeclaration.class, propertyList); addProperty(JAVADOC_PROPERTY, propertyList); @@ -206,7 +206,7 @@ public class MethodDeclaration extends BodyDeclaration { addProperty(EXTRA_DIMENSIONS_PROPERTY, propertyList); addProperty(THROWN_EXCEPTIONS_PROPERTY, propertyList); //{ObjectTeams: - addProperty(GUARD_PROPERTY, propertyList); + addProperty(GUARD_PROPERTY, propertyList); // SH} addProperty(BODY_PROPERTY, propertyList); PROPERTY_DESCRIPTORS_3_0 = reapPropertyList(propertyList); @@ -215,9 +215,9 @@ public class MethodDeclaration extends BodyDeclaration { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the AST.JLS* constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ @@ -228,13 +228,13 @@ public class MethodDeclaration extends BodyDeclaration { return PROPERTY_DESCRIPTORS_3_0; } } - + /** * <code>true</code> for a constructor, <code>false</code> for a method. * Defaults to method. */ private boolean isConstructor = false; - + /** * The method name; lazily initialized; defaults to an unspecified, * legal Java identifier. @@ -242,13 +242,13 @@ public class MethodDeclaration extends BodyDeclaration { private SimpleName methodName = null; /** - * The parameter declarations + * The parameter declarations * (element type: <code>SingleVariableDeclaration</code>). * Defaults to an empty list. */ private ASTNode.NodeList parameters = new ASTNode.NodeList(PARAMETERS_PROPERTY); - + /** * The return type. * JLS2 behevior: lazily initialized; defaults to void. @@ -256,15 +256,15 @@ public class MethodDeclaration extends BodyDeclaration { * Note that this field is ignored for constructor declarations. */ private Type returnType = null; - + /** * Indicated whether the return type has been initialized. * @since 3.1 */ private boolean returnType2Initialized = false; - + /** - * The type paramters (element type: <code>TypeParameter</code>). + * The type paramters (element type: <code>TypeParameter</code>). * Null in JLS2. Added in JLS3; defaults to an empty list * (see constructor). * @since 3.1 @@ -274,7 +274,7 @@ public class MethodDeclaration extends BodyDeclaration { /** * The number of array dimensions that appear after the parameters, rather * than after the return type itself; defaults to 0. - * + * * @since 2.1 */ private int extraArrayDimensions = 0; @@ -294,20 +294,20 @@ public class MethodDeclaration extends BodyDeclaration { * Defaults to none. */ private Block optionalBody = null; - + /** - * Creates a new AST node for a method declaration owned + * Creates a new AST node for a method declaration owned * by the given AST. By default, the declaration is for a method of an - * unspecified, but legal, name; no modifiers; no javadoc; no type - * parameters; void return type; no parameters; no array dimensions after + * unspecified, but legal, name; no modifiers; no javadoc; no type + * parameters; void return type; no parameters; no array dimensions after * the parameters; no thrown exceptions; and no body (as opposed to an * empty body). * <p> - * N.B. This constructor is package-private; all subclasses must be - * declared in the same package; clients are unable to declare + * N.B. This constructor is package-private; all subclasses must be + * declared in the same package; clients are unable to declare * additional subclasses. * </p> - * + * * @param ast the AST that is to own this node */ MethodDeclaration(AST ast) { @@ -324,7 +324,7 @@ public class MethodDeclaration extends BodyDeclaration { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -364,7 +364,7 @@ public class MethodDeclaration extends BodyDeclaration { // allow default implementation to flag the error return super.internalGetSetBooleanProperty(property, get, value); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -422,7 +422,7 @@ public class MethodDeclaration extends BodyDeclaration { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -442,7 +442,7 @@ public class MethodDeclaration extends BodyDeclaration { // allow default implementation to flag the error return super.internalGetChildListProperty(property); } - + /* (omit javadoc for this method) * Method declared on BodyDeclaration. */ @@ -513,7 +513,7 @@ public class MethodDeclaration extends BodyDeclaration { // dispatch to correct overloaded match method return matcher.match(this, other); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -540,23 +540,23 @@ public class MethodDeclaration extends BodyDeclaration { } visitor.endVisit(this); } - + /** * Returns whether this declaration declares a constructor or a method. - * + * * @return <code>true</code> if this is a constructor declaration, * and <code>false</code> if this is a method declaration - */ + */ public boolean isConstructor() { return this.isConstructor; } - + /** * Sets whether this declaration declares a constructor or a method. - * + * * @param isConstructor <code>true</code> for a constructor declaration, * and <code>false</code> for a method declaration - */ + */ public void setConstructor(boolean isConstructor) { preValueChange(CONSTRUCTOR_PROPERTY); this.isConstructor = isConstructor; @@ -566,13 +566,13 @@ public class MethodDeclaration extends BodyDeclaration { /** * Returns the live ordered list of type parameters of this method * declaration (added in JLS3 API). This list is non-empty for parameterized methods. - * + * * @return the live list of type parameters * (element type: <code>TypeParameter</code>) * @exception UnsupportedOperationException if this operation is used in * a JLS2 AST * @since 3.1 - */ + */ public List typeParameters() { // more efficient than just calling unsupportedIn2() to check if (this.typeParameters == null) { @@ -580,14 +580,14 @@ public class MethodDeclaration extends BodyDeclaration { } return this.typeParameters; } - + /** * Returns the name of the method declared in this method declaration. - * For a constructor declaration, this should be the same as the name + * For a constructor declaration, this should be the same as the name * of the class. - * + * * @return the method name node - */ + */ public SimpleName getName() { if (this.methodName == null) { // lazy init must be thread-safe for readers @@ -601,19 +601,19 @@ public class MethodDeclaration extends BodyDeclaration { } return this.methodName; } - + /** * Sets the name of the method declared in this method declaration to the - * given name. For a constructor declaration, this should be the same as + * given name. For a constructor declaration, this should be the same as * the name of the class. - * + * * @param methodName the new method name * @exception IllegalArgumentException if: * <ul> * <li>the node belongs to a different AST</li> * <li>the node already has a parent</li> * </ul> - */ + */ public void setName(SimpleName methodName) { if (methodName == null) { throw new IllegalArgumentException(); @@ -627,26 +627,26 @@ public class MethodDeclaration extends BodyDeclaration { /** * Returns the live ordered list of method parameter declarations for this * method declaration. - * + * * @return the live list of method parameter declarations * (element type: <code>SingleVariableDeclaration</code>) - */ + */ public List parameters() { return this.parameters; } - + /** * Returns whether this method declaration declares a * variable arity method (added in JLS3 API). The convenience method checks * whether the last parameter is so marked. - * + * * @return <code>true</code> if this is a variable arity method declaration, * and <code>false</code> otherwise * @exception UnsupportedOperationException if this operation is used in * a JLS2 AST * @see SingleVariableDeclaration#isVarargs() * @since 3.1 - */ + */ public boolean isVarargs() { // more efficient than just calling unsupportedIn2() to check if (this.modifiers == null) { @@ -659,21 +659,21 @@ public class MethodDeclaration extends BodyDeclaration { return v.isVarargs(); } } - + /** - * Returns the live ordered list of thrown exception names in this method + * Returns the live ordered list of thrown exception names in this method * declaration. - * + * * @return the live list of exception names * (element type: <code>Name</code>) - */ + */ public List thrownExceptions() { return this.thrownExceptions; } - + /** - * Returns the return type of the method declared in this method - * declaration, exclusive of any extra array dimensions (JLS2 API only). + * Returns the return type of the method declared in this method + * declaration, exclusive of any extra array dimensions (JLS2 API only). * This is one of the few places where the void type is meaningful. * <p> * Note that this child is not relevant for constructor declarations @@ -681,17 +681,17 @@ public class MethodDeclaration extends BodyDeclaration { * and visits), and is devoid of the binding information ordinarily * available. * </p> - * + * * @return the return type, possibly the void primitive type * @exception UnsupportedOperationException if this operation is used in * an AST later than JLS2 * @deprecated In the JLS3 API, this method is replaced by {@link #getReturnType2()}, * which may return <code>null</code>. - */ + */ public Type getReturnType() { return internalGetReturnType(); } - + /** * Internal synonym for deprecated method. Used to avoid * deprecation warnings. @@ -720,7 +720,7 @@ public class MethodDeclaration extends BodyDeclaration { * Note that this child is not relevant for constructor declarations * (although it does still figure in subtree equality comparisons and visits). * </p> - * + * * @param type the new return type, possibly the void primitive type * @exception IllegalArgumentException if: * <ul> @@ -729,13 +729,13 @@ public class MethodDeclaration extends BodyDeclaration { * </ul> * @exception UnsupportedOperationException if this operation is used in * an AST later than JLS2 - * @deprecated In the JLS3 API, this method is replaced by + * @deprecated In the JLS3 API, this method is replaced by * {@link #setReturnType2(Type)}, which accepts <code>null</code>. - */ + */ public void setReturnType(Type type) { internalSetReturnType(type); } - + /** * Internal synonym for deprecated method. Used to avoid * deprecation warnings. @@ -753,23 +753,23 @@ public class MethodDeclaration extends BodyDeclaration { } /** - * Returns the return type of the method declared in this method - * declaration, exclusive of any extra array dimensions (added in JLS3 API). + * Returns the return type of the method declared in this method + * declaration, exclusive of any extra array dimensions (added in JLS3 API). * This is one of the few places where the void type is meaningful. * <p> * Note that this child is not relevant for constructor declarations * (although, if present, it does still figure in subtree equality comparisons * and visits), and is devoid of the binding information ordinarily - * available. In the JLS2 API, the return type is mandatory. + * available. In the JLS2 API, the return type is mandatory. * In the JLS3 API, the return type is optional. * </p> - * + * * @return the return type, possibly the void primitive type, * or <code>null</code> if none * @exception UnsupportedOperationException if this operation is used in * a JLS2 AST * @since 3.1 - */ + */ public Type getReturnType2() { unsupportedIn2(); if (this.returnType == null && !this.returnType2Initialized) { @@ -793,10 +793,10 @@ public class MethodDeclaration extends BodyDeclaration { * <p> * Note that this child is not relevant for constructor declarations * (although it does still figure in subtree equality comparisons and visits). - * In the JLS2 API, the return type is mandatory. + * In the JLS2 API, the return type is mandatory. * In the JLS3 API, the return type is optional. * </p> - * + * * @param type the new return type, possibly the void primitive type, * or <code>null</code> if none * @exception UnsupportedOperationException if this operation is used in @@ -807,7 +807,7 @@ public class MethodDeclaration extends BodyDeclaration { * <li>the node already has a parent</li> * </ul> * @since 3.1 - */ + */ public void setReturnType2(Type type) { unsupportedIn2(); this.returnType2Initialized = true; @@ -818,41 +818,41 @@ public class MethodDeclaration extends BodyDeclaration { } /** - * Returns the number of extra array dimensions over and above the + * Returns the number of extra array dimensions over and above the * explicitly-specified return type. * <p> - * For example, <code>int foo()[][]</code> has a return type of - * <code>int</code> and two extra array dimensions; + * For example, <code>int foo()[][]</code> has a return type of + * <code>int</code> and two extra array dimensions; * <code>int[][] foo()</code> has a return type of <code>int[][]</code> * and zero extra array dimensions. The two constructs have different * ASTs, even though there are really syntactic variants of the same * method declaration. * </p> - * + * * @return the number of extra array dimensions * @since 2.1 - */ + */ public int getExtraDimensions() { return this.extraArrayDimensions; } /** - * Sets the number of extra array dimensions over and above the + * Sets the number of extra array dimensions over and above the * explicitly-specified return type. * <p> * For example, <code>int foo()[][]</code> is rendered as a return - * type of <code>int</code> with two extra array dimensions; - * <code>int[][] foo()</code> is rendered as a return type of + * type of <code>int</code> with two extra array dimensions; + * <code>int[][] foo()</code> is rendered as a return type of * <code>int[][]</code> with zero extra array dimensions. The two * constructs have different ASTs, even though there are really syntactic * variants of the same method declaration. * </p> - * + * * @param dimensions the number of array dimensions * @exception IllegalArgumentException if the number of dimensions is * negative * @since 2.1 - */ + */ public void setExtraDimensions(int dimensions) { if (dimensions < 0) { throw new IllegalArgumentException(); @@ -874,16 +874,16 @@ public class MethodDeclaration extends BodyDeclaration { } // SH} /** - * Returns the body of this method declaration, or <code>null</code> if + * Returns the body of this method declaration, or <code>null</code> if * this method has <b>no</b> body. * <p> * Note that there is a subtle difference between having no body and having * an empty body ("{}"). * </p> - * + * * @return the method body, or <code>null</code> if this method has no * body - */ + */ public Block getBody() { return this.optionalBody; } @@ -891,13 +891,13 @@ public class MethodDeclaration extends BodyDeclaration { /** * Sets or clears the body of this method declaration. * <p> - * Note that there is a subtle difference between having no body + * Note that there is a subtle difference between having no body * (as in <code>"void foo();"</code>) and having an empty body (as in * "void foo() {}"). Abstract methods, and methods declared in interfaces, * have no body. Non-abstract methods, and all constructors, have a body. * </p> - * - * @param body the block node, or <code>null</code> if + * + * @param body the block node, or <code>null</code> if * there is none * @exception IllegalArgumentException if: * <ul> @@ -905,7 +905,7 @@ public class MethodDeclaration extends BodyDeclaration { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setBody(Block body) { // a MethodDeclaration may occur in a Block - must check cycles ASTNode oldChild = this.optionalBody; @@ -921,10 +921,10 @@ public class MethodDeclaration extends BodyDeclaration { * Note that bindings are generally unavailable unless requested when the * AST is being built. * </p> - * - * @return the binding, or <code>null</code> if the binding cannot be + * + * @return the binding, or <code>null</code> if the binding cannot be * resolved - */ + */ public IMethodBinding resolveBinding() { return this.ast.getBindingResolver().resolveMethod(this); } @@ -935,7 +935,7 @@ public class MethodDeclaration extends BodyDeclaration { int memSize() { return super.memSize() + 9 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodMappingBinding.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodMappingBinding.java index d67550442..8537a7520 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodMappingBinding.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodMappingBinding.java @@ -1,19 +1,19 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2005, 2007 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute for Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * $Id: MethodMappingBinding.java 23417 2010-02-03 20:13:55Z stephan $ - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation @@ -40,10 +40,10 @@ class MethodMappingBinding implements IMethodMappingBinding private BindingResolver _resolver; private String _name; private ITypeBinding _declaringClass; - private ITypeBinding _baseClass; + private ITypeBinding _baseClass; private IMethodBinding _roleMethod; private IMethodBinding[] _baseMethods; - + MethodMappingBinding( BindingResolver resolver, org.eclipse.objectteams.otdt.internal.core.compiler.lookup.CallinCalloutBinding binding) @@ -51,7 +51,7 @@ class MethodMappingBinding implements IMethodMappingBinding _resolver = resolver; _binding = binding; } - + // svenk: added to hold annotations for method getAnnotations() private IAnnotationBinding[] annotations; @@ -64,7 +64,7 @@ class MethodMappingBinding implements IMethodMappingBinding { _name = new String(_binding.readableName()); } - + return _name; } @@ -77,7 +77,7 @@ class MethodMappingBinding implements IMethodMappingBinding { _declaringClass = _resolver.getTypeBinding(_binding._declaringRoleClass); } - + return _declaringClass; } @@ -87,15 +87,15 @@ class MethodMappingBinding implements IMethodMappingBinding public ITypeBinding getReferencedBaseClass() { if (_baseClass == null) - { + { _baseClass = _resolver.getTypeBinding(_binding._declaringRoleClass.baseclass()); //mkr: This is a workaround because _binding.referencedBaseClass is null // _baseClass = _resolver.getTypeBinding(_binding._referencedBaseClass); } - + return _baseClass; } - + /* * @see IMethodMappingBinding#getRoleMethod() */ @@ -105,10 +105,10 @@ class MethodMappingBinding implements IMethodMappingBinding { _roleMethod = _resolver.getMethodBinding(_binding._roleMethodBinding); } - + return _roleMethod; } - + /* * @see IMethodMappingBinding#getBaseMethods() */ @@ -120,16 +120,16 @@ class MethodMappingBinding implements IMethodMappingBinding if (methodBindings == null) return new IMethodBinding[0]; this._baseMethods = new IMethodBinding[methodBindings.length]; - for (int i = 0; i < methodBindings.length; i++) - this._baseMethods[i] = _resolver.getMethodBinding(methodBindings[i]); + for (int i = 0; i < methodBindings.length; i++) + this._baseMethods[i] = _resolver.getMethodBinding(methodBindings[i]); } - + return _baseMethods; } public String[] getBaseArgumentNames() { MethodBinding[] methodBindings = this._binding._baseMethods; - if (methodBindings != null && methodBindings.length > 0) + if (methodBindings != null && methodBindings.length > 0) { String[] result = new String[methodBindings[0].parameters.length]; AbstractMethodDeclaration methodDecl = methodBindings[0].sourceMethod(); @@ -138,7 +138,7 @@ class MethodMappingBinding implements IMethodMappingBinding if (args != null) { for (int i = 0; i < args.length; i++) result[i] = String.valueOf(args[i].name); - + return result; } } @@ -148,7 +148,7 @@ class MethodMappingBinding implements IMethodMappingBinding } return new String[0]; } - + /* * @see IBinding#getKind() */ @@ -181,7 +181,7 @@ class MethodMappingBinding implements IMethodMappingBinding // // As for now, CalloutMappings have no modifier, // // since get and set are properties of FieldAccessSpec. // } - + return 0; } @@ -200,7 +200,7 @@ class MethodMappingBinding implements IMethodMappingBinding { return false; } - + public boolean isCallin() { return _binding.isCallin(); } @@ -218,8 +218,8 @@ class MethodMappingBinding implements IMethodMappingBinding return buffer.toString(); } - - /* + + /* * For debugging purpose only. * @see java.lang.Object#toString() */ @@ -234,11 +234,11 @@ class MethodMappingBinding implements IMethodMappingBinding } public boolean isEqualTo(IBinding other) { - if (this == other) + if (this == other) return true; if (other == null) return false; - + if (!(other instanceof MethodMappingBinding)) { // consider a callout as equal to the role method it defines. if (!this.isCallin() && this.getRoleMethod().isEqualTo(other)) @@ -247,11 +247,11 @@ class MethodMappingBinding implements IMethodMappingBinding } // untested below [06.02.09] org.eclipse.objectteams.otdt.internal.core.compiler.lookup.CallinCalloutBinding otherBinding = ((MethodMappingBinding) other)._binding; - if (BindingComparator.isEqual(this._binding, otherBinding)) + if (BindingComparator.isEqual(this._binding, otherBinding)) return true; return false; } - + // (svenk: implement method from IBinding public IAnnotationBinding[] getAnnotations() { if (this.annotations != null) { diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodMappingElement.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodMappingElement.java index 7fc2a2406..27039e0c6 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodMappingElement.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodMappingElement.java @@ -1,19 +1,19 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute for Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * $Id: MethodMappingElement.java 23416 2010-02-03 19:59:31Z stephan $ - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation @@ -23,63 +23,63 @@ package org.eclipse.jdt.core.dom; /** * NEW for OTDT - * - * Abstract base class of all AST nodes that represent elements for + * + * Abstract base class of all AST nodes that represent elements for * method mapping like * "void setValue(Integer i) -> set int val" . - * + * * MethodSpec, e.g. "void setValue(Integer i)" * FieldAccessSpec, e.g. "set int val" - * + * * @author jsv - * @version $Id: MethodMappingElement.java 23416 2010-02-03 19:59:31Z stephan $ + * @version $Id: MethodMappingElement.java 23416 2010-02-03 19:59:31Z stephan $ */ public abstract class MethodMappingElement extends ASTNode { - + /** * Creates a new AST node for an expression owned by the given AST. * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ MethodMappingElement(AST ast) { super(ast); } - + /** * The signature flag. * True if MethodMappingElement have a signature */ private boolean _hasSignature = false; - + /** * The element name; lazily initialized; defaults to an unspecified, * legal Java identifier. */ private SimpleName _name = null; - + /** * Returns structural property descriptor for the "signature" property * of this node. - * + * * @return the property descriptor */ public abstract SimplePropertyDescriptor signatureProperty(); - + /** * Returns structural property descriptor for the "name" property * of this node. - * + * * @return the property descriptor */ abstract ChildPropertyDescriptor internalNameProperty(); - + /** * Creates and returns a structural property descriptor for the * "signature" property declared on the given concrete node type. - * + * * @return the property descriptor */ static final SimplePropertyDescriptor internalSignaturePropertyFactory(Class nodeClass) { @@ -89,24 +89,24 @@ public abstract class MethodMappingElement extends ASTNode { /** * Creates and returns a structural property descriptor for the * "name" property declared on the given concrete node type. - * + * * @return the property descriptor */ static final ChildPropertyDescriptor internalNamePropertyFactory(Class nodeClass) { return new ChildPropertyDescriptor(nodeClass, "name", SimpleName.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ } - + /** * Returns the signature flag - */ + */ public boolean hasSignature() { return _hasSignature; } - + /** * Sets the signature flag. - */ + */ public void setSignatureFlag(boolean hasSignature) { SimplePropertyDescriptor p = signatureProperty(); @@ -114,10 +114,10 @@ public abstract class MethodMappingElement extends ASTNode { this._hasSignature = hasSignature; postValueChange(p); } - + /** * Returns the name of the MethodMappingElement - * + * * @return the method name node */ public SimpleName getName() @@ -137,10 +137,10 @@ public abstract class MethodMappingElement extends ASTNode { } return this._name; } - + /** * Sets the name of the MethodMappingElement - * + * * @param newName the new element name * @exception IllegalArgumentException if: * <ul> diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodRef.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodRef.java index c174784ec..503e24c9c 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodRef.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodRef.java @@ -20,44 +20,44 @@ import java.util.List; * tag elements, for references to method and constructor members. * <pre> * MethodRef: - * [ Name ] <b>#</b> Identifier + * [ Name ] <b>#</b> Identifier * <b>(</b> [ MethodRefParameter | { <b>,</b> MethodRefParameter } ] <b>)</b> * </pre> - * + * * @see Javadoc * @since 3.0 * @noinstantiate This class is not intended to be instantiated by clients. */ public class MethodRef extends ASTNode implements IDocElement { - + /** * The "qualifier" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor QUALIFIER_PROPERTY = + public static final ChildPropertyDescriptor QUALIFIER_PROPERTY = new ChildPropertyDescriptor(MethodRef.class, "qualifier", Name.class, OPTIONAL, NO_CYCLE_RISK); //$NON-NLS-1$ /** * The "name" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor NAME_PROPERTY = + public static final ChildPropertyDescriptor NAME_PROPERTY = new ChildPropertyDescriptor(MethodRef.class, "name", SimpleName.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ /** * The "parameters" structural property of this node type. * @since 3.0 */ - public static final ChildListPropertyDescriptor PARAMETERS_PROPERTY = + public static final ChildListPropertyDescriptor PARAMETERS_PROPERTY = new ChildListPropertyDescriptor(MethodRef.class, "parameters", MethodRefParameter.class, NO_CYCLE_RISK); //$NON-NLS-1$ - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List properyList = new ArrayList(4); createPropertyList(MethodRef.class, properyList); @@ -70,16 +70,16 @@ public class MethodRef extends ASTNode implements IDocElement { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the AST.JLS* constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** * The optional qualifier; <code>null</code> for none; defaults to none. */ @@ -90,27 +90,27 @@ public class MethodRef extends ASTNode implements IDocElement { * legal Java method name. */ private SimpleName methodName = null; - + /** - * The parameter declarations + * The parameter declarations * (element type: <code>MethodRefParameter</code>). * Defaults to an empty list. */ private ASTNode.NodeList parameters = new ASTNode.NodeList(PARAMETERS_PROPERTY); - - + + /** - * Creates a new AST node for a method reference owned by the given + * Creates a new AST node for a method reference owned by the given * AST. By default, the method reference is for a method with an * unspecified, but legal, name; no qualifier; and an empty parameter * list. * <p> - * N.B. This constructor is package-private; all subclasses must be - * declared in the same package; clients are unable to declare + * N.B. This constructor is package-private; all subclasses must be + * declared in the same package; clients are unable to declare * additional subclasses. * </p> - * + * * @param ast the AST that is to own this node */ MethodRef(AST ast) { @@ -123,7 +123,7 @@ public class MethodRef extends ASTNode implements IDocElement { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -147,7 +147,7 @@ public class MethodRef extends ASTNode implements IDocElement { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -186,7 +186,7 @@ public class MethodRef extends ASTNode implements IDocElement { // dispatch to correct overloaded match method return matcher.match(this, other); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -200,28 +200,28 @@ public class MethodRef extends ASTNode implements IDocElement { } visitor.endVisit(this); } - + /** - * Returns the qualifier of this method reference, or + * Returns the qualifier of this method reference, or * <code>null</code> if there is none. - * + * * @return the qualifier name node, or <code>null</code> if there is none - */ + */ public Name getQualifier() { return this.optionalQualifier; } - + /** * Sets or clears the qualifier of this method reference. - * - * @param name the qualifier name node, or <code>null</code> if + * + * @param name the qualifier name node, or <code>null</code> if * there is none * @exception IllegalArgumentException if: * <ul> * <li>the node belongs to a different AST</li> * <li>the node already has a parent</li> * </ul> - */ + */ public void setQualifier(Name name) { ASTNode oldChild = this.optionalQualifier; preReplaceChild(oldChild, name, QUALIFIER_PROPERTY); @@ -231,9 +231,9 @@ public class MethodRef extends ASTNode implements IDocElement { /** * Returns the name of the referenced method or constructor. - * + * * @return the method or constructor name node - */ + */ public SimpleName getName() { if (this.methodName == null) { // lazy init must be thread-safe for readers @@ -247,11 +247,11 @@ public class MethodRef extends ASTNode implements IDocElement { } return this.methodName; } - + /** * Sets the name of the referenced method or constructor to the * given name. - * + * * @param name the new method or constructor name node * @exception IllegalArgumentException if: * <ul> @@ -259,7 +259,7 @@ public class MethodRef extends ASTNode implements IDocElement { * <li>the node belongs to a different AST</li> * <li>the node already has a parent</li> * </ul> - */ + */ public void setName(SimpleName name) { if (name == null) { throw new IllegalArgumentException(); @@ -273,14 +273,14 @@ public class MethodRef extends ASTNode implements IDocElement { /** * Returns the live ordered list of method parameter references for this * method reference. - * + * * @return the live list of method parameter references * (element type: <code>MethodRefParameter</code>) - */ + */ public List parameters() { return this.parameters; } - + /** * Resolves and returns the binding for the entity referred to by * this method reference. @@ -288,10 +288,10 @@ public class MethodRef extends ASTNode implements IDocElement { * Note that bindings are generally unavailable unless requested when the * AST is being built. * </p> - * - * @return the binding, or <code>null</code> if the binding cannot be + * + * @return the binding, or <code>null</code> if the binding cannot be * resolved - */ + */ public final IBinding resolveBinding() { return this.ast.getBindingResolver().resolveReference(this); } @@ -302,7 +302,7 @@ public class MethodRef extends ASTNode implements IDocElement { int memSize() { return BASE_NODE_SIZE + 3 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodRefParameter.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodRefParameter.java index 3e8c2ee09..1cfc779a5 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodRefParameter.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodRefParameter.java @@ -34,57 +34,57 @@ import java.util.List; * a way to explicitly refer to variable arity methods, it seems more likely * that the Javadoc spec is wrong in this case. * </p> - * + * * @see Javadoc * @since 3.0 * @noinstantiate This class is not intended to be instantiated by clients. */ public class MethodRefParameter extends ASTNode { - + /** * The "type" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor TYPE_PROPERTY = + public static final ChildPropertyDescriptor TYPE_PROPERTY = new ChildPropertyDescriptor(MethodRefParameter.class, "type", Type.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ /** * The "varargs" structural property of this node type (added in JLS3 API). * @since 3.1 */ - public static final SimplePropertyDescriptor VARARGS_PROPERTY = + public static final SimplePropertyDescriptor VARARGS_PROPERTY = new SimplePropertyDescriptor(MethodRefParameter.class, "varargs", boolean.class, MANDATORY); //$NON-NLS-1$ - + /** * The "name" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor NAME_PROPERTY = + public static final ChildPropertyDescriptor NAME_PROPERTY = new ChildPropertyDescriptor(MethodRefParameter.class, "name", SimpleName.class, OPTIONAL, NO_CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. * @since 3.0 */ private static final List PROPERTY_DESCRIPTORS_2_0; - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. * @since 3.1 */ private static final List PROPERTY_DESCRIPTORS_3_0; - + static { List properyList = new ArrayList(3); createPropertyList(MethodRefParameter.class, properyList); addProperty(TYPE_PROPERTY, properyList); addProperty(NAME_PROPERTY, properyList); PROPERTY_DESCRIPTORS_2_0 = reapPropertyList(properyList); - + properyList = new ArrayList(3); createPropertyList(MethodRefParameter.class, properyList); addProperty(TYPE_PROPERTY, properyList); @@ -96,9 +96,9 @@ public class MethodRefParameter extends ASTNode { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the AST.JLS* constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ @@ -109,7 +109,7 @@ public class MethodRefParameter extends ASTNode { return PROPERTY_DESCRIPTORS_3_0; } } - + /** * The type; lazily initialized; defaults to a unspecified, * legal type. @@ -119,7 +119,7 @@ public class MethodRefParameter extends ASTNode { /** * Indicates the last parameter of a variable arity method; * defaults to false. - * + * * @since 3.1 */ private boolean variableArity = false; @@ -131,13 +131,13 @@ public class MethodRefParameter extends ASTNode { private SimpleName optionalParameterName = null; /** - * Creates a new AST node for a method referenece parameter owned by the given - * AST. By default, the node has an unspecified (but legal) type, + * Creates a new AST node for a method referenece parameter owned by the given + * AST. By default, the node has an unspecified (but legal) type, * not variable arity, and no parameter name. * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ MethodRefParameter(AST ast) { @@ -150,7 +150,7 @@ public class MethodRefParameter extends ASTNode { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -174,7 +174,7 @@ public class MethodRefParameter extends ASTNode { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -190,7 +190,7 @@ public class MethodRefParameter extends ASTNode { // allow default implementation to flag the error return super.internalGetSetBooleanProperty(property, get, value); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -219,7 +219,7 @@ public class MethodRefParameter extends ASTNode { // dispatch to correct overloaded match method return matcher.match(this, other); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -232,12 +232,12 @@ public class MethodRefParameter extends ASTNode { } visitor.endVisit(this); } - + /** * Returns the paramter type. - * + * * @return the parameter type - */ + */ public Type getType() { if (this.type == null) { // lazy init must be thread-safe for readers @@ -254,7 +254,7 @@ public class MethodRefParameter extends ASTNode { /** * Sets the paramter type to the given type. - * + * * @param type the new type * @exception IllegalArgumentException if: * <ul> @@ -262,7 +262,7 @@ public class MethodRefParameter extends ASTNode { * <li>the node belongs to a different AST</li> * <li>the node already has a parent</li> * </ul> - */ + */ public void setType(Type type) { if (type == null) { throw new IllegalArgumentException(); @@ -278,20 +278,20 @@ public class MethodRefParameter extends ASTNode { * the last parameter of a variable arity method (added in JLS3 API). * <p> * Note that the binding for the type <code>Foo</code>in the vararg method - * reference <code>#fun(Foo...)</code> is always for the type as + * reference <code>#fun(Foo...)</code> is always for the type as * written; i.e., the type binding for <code>Foo</code>. However, if you * navigate from the MethodRef to its method binding to the * type binding for its last parameter, the type binding for the vararg * parameter is always an array type (i.e., <code>Foo[]</code>) reflecting * the way vararg methods get compiled. * </p> - * + * * @return <code>true</code> if this is a variable arity parameter, * and <code>false</code> otherwise * @exception UnsupportedOperationException if this operation is used in * a JLS2 AST * @since 3.1 - */ + */ public boolean isVarargs() { unsupportedIn2(); return this.variableArity; @@ -300,11 +300,11 @@ public class MethodRefParameter extends ASTNode { /** * Sets whether this method reference parameter is for the last parameter of * a variable arity method (added in JLS3 API). - * + * * @param variableArity <code>true</code> if this is a variable arity * parameter, and <code>false</code> otherwise * @since 3.1 - */ + */ public void setVarargs(boolean variableArity) { unsupportedIn2(); preValueChange(VARARGS_PROPERTY); @@ -314,24 +314,24 @@ public class MethodRefParameter extends ASTNode { /** * Returns the parameter name, or <code>null</code> if there is none. - * + * * @return the parameter name node, or <code>null</code> if there is none - */ + */ public SimpleName getName() { return this.optionalParameterName; } - + /** * Sets or clears the parameter name. - * - * @param name the parameter name node, or <code>null</code> if + * + * @param name the parameter name node, or <code>null</code> if * there is none * @exception IllegalArgumentException if: * <ul> * <li>the node belongs to a different AST</li> * <li>the node already has a parent</li> * </ul> - */ + */ public void setName(SimpleName name) { ASTNode oldChild = this.optionalParameterName; preReplaceChild(oldChild, name, NAME_PROPERTY); @@ -345,12 +345,12 @@ public class MethodRefParameter extends ASTNode { int memSize() { return BASE_NODE_SIZE + 2 * 5; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int treeSize() { - return + return memSize() + (this.type == null ? 0 : getType().treeSize()) + (this.optionalParameterName == null ? 0 : getName().treeSize()); diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodSpec.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodSpec.java index 1a3a86c6f..75f796d88 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodSpec.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/MethodSpec.java @@ -5,7 +5,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * $Id$ - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. * * Contributors: @@ -22,7 +22,7 @@ import java.util.List; * NEW for OTDT, built in analogy to MethodDeclaration. * * Represents DOM-ASTNode for callout binding to a method of the corresponding - * base class, which has to handle code + * base class, which has to handle code * from e.g. : * baseMethod * to e.g. : @@ -33,12 +33,12 @@ import java.util.List; * returnType, * name, * signature - * + * * This AST node has no modifier. - * - * This node can be used in CalloutMethodDeclaration and + * + * This node can be used in CalloutMethodDeclaration and * CallinMappingDeclaration - * + * * @author jsv */ public class MethodSpec extends MethodMappingElement @@ -46,66 +46,66 @@ public class MethodSpec extends MethodMappingElement /** * The "signature" structural property of this node type. */ - public static final SimplePropertyDescriptor SIGNATURE_PROPERTY = + public static final SimplePropertyDescriptor SIGNATURE_PROPERTY = internalSignaturePropertyFactory(MethodSpec.class); - + /** * The "covariantReturnType" property, flagging if "+" has been specified in the source. * @since OTDT 1.1.3 */ public static final SimplePropertyDescriptor COVARIANT_RETURN_PROPERTY = new SimplePropertyDescriptor(MethodSpec.class, "covariantReturn", boolean.class, MANDATORY); //$NON-NLS-1$ - + /** * The "name" structural property of this node type. */ - public static final ChildPropertyDescriptor NAME_PROPERTY = + public static final ChildPropertyDescriptor NAME_PROPERTY = internalNamePropertyFactory(MethodSpec.class); - + /** * The "returnType" structural property of this node type (JLS2 API only). */ // TODO (jeem) When JLS3 support is complete (post 3.0) - deprecated Replaced by {@link #RETURN_TYPE2_PROPERTY} in the JLS3 API. - public static final ChildPropertyDescriptor RETURN_TYPE_PROPERTY = + public static final ChildPropertyDescriptor RETURN_TYPE_PROPERTY = new ChildPropertyDescriptor(MethodSpec.class, "returnType", Type.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ /** * The "returnType2" structural property of this node type (added in JLS3 API). * @since 3.1 */ - public static final ChildPropertyDescriptor RETURN_TYPE2_PROPERTY = + public static final ChildPropertyDescriptor RETURN_TYPE2_PROPERTY = new ChildPropertyDescriptor(MethodSpec.class, "returnType2", Type.class, OPTIONAL, NO_CYCLE_RISK); //$NON-NLS-1$ /** * The "typeParameters" structural property of this node type (added in JLS3 API). * @since OTDT 1.1.3 */ - public static final ChildListPropertyDescriptor TYPE_PARAMETERS_PROPERTY = + public static final ChildListPropertyDescriptor TYPE_PARAMETERS_PROPERTY = new ChildListPropertyDescriptor(MethodSpec.class, "typeParameters", TypeParameter.class, NO_CYCLE_RISK); //$NON-NLS-1$ - + /** * The "parameters" structural property of this node type). */ - public static final ChildListPropertyDescriptor PARAMETERS_PROPERTY = + public static final ChildListPropertyDescriptor PARAMETERS_PROPERTY = new ChildListPropertyDescriptor(MethodSpec.class, "parameters", SingleVariableDeclaration.class, CYCLE_RISK); //$NON-NLS-1$ - - + + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS_2_0; - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. * @since 3.1 */ private static final List PROPERTY_DESCRIPTORS_3_0; - + static { List propertyList = new ArrayList(6); @@ -116,7 +116,7 @@ public class MethodSpec extends MethodMappingElement addProperty(SIGNATURE_PROPERTY, propertyList); addProperty(COVARIANT_RETURN_PROPERTY, propertyList); PROPERTY_DESCRIPTORS_2_0 = reapPropertyList(propertyList); - + propertyList = new ArrayList(7); createPropertyList(MethodSpec.class, propertyList); addProperty(RETURN_TYPE2_PROPERTY, propertyList); @@ -132,9 +132,9 @@ public class MethodSpec extends MethodMappingElement /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the AST.JLS* constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ @@ -145,15 +145,15 @@ public class MethodSpec extends MethodMappingElement return PROPERTY_DESCRIPTORS_3_0; } } - + /** - * The parameter declarations + * The parameter declarations * (element type: <code>SingleVariableDeclaration</code>). * Defaults to an empty list. */ private ASTNode.NodeList parameters = new ASTNode.NodeList(PARAMETERS_PROPERTY); - + /** * The return type. * JLS2 behevior: lazily initialized; defaults to null. @@ -161,7 +161,7 @@ public class MethodSpec extends MethodMappingElement private Type returnType = null; /** - * The type paramters (element type: <code>TypeParameter</code>). + * The type paramters (element type: <code>TypeParameter</code>). * (see constructor). * @since OTDT 1.1.3 */ @@ -174,18 +174,18 @@ public class MethodSpec extends MethodMappingElement private boolean _hasCovariantReturn; /** - * Creates a new AST node for a method spec declaration owned + * Creates a new AST node for a method spec declaration owned * by the given AST. By default, the declaration is for a method spec - * of an unspecified, but legal, name; no modifiers; no javadoc; no type - * parameters; void return type; no parameters; no array dimensions after + * of an unspecified, but legal, name; no modifiers; no javadoc; no type + * parameters; void return type; no parameters; no array dimensions after * the parameters; no thrown exceptions; and no body (as opposed to an * empty body). * <p> - * N.B. This constructor is package-private; all subclasses must be - * declared in the same package; clients are unable to declare + * N.B. This constructor is package-private; all subclasses must be + * declared in the same package; clients are unable to declare * additional subclasses. * </p> - * + * * @param ast the AST that is to own this node */ MethodSpec(AST ast) @@ -198,27 +198,27 @@ public class MethodSpec extends MethodMappingElement /** * Returns the covariantReturn flag * @since OTDT 1.1.3 - */ + */ public boolean hasCovariantReturn() { return _hasCovariantReturn; } - + /** * Sets the covariantReturn flag. * @since OTDT 1.1.3 - */ + */ public void setCovariantReturnFlag(boolean hasCovariantReturn) { preValueChange(COVARIANT_RETURN_PROPERTY); this._hasCovariantReturn = hasCovariantReturn; postValueChange(COVARIANT_RETURN_PROPERTY); } - + final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + final boolean internalGetSetBooleanProperty(SimplePropertyDescriptor property, boolean get, boolean value) { if (property == SIGNATURE_PROPERTY) @@ -228,7 +228,7 @@ public class MethodSpec extends MethodMappingElement } else { setSignatureFlag(value); return false; - } + } } if (property == COVARIANT_RETURN_PROPERTY) { @@ -237,9 +237,9 @@ public class MethodSpec extends MethodMappingElement } else { setCovariantReturnFlag(value); return false; - } + } } - + return super.internalGetSetBooleanProperty(property, get, value); } @@ -277,12 +277,12 @@ public class MethodSpec extends MethodMappingElement return null; } } - + // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + final List internalGetChildListProperty(ChildListPropertyDescriptor property) { if (property == TYPE_PARAMETERS_PROPERTY) { @@ -295,16 +295,16 @@ public class MethodSpec extends MethodMappingElement return super.internalGetChildListProperty(property); } - + final ChildListPropertyDescriptor internalModifiers2Property() { return null; } - + public SimplePropertyDescriptor signatureProperty() { return SIGNATURE_PROPERTY; } - + ChildPropertyDescriptor internalNameProperty() { return NAME_PROPERTY; } @@ -344,7 +344,7 @@ public class MethodSpec extends MethodMappingElement // dispatch to correct overloaded match method return matcher.match(this, other); } - + void accept0(ASTVisitor visitor) { boolean visitChildren = visitor.visit(this); @@ -370,7 +370,7 @@ public class MethodSpec extends MethodMappingElement /** * Returns the live ordered list of method parameter declarations for this * method spec. - * + * * @return the live list of method parameter declarations * (element type: <code>SingleVariableDeclaration</code>) */ @@ -381,13 +381,13 @@ public class MethodSpec extends MethodMappingElement /** * Returns the live ordered list of type parameters of this method * declaration (added in JLS3 API). This list is non-empty for parameterized methods. - * + * * @return the live list of type parameters * (element type: <code>TypeParameter</code>) * @exception UnsupportedOperationException if this operation is used in * a JLS2 AST * @since OTDT 1.1.3 - */ + */ public List typeParameters() { // more efficient than just calling unsupportedIn2() to check if (this.typeParameters == null) { @@ -399,10 +399,10 @@ public class MethodSpec extends MethodMappingElement public IMethodBinding resolveBinding() { return this.ast.getBindingResolver().resolveMethod(this); } - + /** * Returns the return type of the method declared in this method spec, - * exclusive of any extra array dimensions (JLS2 API only). + * exclusive of any extra array dimensions (JLS2 API only). * This is one of the few places where the void type is meaningful. * <p> * Note that this child is not relevant for constructor declarations @@ -410,7 +410,7 @@ public class MethodSpec extends MethodMappingElement * and visits), and is devoid of the binding information ordinarily * available. * </p> - * + * * @return the return type, possibly the void primitive type * @exception UnsupportedOperationException if this operation is used in * an AST later than JLS2 @@ -443,7 +443,7 @@ public class MethodSpec extends MethodMappingElement * Note that this child is not relevant for constructor declarations * (although it does still figure in subtree equality comparisons and visits). * </p> - * + * * @param type the new return type, possibly the void primitive type * @exception IllegalArgumentException if: * <ul> @@ -466,30 +466,30 @@ public class MethodSpec extends MethodMappingElement this.returnType = type; postReplaceChild(oldChild, type, RETURN_TYPE_PROPERTY); } - + /** - * Returns the return type of the method declared in this method - * declaration, exclusive of any extra array dimensions (added in JLS3 API). + * Returns the return type of the method declared in this method + * declaration, exclusive of any extra array dimensions (added in JLS3 API). * This is one of the few places where the void type is meaningful. * <p> * Note that this child is not relevant for constructor declarations * (although, if present, it does still figure in subtree equality comparisons * and visits), and is devoid of the binding information ordinarily - * available. In the JLS2 API, the return type is mandatory. + * available. In the JLS2 API, the return type is mandatory. * In the JLS3 API, the return type is optional. * </p> - * + * * @return the return type, possibly the void primitive type, * or <code>null</code> if none * @exception UnsupportedOperationException if this operation is used in * a JLS2 AST * @since 3.1 - */ + */ public Type getReturnType2() { unsupportedIn2(); return this.returnType; } - + /** * Sets the return type of the method declared in this method declaration * to the given type, exclusive of any extra array dimensions (added in JLS3 API). @@ -497,10 +497,10 @@ public class MethodSpec extends MethodMappingElement * <p> * Note that this child is not relevant for constructor declarations * (although it does still figure in subtree equality comparisons and visits). - * In the JLS2 API, the return type is mandatory. + * In the JLS2 API, the return type is mandatory. * In the JLS3 API, the return type is optional. * </p> - * + * * @param type the new return type, possibly the void primitive type, * or <code>null</code> if none * @exception UnsupportedOperationException if this operation is used in @@ -511,7 +511,7 @@ public class MethodSpec extends MethodMappingElement * <li>the node already has a parent</li> * </ul> * @since 3.1 - */ + */ public void setReturnType2(Type type) { unsupportedIn2(); ASTNode oldChild = this.returnType; @@ -525,7 +525,7 @@ public class MethodSpec extends MethodMappingElement { return BASE_NODE_SIZE + 3 * 4; } - + int treeSize() { return memSize() diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Modifier.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Modifier.java index 2d203b305..6c0e607c0 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Modifier.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Modifier.java @@ -41,7 +41,7 @@ import java.util.Map; * Note that Java model class {@link org.eclipse.jdt.core.Flags} also * provides the same constants as this class. * </p> - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ @@ -52,43 +52,43 @@ public final class Modifier extends ASTNode implements IExtendedModifier { * @since 3.0 */ public static class ModifierKeyword { - + /** "abstract" modifier with flag value {@link Modifier#ABSTRACT}. */ public static final ModifierKeyword ABSTRACT_KEYWORD = new ModifierKeyword("abstract", ABSTRACT);//$NON-NLS-1$ - + /** "final" modifier with flag value {@link Modifier#FINAL}. */ public static final ModifierKeyword FINAL_KEYWORD = new ModifierKeyword("final", FINAL);//$NON-NLS-1$ - + /** * Map from token to operator (key type: <code>String</code>; * value type: <code>Operator</code>). */ private static final Map KEYWORDS; - + /** "native" modifier with flag value {@link Modifier#NATIVE}. */ public static final ModifierKeyword NATIVE_KEYWORD = new ModifierKeyword("native", NATIVE);//$NON-NLS-1$ - + /** "private" modifier with flag value {@link Modifier#PRIVATE}. */ public static final ModifierKeyword PRIVATE_KEYWORD = new ModifierKeyword("private", PRIVATE);//$NON-NLS-1$ - + /** "protected" modifier with flag value {@link Modifier#PROTECTED}. */ public static final ModifierKeyword PROTECTED_KEYWORD = new ModifierKeyword("protected", PROTECTED);//$NON-NLS-1$ - + /** "public" modifier with flag value {@link Modifier#PUBLIC}. */ public static final ModifierKeyword PUBLIC_KEYWORD = new ModifierKeyword("public", PUBLIC);//$NON-NLS-1$ - + /** "static" modifier with flag value {@link Modifier#STATIC}. */ public static final ModifierKeyword STATIC_KEYWORD = new ModifierKeyword("static", STATIC);//$NON-NLS-1$ - + /** "strictfp" modifier with flag value {@link Modifier#STRICTFP}. */ public static final ModifierKeyword STRICTFP_KEYWORD = new ModifierKeyword("strictfp", STRICTFP);//$NON-NLS-1$ - + /** "synchronized" modifier with flag value {@link Modifier#SYNCHRONIZED}. */ public static final ModifierKeyword SYNCHRONIZED_KEYWORD = new ModifierKeyword("synchronized", SYNCHRONIZED);//$NON-NLS-1$ - + /** "transient" modifier with flag value {@link Modifier#TRANSIENT}. */ public static final ModifierKeyword TRANSIENT_KEYWORD = new ModifierKeyword("transient", TRANSIENT);//$NON-NLS-1$ - + /** "volatile" modifier with flag value {@link Modifier#VOLATILE}. */ public static final ModifierKeyword VOLATILE_KEYWORD = new ModifierKeyword("volatile", VOLATILE);//$NON-NLS-1$ @@ -107,19 +107,19 @@ public final class Modifier extends ASTNode implements IExtendedModifier { /** "set" modifier with flag value {@link Modifier#OT_SET_CALLOUT}. */ public static final ModifierKeyword SET_KEYWORD = new ModifierKeyword("set", OT_SET_CALLOUT);//$NON-NLS-1$ - + /** "team" modifier with flag value {@link Modifier#OT_TEAM}. */ public static final ModifierKeyword TEAM_KEYWORD = new ModifierKeyword("team", OT_TEAM);//$NON-NLS-1$ - + /** "callin" modifier with flag value {@link Modifier#OT_CALLIN}. */ public static final ModifierKeyword CALLIN_KEYWORD = new ModifierKeyword("callin", OT_CALLIN);//$NON-NLS-1$ -//gbr} +//gbr} /** * Map from token to operator (key type: <code>String</code>; * value type: <code>Operator</code>). */ - + static { KEYWORDS = new HashMap(20); ModifierKeyword[] ops = { @@ -143,7 +143,7 @@ public final class Modifier extends ASTNode implements IExtendedModifier { SET_KEYWORD, TEAM_KEYWORD, CALLIN_KEYWORD -//gbr} +//gbr} }; for (int i = 0; i < ops.length; i++) { KEYWORDS.put(ops[i].toString(), ops[i]); @@ -155,10 +155,10 @@ public final class Modifier extends ASTNode implements IExtendedModifier { * or <code>null</code> if none or if more than one bit is set. * <p> * <code>fromFlagValue</code> is the converse of <code>toFlagValue</code>: - * that is, <code>ModifierKind.fromFlagValue(k.toFlagValue()) == k</code> for + * that is, <code>ModifierKind.fromFlagValue(k.toFlagValue()) == k</code> for * all modifier keywords <code>k</code>. * </p> - * + * * @param flagValue the single-bit flag value for the modifier * @return the modifier keyword, or <code>null</code> if none * @see #toFlagValue() @@ -172,16 +172,16 @@ public final class Modifier extends ASTNode implements IExtendedModifier { } return null; } - + /** * Returns the modifier corresponding to the given string, * or <code>null</code> if none. * <p> * <code>toKeyword</code> is the converse of <code>toString</code>: - * that is, <code>ModifierKind.toKeyword(k.toString()) == k</code> for + * that is, <code>ModifierKind.toKeyword(k.toString()) == k</code> for * all modifier keywords <code>k</code>. * </p> - * + * * @param keyword the lowercase string name for the modifier * @return the modifier keyword, or <code>null</code> if none * @see #toString() @@ -189,24 +189,24 @@ public final class Modifier extends ASTNode implements IExtendedModifier { public static ModifierKeyword toKeyword(String keyword) { return (ModifierKeyword) KEYWORDS.get(keyword); } - + /** * The flag value for the modifier. */ private int flagValue; - + /** * The keyword modifier string. */ private String keyword; - + /** * Creates a new modifier with the given keyword. * <p> * Note: this constructor is private. The only instances * ever created are the ones for the standard modifiers. * </p> - * + * * @param keyword the character sequence for the modifier * @param flagValue flag value as described in the Java Virtual Machine Specification */ @@ -214,21 +214,21 @@ public final class Modifier extends ASTNode implements IExtendedModifier { this.keyword = keyword; this.flagValue = flagValue; } - + /** * Returns the modifier flag value corresponding to this modifier keyword. * These flag values are as described in the Java Virtual Machine Specification. - * + * * @return one of the <code>Modifier</code> constants * @see #fromFlagValue(int) - */ + */ public int toFlagValue() { return this.flagValue; } /** * Returns the keyword for the modifier. - * + * * @return the keyword for the modifier * @see #toKeyword(String) */ @@ -255,7 +255,7 @@ public final class Modifier extends ASTNode implements IExtendedModifier { * The "keyword" structural property of this node type. * @since 3.0 */ - public static final SimplePropertyDescriptor KEYWORD_PROPERTY = + public static final SimplePropertyDescriptor KEYWORD_PROPERTY = new SimplePropertyDescriptor(Modifier.class, "keyword", Modifier.ModifierKeyword.class, MANDATORY); //$NON-NLS-1$ /** @@ -279,7 +279,7 @@ public final class Modifier extends ASTNode implements IExtendedModifier { public static final int PRIVATE = 0x0002; /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ @@ -339,24 +339,24 @@ public final class Modifier extends ASTNode implements IExtendedModifier { * Applicable to methods only ("callin" modifier). */ public static final int OT_CALLIN = 0x80000000; // keep in sync with ExtraCompilerModifiers! - + /** * "team" OT-specific modifier constant (bit mask). * Applicable to types and methods. */ public static final int OT_TEAM = 0x8000; // bit 16 - + //{ObjectTeams: OT-specific callin modifier constants // Note(SH): please note, that these modifiers differ from all others in this list, // since they cannot be applied a class, a method, nor a field. // I find it misleading to place them in this file alltogether. - + /** * OT-specific modifier constant. * Applicable only to CallinMappingDeclaration. */ public static final int OT_REPLACE_CALLIN = 0x1000; // bit 13 - + /** Used when no callin modifier is present. */ public static final int OT_MISSING_MODIFIER = 0x2000; // bit 14 @@ -365,7 +365,7 @@ public final class Modifier extends ASTNode implements IExtendedModifier { * Applicable only to CallinMappingDeclaration. */ public static final int OT_BEFORE_CALLIN = 0x4000; // bit 15 - + /** * OT-specific modifier constant. * Applicable only to CallinMappingDeclaration. @@ -383,9 +383,9 @@ public final class Modifier extends ASTNode implements IExtendedModifier { * Applicable only to callout to field (FieldAccessSpec). */ public static final int OT_SET_CALLOUT = 0x40000; // bit 19 - + //gbr} - + static { List properyList = new ArrayList(2); createPropertyList(Modifier.class, properyList); @@ -396,7 +396,7 @@ public final class Modifier extends ASTNode implements IExtendedModifier { /** * Returns whether the given flags includes the "abstract" modifier. * Applicable to types and methods. - * + * * @param flags the modifier flags * @return <code>true</code> if the <code>ABSTRACT</code> bit is * set, and <code>false</code> otherwise @@ -409,7 +409,7 @@ public final class Modifier extends ASTNode implements IExtendedModifier { /** * Returns whether the given flags includes the "final" modifier. * Applicable to types, methods, fields, and variables. - * + * * @param flags the modifier flags * @return <code>true</code> if the <code>FINAL</code> bit is * set, and <code>false</code> otherwise @@ -422,7 +422,7 @@ public final class Modifier extends ASTNode implements IExtendedModifier { /** * Returns whether the given flags includes the "native" modifier. * Applicable only to methods. - * + * * @param flags the modifier flags * @return <code>true</code> if the <code>NATIVE</code> bit is * set, and <code>false</code> otherwise @@ -435,7 +435,7 @@ public final class Modifier extends ASTNode implements IExtendedModifier { /** * Returns whether the given flags includes the "private" modifier. * Applicable to types, methods, constructors, and fields. - * + * * @param flags the modifier flags * @return <code>true</code> if the <code>PRIVATE</code> bit is * set, and <code>false</code> otherwise @@ -448,7 +448,7 @@ public final class Modifier extends ASTNode implements IExtendedModifier { /** * Returns whether the given flags includes the "protected" modifier. * Applicable to types, methods, constructors, and fields. - * + * * @param flags the modifier flags * @return <code>true</code> if the <code>PROTECTED</code> bit is * set, and <code>false</code> otherwise @@ -461,7 +461,7 @@ public final class Modifier extends ASTNode implements IExtendedModifier { /** * Returns whether the given flags includes the "public" modifier. * Applicable to types, methods, constructors, and fields. - * + * * @param flags the modifier flags * @return <code>true</code> if the <code>PUBLIC</code> bit is * set, and <code>false</code> otherwise @@ -474,7 +474,7 @@ public final class Modifier extends ASTNode implements IExtendedModifier { /** * Returns whether the given flags includes the "static" modifier. * Applicable to types, methods, fields, and initializers. - * + * * @param flags the modifier flags * @return <code>true</code> if the <code>STATIC</code> bit is * set, and <code>false</code> otherwise @@ -483,11 +483,11 @@ public final class Modifier extends ASTNode implements IExtendedModifier { public static boolean isStatic(int flags) { return (flags & STATIC) != 0; } - + /** * Returns whether the given flags includes the "strictfp" modifier. * Applicable to types and methods. - * + * * @param flags the modifier flags * @return <code>true</code> if the <code>STRICTFP</code> bit is * set, and <code>false</code> otherwise @@ -496,11 +496,11 @@ public final class Modifier extends ASTNode implements IExtendedModifier { public static boolean isStrictfp(int flags) { return (flags & STRICTFP) != 0; } - + /** * Returns whether the given flags includes the "synchronized" modifier. * Applicable only to methods. - * + * * @param flags the modifier flags * @return <code>true</code> if the <code>SYNCHRONIZED</code> bit is * set, and <code>false</code> otherwise @@ -509,11 +509,11 @@ public final class Modifier extends ASTNode implements IExtendedModifier { public static boolean isSynchronized(int flags) { return (flags & SYNCHRONIZED) != 0; } - + /** * Returns whether the given flags includes the "transient" modifier. * Applicable only to fields. - * + * * @param flags the modifier flags * @return <code>true</code> if the <code>TRANSIENT</code> bit is * set, and <code>false</code> otherwise @@ -522,11 +522,11 @@ public final class Modifier extends ASTNode implements IExtendedModifier { public static boolean isTransient(int flags) { return (flags & TRANSIENT) != 0; } - + /** * Returns whether the given flags includes the "volatile" modifier. * Applicable only to fields. - * + * * @param flags the modifier flags * @return <code>true</code> if the <code>VOLATILE</code> bit is * set, and <code>false</code> otherwise @@ -536,10 +536,10 @@ public final class Modifier extends ASTNode implements IExtendedModifier { return (flags & VOLATILE) != 0; } -//{ObjectTeams: OT-specific check methods +//{ObjectTeams: OT-specific check methods /** * Returns whether the given flags contain the "replace" modifier. - * + * * @param flags the modifier flags * @return <code>true</code> if the <code>REPLACE</code> bit is * set, and <code>false</code> otherwise @@ -551,7 +551,7 @@ public final class Modifier extends ASTNode implements IExtendedModifier { /** * Returns whether the given flags contain the "before" modifier. - * + * * @param flags the modifier flags * @return <code>true</code> if the <code>BEFORE</code> bit is * set, and <code>false</code> otherwise @@ -563,7 +563,7 @@ public final class Modifier extends ASTNode implements IExtendedModifier { /** * Returns whether the given flags contain the "after" modifier. - * + * * @param flags the modifier flags * @return <code>true</code> if the <code>AFTER</code> bit is * set, and <code>false</code> otherwise @@ -572,11 +572,11 @@ public final class Modifier extends ASTNode implements IExtendedModifier { { return (flags & OT_AFTER_CALLIN) != 0; } - + /** * Returns whether the given flags includes the "get" modifier. * Applicable base fields. - * + * * @param flags the modifier flags * @return <code>true</code> if the <code>GET</code> bit is * set, and <code>false</code> otherwise @@ -585,11 +585,11 @@ public final class Modifier extends ASTNode implements IExtendedModifier { { return (flags & OT_GET_CALLOUT) != 0; } - + /** * Returns whether the given flags includes the "set" modifier. * Applicable base fields. - * + * * @param flags the modifier flags * @return <code>true</code> if the <code>SET</code> bit is * set, and <code>false</code> otherwise @@ -598,11 +598,11 @@ public final class Modifier extends ASTNode implements IExtendedModifier { { return (flags & OT_SET_CALLOUT) != 0; } - + /** * Returns whether the given flags includes the "team" modifier. * Applicable base fields. - * + * * @param flags the modifier flags * @return <code>true</code> if the <code>SET</code> bit is * set, and <code>false</code> otherwise @@ -611,11 +611,11 @@ public final class Modifier extends ASTNode implements IExtendedModifier { { return (flags & OT_TEAM) != 0; } - + /** * Returns whether the given flags includes the "callin" modifier. * Applicable to methods only. - * + * * @param flags the modifier flags * @return <code>true</code> if the <code>AccCallin</code> bit is * set, and <code>false</code> otherwise @@ -624,24 +624,24 @@ public final class Modifier extends ASTNode implements IExtendedModifier { { return (flags & OT_CALLIN) != 0; } - + //gbr} - + /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** * The modifier keyword; defaults to an unspecified modifier. * @since 3.0 @@ -654,7 +654,7 @@ public final class Modifier extends ASTNode implements IExtendedModifier { * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node * @since 3.0 */ @@ -671,7 +671,7 @@ public final class Modifier extends ASTNode implements IExtendedModifier { visitor.visit(this); visitor.endVisit(this); } - + /* (omit javadoc for this method) * Method declared on ASTNode. * @since 3.0 @@ -685,10 +685,10 @@ public final class Modifier extends ASTNode implements IExtendedModifier { /** * Returns the modifier keyword of this modifier node. - * + * * @return the modifier keyword * @since 3.0 - */ + */ public ModifierKeyword getKeyword() { return this.modifierKeyword; } @@ -700,7 +700,7 @@ public final class Modifier extends ASTNode implements IExtendedModifier { final int getNodeType0() { return MODIFIER; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -726,7 +726,7 @@ public final class Modifier extends ASTNode implements IExtendedModifier { /** * Answer true if the receiver is the abstract modifier, false otherwise. - * + * * @return true if the receiver is the abstract modifier, false otherwise * @since 3.2 */ @@ -736,14 +736,14 @@ public final class Modifier extends ASTNode implements IExtendedModifier { /** * @see IExtendedModifier#isAnnotation() - */ + */ public boolean isAnnotation() { return false; } - + /** * Answer true if the receiver is the final modifier, false otherwise. - * + * * @return true if the receiver is the final modifier, false otherwise * @since 3.2 */ @@ -753,101 +753,101 @@ public final class Modifier extends ASTNode implements IExtendedModifier { /** * @see IExtendedModifier#isModifier() - */ + */ public boolean isModifier() { return true; } /** * Answer true if the receiver is the native modifier, false otherwise. - * + * * @return true if the receiver is the native modifier, false otherwise * @since 3.2 */ public boolean isNative() { return this.modifierKeyword == ModifierKeyword.NATIVE_KEYWORD; } - + /** * Answer true if the receiver is the private modifier, false otherwise. - * + * * @return true if the receiver is the private modifier, false otherwise * @since 3.2 */ public boolean isPrivate() { return this.modifierKeyword == ModifierKeyword.PRIVATE_KEYWORD; } - + /** * Answer true if the receiver is the protected modifier, false otherwise. - * + * * @return true if the receiver is the protected modifier, false otherwise * @since 3.2 */ public boolean isProtected() { return this.modifierKeyword == ModifierKeyword.PROTECTED_KEYWORD; } - + /** * Answer true if the receiver is the public modifier, false otherwise. - * + * * @return true if the receiver is the public modifier, false otherwise * @since 3.2 */ public boolean isPublic() { return this.modifierKeyword == ModifierKeyword.PUBLIC_KEYWORD; } - + /** * Answer true if the receiver is the static modifier, false otherwise. - * + * * @return true if the receiver is the static modifier, false otherwise * @since 3.2 */ public boolean isStatic() { return this.modifierKeyword == ModifierKeyword.STATIC_KEYWORD; } - + /** * Answer true if the receiver is the strictfp modifier, false otherwise. - * + * * @return true if the receiver is the strictfp modifier, false otherwise * @since 3.2 */ public boolean isStrictfp() { return this.modifierKeyword == ModifierKeyword.STRICTFP_KEYWORD; } - + /** * Answer true if the receiver is the synchronized modifier, false otherwise. - * + * * @return true if the receiver is the synchronized modifier, false otherwise * @since 3.2 */ public boolean isSynchronized() { return this.modifierKeyword == ModifierKeyword.SYNCHRONIZED_KEYWORD; } - + /** * Answer true if the receiver is the transient modifier, false otherwise. - * + * * @return true if the receiver is the transient modifier, false otherwise * @since 3.2 */ public boolean isTransient() { return this.modifierKeyword == ModifierKeyword.TRANSIENT_KEYWORD; } - + /** * Answer true if the receiver is the volatile modifier, false otherwise. - * + * * @return true if the receiver is the volatile modifier, false otherwise * @since 3.2 */ public boolean isVolatile() { return this.modifierKeyword == ModifierKeyword.VOLATILE_KEYWORD; } - + /* (omit javadoc for this method) * Method declared on ASTNode. * @since 3.0 @@ -856,14 +856,14 @@ public final class Modifier extends ASTNode implements IExtendedModifier { // treat ModifierKeyword as free return BASE_NODE_SIZE + 1 * 4; } - + /** * Sets the modifier keyword of this modifier node. - * - * @param modifierKeyord the modifier keyword + * + * @param modifierKeyord the modifier keyword * @exception IllegalArgumentException if the argument is <code>null</code> * @since 3.0 - */ + */ public void setKeyword(ModifierKeyword modifierKeyord) { if (modifierKeyord == null) { throw new IllegalArgumentException(); @@ -872,7 +872,7 @@ public final class Modifier extends ASTNode implements IExtendedModifier { this.modifierKeyword = modifierKeyord; postValueChange(KEYWORD_PROPERTY); } - + /* (omit javadoc for this method) * Method declared on ASTNode. * @since 3.0 @@ -881,7 +881,7 @@ public final class Modifier extends ASTNode implements IExtendedModifier { // dispatch to correct overloaded match method return matcher.match(this, other); } - + /* (omit javadoc for this method) * Method declared on ASTNode. * @since 3.0 diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Name.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Name.java index 9e5de82b8..65430ed08 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Name.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Name.java @@ -13,7 +13,7 @@ package org.eclipse.jdt.core.dom; /** * Abstract base class for all AST nodes that represent names. - * There are exactly two kinds of name: simple ones + * There are exactly two kinds of name: simple ones * (<code>SimpleName</code>) and qualified ones (<code>QualifiedName</code>). * <p> * <pre> @@ -22,51 +22,51 @@ package org.eclipse.jdt.core.dom; * QualifiedName * </pre> * </p> - * + * * @since 2.0 * @noextend This class is not intended to be subclassed by clients. */ public abstract class Name extends Expression implements IDocElement { - + /** - * Approximate base size of an expression node instance in bytes, + * Approximate base size of an expression node instance in bytes, * including object header and instance fields. */ static final int BASE_NAME_NODE_SIZE = BASE_NODE_SIZE + 1 * 4; - + /** * This index represents the position inside a qualified name. */ int index; - + /** * Creates a new AST node for a name owned by the given AST. * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ Name(AST ast) { super(ast); } - + /** * Returns whether this name is a simple name * (<code>SimpleName</code>). - * - * @return <code>true</code> if this is a simple name, and + * + * @return <code>true</code> if this is a simple name, and * <code>false</code> otherwise */ public final boolean isSimpleName() { return (this instanceof SimpleName); } - + /** * Returns whether this name is a qualified name * (<code>QualifiedName</code>). - * - * @return <code>true</code> if this is a qualified name, and + * + * @return <code>true</code> if this is a qualified name, and * <code>false</code> otherwise */ public final boolean isQualifiedName() { @@ -79,21 +79,21 @@ public abstract class Name extends Expression implements IDocElement { * Note that bindings are generally unavailable unless requested when the * AST is being built. * </p> - * - * @return the binding, or <code>null</code> if the binding cannot be + * + * @return the binding, or <code>null</code> if the binding cannot be * resolved - */ + */ public final IBinding resolveBinding() { return this.ast.getBindingResolver().resolveName(this); } - + /** * Returns the standard dot-separated representation of this name. * If the name is a simple name, the result is the name's identifier. * If the name is a qualified name, the result is the name of the qualifier * (as computed by this method) followed by "." followed by the name's * identifier. - * + * * @return the fully qualified name * @since 3.0 */ @@ -111,9 +111,9 @@ public abstract class Name extends Expression implements IDocElement { /** * Appends the standard representation of this name to the given string * buffer. - * + * * @param buffer the buffer * @since 3.0 */ - abstract void appendName(StringBuffer buffer); + abstract void appendName(StringBuffer buffer); } diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/NameEnviromentWithProgress.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/NameEnviromentWithProgress.java index dac646f93..b6404252d 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/NameEnviromentWithProgress.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/NameEnviromentWithProgress.java @@ -24,7 +24,7 @@ import org.eclipse.jdt.internal.core.NameLookup; */ class NameEnviromentWithProgress extends FileSystem implements INameEnviromentWithProgress { IProgressMonitor monitor; - + public NameEnviromentWithProgress(Classpath[] paths, String[] initialFileNames, IProgressMonitor monitor) { super(paths, initialFileNames); setMonitor(monitor); @@ -49,7 +49,7 @@ class NameEnviromentWithProgress extends FileSystem implements INameEnviromentWi checkCanceled(); return super.isPackage(compoundName, packageName); } - + public void setMonitor(IProgressMonitor monitor) { this.monitor = monitor; } diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/NameEnvironmentWithProgress.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/NameEnvironmentWithProgress.java new file mode 100644 index 000000000..36a7095a8 --- /dev/null +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/NameEnvironmentWithProgress.java @@ -0,0 +1,56 @@ +/******************************************************************************* + * Copyright (c) 2010 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.jdt.core.dom; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.OperationCanceledException; +import org.eclipse.jdt.internal.compiler.batch.FileSystem; +import org.eclipse.jdt.internal.compiler.env.NameEnvironmentAnswer; +import org.eclipse.jdt.internal.compiler.problem.AbortCompilation; +import org.eclipse.jdt.internal.core.INameEnvironmentWithProgress; +import org.eclipse.jdt.internal.core.NameLookup; + +/** + * Batch name environment that can be canceled using a monitor. + * @since 3.6 + */ +class NameEnvironmentWithProgress extends FileSystem implements INameEnvironmentWithProgress { + IProgressMonitor monitor; + + public NameEnvironmentWithProgress(Classpath[] paths, String[] initialFileNames, IProgressMonitor monitor) { + super(paths, initialFileNames); + setMonitor(monitor); + } + private void checkCanceled() { + if (this.monitor != null && this.monitor.isCanceled()) { + if (NameLookup.VERBOSE) { + System.out.println(Thread.currentThread() + " CANCELLING LOOKUP "); //$NON-NLS-1$ + } + throw new AbortCompilation(true/*silent*/, new OperationCanceledException()); + } + } + public NameEnvironmentAnswer findType(char[] typeName, char[][] packageName) { + checkCanceled(); + return super.findType(typeName, packageName); + } + public NameEnvironmentAnswer findType(char[][] compoundName) { + checkCanceled(); + return super.findType(compoundName); + } + public boolean isPackage(char[][] compoundName, char[] packageName) { + checkCanceled(); + return super.isPackage(compoundName, packageName); + } + + public void setMonitor(IProgressMonitor monitor) { + this.monitor = monitor; + } +} diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/NodeEventHandler.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/NodeEventHandler.java index a0878837d..91f985611 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/NodeEventHandler.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/NodeEventHandler.java @@ -17,7 +17,7 @@ package org.eclipse.jdt.core.dom; * The default implementation serves as the default event handler * that does nothing. Internal subclasses do all the real work. * </p> - * + * * @see AST#getEventHandler() */ class NodeEventHandler { @@ -28,11 +28,11 @@ class NodeEventHandler { NodeEventHandler() { // default implementation: do nothing } - + /** * Reports that the given node is about to lose a child. * The first half of an event pair. The default implementation does nothing. - * + * * @param node the node about to be modified * @param child the node about to be removed * @param property the child or child list property descriptor @@ -43,11 +43,11 @@ class NodeEventHandler { // do nothing // System.out.println("DEL1 " + property); } - + /** * Reports that the given node has just lose a child. * The second half of an event pair. The default implementation does nothing. - * + * * @param node the node that was modified * @param child the child that was removed; note that this node is unparented * @param property the child or child list property descriptor @@ -58,12 +58,12 @@ class NodeEventHandler { // do nothing // System.out.println("DEL2 " + property); } - + /** * Reports that the given node is about to have a child replaced. * The first half of an event pair. * The default implementation does nothing. - * + * * @param node the node about to be modified * @param child the node about to be replaced * @param newChild the replacement child; note that this node is unparented @@ -75,11 +75,11 @@ class NodeEventHandler { // do nothing // System.out.println("REP1 " + property); } - + /** * Reports that the given node has had its child replaced. The second half * of an event pair. The default implementation does nothing. - * + * * @param node the node that was modified * @param child the node that was replaced; note that this node is unparented * @param newChild the replacement child @@ -91,11 +91,11 @@ class NodeEventHandler { // do nothing // System.out.println("REP2 " + property); } - + /** * Reports that the given node is about to gain a child. * The first half of an event pair. The default implementation does nothing. - * + * * @param node the node that to be modified * @param child the node that is to be added as a child; note that this * node is unparented; in the case of a child list property, the exact @@ -110,11 +110,11 @@ class NodeEventHandler { // do nothing // System.out.println("ADD1 " + property); } - + /** * Reports that the given node has just gained a child. * The second half of an event pair. The default implementation does nothing. - * + * * @param node the node that was modified * @param child the node that was added as a child * @param property the child or child list property descriptor @@ -125,12 +125,12 @@ class NodeEventHandler { // do nothing // System.out.println("ADD2 " + property); } - + /** * Reports that the given node is about to change the value of a * non-child property. The first half of an event pair. * The default implementation does nothing. - * + * * @param node the node to be modified * @param property the property descriptor * @see #postValueChangeEvent(ASTNode, SimplePropertyDescriptor) @@ -145,7 +145,7 @@ class NodeEventHandler { * Reports that the given node has just changed the value of a * non-child property. The second half of an event pair. * The default implementation does nothing. - * + * * @param node the node that was modified * @param property the property descriptor * @see #preValueChangeEvent(ASTNode, SimplePropertyDescriptor) @@ -155,12 +155,12 @@ class NodeEventHandler { // do nothing // System.out.println("MOD2 " + property); } - + /** - * Reports that the given node is about to be cloned. + * Reports that the given node is about to be cloned. * The first half of an event pair. * The default implementation does nothing. - * + * * @param node the node to be modified * @see #postCloneNodeEvent(ASTNode, ASTNode) * @since 3.0 @@ -174,7 +174,7 @@ class NodeEventHandler { * Reports that the given node has just been cloned. * The second half of an event pair. * The default implementation does nothing. - * + * * @param node the node that was modified * @param clone the clone of <code>node</code> * @see #preCloneNodeEvent(ASTNode) @@ -184,5 +184,5 @@ class NodeEventHandler { // do nothing // System.out.println("CLONE2"); } - + } diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/NodeFinder.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/NodeFinder.java index d7630e3b3..fe46b4802 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/NodeFinder.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/NodeFinder.java @@ -44,7 +44,7 @@ public final class NodeFinder { return super.visit(type); } public boolean visit(RoleTypeDeclaration roleType) { - if (this.topType != null && roleType.isRoleFile()) + if (this.topType != null && roleType.isRoleFile()) return false; if (topType == null) topType= roleType; @@ -126,7 +126,7 @@ public final class NodeFinder { /** * Maps a selection to a given ASTNode, where the selection is defined using a source range. * It calls <code>perform(root, range.getOffset(), range.getLength())</code>. - * + * * @return the result node * @see #perform(ASTNode, int, int) */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/NodeSearcher.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/NodeSearcher.java index 1f070c411..4a144ac0b 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/NodeSearcher.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/NodeSearcher.java @@ -24,7 +24,7 @@ class NodeSearcher extends ASTVisitor { public org.eclipse.jdt.internal.compiler.ast.ASTNode found; public TypeDeclaration enclosingType; public int position; - + NodeSearcher(int position) { this.position = position; } @@ -70,7 +70,7 @@ class NodeSearcher extends ASTVisitor { return true; } - return false; + return false; } public boolean visit( @@ -93,7 +93,7 @@ class NodeSearcher extends ASTVisitor { this.enclosingType = typeDeclaration; return true; } - return false; + return false; } } diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/NormalAnnotation.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/NormalAnnotation.java index dfbc7648a..87034ae98 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/NormalAnnotation.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/NormalAnnotation.java @@ -21,31 +21,31 @@ import java.util.List; * <b>@</b> TypeName <b>(</b> [ MemberValuePair { <b>,</b> MemberValuePair } ] <b>)</b> * </pre> * </p> - * + * * @since 3.1 * @noinstantiate This class is not intended to be instantiated by clients. */ public final class NormalAnnotation extends Annotation { - + /** * The "typeName" structural property of this node type. */ - public static final ChildPropertyDescriptor TYPE_NAME_PROPERTY = + public static final ChildPropertyDescriptor TYPE_NAME_PROPERTY = internalTypeNamePropertyFactory(NormalAnnotation.class); /** * The "values" structural property of this node type. */ - public static final ChildListPropertyDescriptor VALUES_PROPERTY = + public static final ChildListPropertyDescriptor VALUES_PROPERTY = new ChildListPropertyDescriptor(NormalAnnotation.class, "values", MemberValuePair.class, CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List propertyList = new ArrayList(3); createPropertyList(NormalAnnotation.class, propertyList); @@ -53,35 +53,35 @@ public final class NormalAnnotation extends Annotation { addProperty(VALUES_PROPERTY, propertyList); PROPERTY_DESCRIPTORS = reapPropertyList(propertyList); } - + /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the AST.JLS* constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** - * The list of member value pairs (element type: + * The list of member value pairs (element type: * {@link MemberValuePair}). Defaults to an empty list. */ - private ASTNode.NodeList values = + private ASTNode.NodeList values = new ASTNode.NodeList(VALUES_PROPERTY); /** - * Creates a new unparented normal annotation node owned + * Creates a new unparented normal annotation node owned * by the given AST. By default, the annotation has an * unspecified type name and an empty list of member value * pairs. * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ NormalAnnotation(AST ast) { @@ -95,7 +95,7 @@ public final class NormalAnnotation extends Annotation { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -111,7 +111,7 @@ public final class NormalAnnotation extends Annotation { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -147,7 +147,7 @@ public final class NormalAnnotation extends Annotation { result.values().addAll(ASTNode.copySubtrees(target, values())); return result; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -155,7 +155,7 @@ public final class NormalAnnotation extends Annotation { // dispatch to correct overloaded match method return matcher.match(this, other); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -168,28 +168,28 @@ public final class NormalAnnotation extends Annotation { } visitor.endVisit(this); } - + /** * Returns the live list of member value pairs in this annotation. * Adding and removing nodes from this list affects this node - * dynamically. All nodes in this list must be - * {@link MemberValuePair}s; attempts to add any other + * dynamically. All nodes in this list must be + * {@link MemberValuePair}s; attempts to add any other * type of node will trigger an exception. - * - * @return the live list of member value pairs in this + * + * @return the live list of member value pairs in this * annotation (element type: <code>MemberValuePair</code>) - */ + */ public List values() { return this.values; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int memSize() { return super.memSize() + 1 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/NullLiteral.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/NullLiteral.java index 8bacdf3b3..3d3f6d579 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/NullLiteral.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/NullLiteral.java @@ -16,19 +16,19 @@ import java.util.List; /** * Null literal node. - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ public class NullLiteral extends Expression { - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List propertyList = new ArrayList(1); createPropertyList(NullLiteral.class, propertyList); @@ -38,24 +38,24 @@ public class NullLiteral extends Expression { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** * Creates a new unparented null literal node owned by the given AST. * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ NullLiteral(AST ast) { @@ -68,7 +68,7 @@ public class NullLiteral extends Expression { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -100,14 +100,14 @@ public class NullLiteral extends Expression { visitor.visit(this); visitor.endVisit(this); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int memSize() { return BASE_NODE_SIZE; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/NumberLiteral.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/NumberLiteral.java index 2e38b173c..79e14a96d 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/NumberLiteral.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/NumberLiteral.java @@ -20,7 +20,7 @@ import org.eclipse.jdt.internal.compiler.parser.TerminalTokens; /** * Number literal nodes. - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ @@ -30,16 +30,16 @@ public class NumberLiteral extends Expression { * The "token" structural property of this node type. * @since 3.0 */ - public static final SimplePropertyDescriptor TOKEN_PROPERTY = + public static final SimplePropertyDescriptor TOKEN_PROPERTY = new SimplePropertyDescriptor(NumberLiteral.class, "token", String.class, MANDATORY); //$NON-NLS-1$ - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List propertyList = new ArrayList(2); createPropertyList(NumberLiteral.class, propertyList); @@ -50,18 +50,18 @@ public class NumberLiteral extends Expression { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** * The token string; defaults to the integer literal "0". */ @@ -73,7 +73,7 @@ public class NumberLiteral extends Expression { * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ NumberLiteral(AST ast) { @@ -86,7 +86,7 @@ public class NumberLiteral extends Expression { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -102,7 +102,7 @@ public class NumberLiteral extends Expression { // allow default implementation to flag the error return super.internalGetSetObjectProperty(property, get, value); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -135,24 +135,24 @@ public class NumberLiteral extends Expression { visitor.visit(this); visitor.endVisit(this); } - + /** * Returns the token of this number literal node. The value is the sequence * of characters that would appear in the source program. - * + * * @return the numeric literal token - */ + */ public String getToken() { return this.tokenValue; } - + /** * Sets the token of this number literal node. The value is the sequence * of characters that would appear in the source program. - * + * * @param token the numeric literal token * @exception IllegalArgumentException if the argument is incorrect - */ + */ public void setToken(String token) { // update internalSetToken(String) if this is changed if (token == null || token.length() == 0) { @@ -183,7 +183,7 @@ public class NumberLiteral extends Expression { default: throw new IllegalArgumentException("Invalid number literal : >" + token + "<"); //$NON-NLS-1$//$NON-NLS-2$ } - break; + break; default: throw new IllegalArgumentException("Invalid number literal : >" + token + "<");//$NON-NLS-1$//$NON-NLS-2$ } @@ -197,7 +197,7 @@ public class NumberLiteral extends Expression { this.tokenValue = token; postValueChange(TOKEN_PROPERTY); } - + /* (omit javadoc for this method) * This method is a copy of setToken(String) that doesn't do any validation. */ @@ -213,7 +213,7 @@ public class NumberLiteral extends Expression { int size = BASE_NODE_SIZE + 1 * 4 + stringSize(this.tokenValue); return size; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/PackageDeclaration.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/PackageDeclaration.java index 8c8d3a0a3..719958f89 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/PackageDeclaration.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/PackageDeclaration.java @@ -31,55 +31,55 @@ import java.util.List; * immediately preceding the package declaration when it occurs in the * special <code>package-info.java</code> compilation unit (JLS3 7.4.1.1). * The Javadoc comment in that file contains the package description. - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ public class PackageDeclaration extends ASTNode { - + /** * The "javadoc" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor JAVADOC_PROPERTY = + public static final ChildPropertyDescriptor JAVADOC_PROPERTY = new ChildPropertyDescriptor(PackageDeclaration.class, "javadoc", Javadoc.class, OPTIONAL, NO_CYCLE_RISK); //$NON-NLS-1$ /** * The "annotations" structural property of this node type (added in JLS3 API). * @since 3.1 */ - public static final ChildListPropertyDescriptor ANNOTATIONS_PROPERTY = + public static final ChildListPropertyDescriptor ANNOTATIONS_PROPERTY = new ChildListPropertyDescriptor(PackageDeclaration.class, "annotations", Annotation.class, CYCLE_RISK); //$NON-NLS-1$ - + /** * The "name" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor NAME_PROPERTY = + public static final ChildPropertyDescriptor NAME_PROPERTY = new ChildPropertyDescriptor(PackageDeclaration.class, "name", Name.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. * @since 3.0 */ private static final List PROPERTY_DESCRIPTORS_2_0; - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. * @since 3.1 */ private static final List PROPERTY_DESCRIPTORS_3_0; - + static { List propertyList = new ArrayList(2); createPropertyList(PackageDeclaration.class, propertyList); addProperty(NAME_PROPERTY, propertyList); PROPERTY_DESCRIPTORS_2_0 = reapPropertyList(propertyList); - + propertyList = new ArrayList(4); createPropertyList(PackageDeclaration.class, propertyList); addProperty(JAVADOC_PROPERTY, propertyList); @@ -91,11 +91,11 @@ public class PackageDeclaration extends ASTNode { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ @@ -106,7 +106,7 @@ public class PackageDeclaration extends ASTNode { return PROPERTY_DESCRIPTORS_3_0; } } - + /** * The doc comment, or <code>null</code> if none. * Defaults to none. @@ -115,13 +115,13 @@ public class PackageDeclaration extends ASTNode { Javadoc optionalDocComment = null; /** - * The annotations (element type: <code>Annotation</code>). + * The annotations (element type: <code>Annotation</code>). * Null in JLS2. Added in JLS3; defaults to an empty list * (see constructor). * @since 3.1 */ private ASTNode.NodeList annotations = null; - + /** * The package name; lazily initialized; defaults to a unspecified, * legal Java package identifier. @@ -133,11 +133,11 @@ public class PackageDeclaration extends ASTNode { * given AST. The package declaration initially has an unspecified, * but legal, Java identifier; and an empty list of annotations. * <p> - * N.B. This constructor is package-private; all subclasses must be - * declared in the same package; clients are unable to declare + * N.B. This constructor is package-private; all subclasses must be + * declared in the same package; clients are unable to declare * additional subclasses. * </p> - * + * * @param ast the AST that is to own this node */ PackageDeclaration(AST ast) { @@ -153,7 +153,7 @@ public class PackageDeclaration extends ASTNode { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -177,7 +177,7 @@ public class PackageDeclaration extends ASTNode { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -232,17 +232,17 @@ public class PackageDeclaration extends ASTNode { } visitor.endVisit(this); } - + /** - * Returns the live ordered list of annotations of this + * Returns the live ordered list of annotations of this * package declaration (added in JLS3 API). - * + * * @return the live list of annotations * (element type: <code>Annotation</code>) * @exception UnsupportedOperationException if this operation is used in * a JLS2 AST * @since 3.1 - */ + */ public List annotations() { // more efficient than just calling unsupportedIn2() to check if (this.annotations == null) { @@ -250,10 +250,10 @@ public class PackageDeclaration extends ASTNode { } return this.annotations; } - + /** * Returns the doc comment node. - * + * * @return the doc comment node, or <code>null</code> if none * @exception UnsupportedOperationException if this operation is used in * a JLS2 AST @@ -269,7 +269,7 @@ public class PackageDeclaration extends ASTNode { /** * Sets or clears the doc comment node. - * + * * @param docComment the doc comment node, or <code>null</code> if none * @exception IllegalArgumentException if the doc comment string is invalid * @exception UnsupportedOperationException if this operation is used in @@ -289,9 +289,9 @@ public class PackageDeclaration extends ASTNode { /** * Returns the package name of this package declaration. - * + * * @return the package name node - */ + */ public Name getName() { if (this.packageName == null) { // lazy init must be thread-safe for readers @@ -305,17 +305,17 @@ public class PackageDeclaration extends ASTNode { } return this.packageName; } - + /** * Sets the package name of this package declaration to the given name. - * + * * @param name the new package name * @exception IllegalArgumentException if`: * <ul> * <li>the node belongs to a different AST</li> * <li>the node already has a parent</li> * </ul> - */ + */ public void setName(Name name) { if (name == null) { throw new IllegalArgumentException(); @@ -325,7 +325,7 @@ public class PackageDeclaration extends ASTNode { this.packageName = name; postReplaceChild(oldChild, name, NAME_PROPERTY); } - + /** * Resolves and returns the binding for the package declared in this package * declaration. @@ -333,21 +333,21 @@ public class PackageDeclaration extends ASTNode { * Note that bindings are generally unavailable unless requested when the * AST is being built. * </p> - * - * @return the binding, or <code>null</code> if the binding cannot be + * + * @return the binding, or <code>null</code> if the binding cannot be * resolved - */ + */ public IPackageBinding resolveBinding() { return this.ast.getBindingResolver().resolvePackage(this); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int memSize() { return BASE_NODE_SIZE + 3 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ParameterMapping.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ParameterMapping.java index 4e0157798..6e6491d30 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ParameterMapping.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ParameterMapping.java @@ -1,19 +1,19 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute for Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * $Id: ParameterMapping.java 23416 2010-02-03 19:59:31Z stephan $ - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation @@ -27,77 +27,77 @@ import java.util.List; * NEW for OTDT. * * Represents the DOM-ASTNode for parameterMapping, which has to handle mappings for callin (OTJLD §4.4) and callout (OTJLD §3.2) bindings. - * + * * Possible parameter mappings are: * "integer.intValue() -> i" or "result <- new Integer(result)" for callout Bindings or * "what <- uid" or "new Integer(i) -> result" for callin Bindings - * - * Contained AST elements: + * + * Contained AST elements: * This class consists of one expression, one identifier, one direction and a flag, whether it is * a return-parameter mapping or not. The direction is necessary for determination of callout and callin. - * + * * Locations in source code: * This node is used in CalloutMappingDeclartion, CallinMappingDeclaration - * + * * @author ike */ public class ParameterMapping extends Expression { /** - * Creates a new AST node for a ParameterMapping declaration owned + * Creates a new AST node for a ParameterMapping declaration owned * by the given AST. By default, the declaration is for a ParameterMapping * of an unspecified, but legal, name; * <p> - * N.B. This constructor is package-private; all subclasses must be - * declared in the same package; clients are unable to declare + * N.B. This constructor is package-private; all subclasses must be + * declared in the same package; clients are unable to declare * additional subclasses. * </p> - * + * * @param ast the AST that is to own this node - */ + */ ParameterMapping(AST ast) { super(ast); } - - + + /** * The expression structural property of this node type. */ - public static final ChildPropertyDescriptor EXPRESSION_PROPERTY = + public static final ChildPropertyDescriptor EXPRESSION_PROPERTY = new ChildPropertyDescriptor(ParameterMapping.class, "expression", Expression.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ - + /** * The identifier structural property of this node type. */ - public static final ChildPropertyDescriptor IDENTIFIER_PROPERTY = + public static final ChildPropertyDescriptor IDENTIFIER_PROPERTY = new ChildPropertyDescriptor(ParameterMapping.class, "identifier", SimpleName.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ /** * The direction structural property of this node type. */ - public static final SimplePropertyDescriptor DIRECTION_PROPERTY = + public static final SimplePropertyDescriptor DIRECTION_PROPERTY = new SimplePropertyDescriptor(ParameterMapping.class, "direction", String.class, MANDATORY); //$NON-NLS-1$ - + /** * The is_Result structural property of this node type. */ private static final SimplePropertyDescriptor IS_RESULT_PROPERTY = new SimplePropertyDescriptor(ParameterMapping.class, "isResult", boolean.class, MANDATORY); //$NON-NLS-1$ - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS_2_0; - + private Expression _expression = null; private SimpleName _identifier = null; private String _direction = null; private boolean _isResult = false; - + static { List propertyList = new ArrayList(5); @@ -108,37 +108,37 @@ public class ParameterMapping extends Expression addProperty(IS_RESULT_PROPERTY, propertyList); PROPERTY_DESCRIPTORS_2_0 = reapPropertyList(propertyList); } - + /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the AST.JLS* constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS_2_0; } - - + + /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the AST.JLS* constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) */ - List internalStructuralPropertiesForType(int apiLevel) + List internalStructuralPropertiesForType(int apiLevel) { return PROPERTY_DESCRIPTORS_2_0; } final ASTNode internalGetSetChildProperty( - ChildPropertyDescriptor property, - boolean isGet, + ChildPropertyDescriptor property, + boolean isGet, ASTNode child) { if (property == IDENTIFIER_PROPERTY) @@ -169,10 +169,10 @@ public class ParameterMapping extends Expression // allow default implementation to flag the error return super.internalGetSetChildProperty(property, isGet, child); } - + final boolean internalGetSetBooleanProperty( - SimplePropertyDescriptor property, - boolean isGet, + SimplePropertyDescriptor property, + boolean isGet, boolean value) { if (property == IS_RESULT_PROPERTY) @@ -185,18 +185,18 @@ public class ParameterMapping extends Expression { setResultFlag(value); return false; - } + } } return super.internalGetSetBooleanProperty(property, isGet, value); } - + /* (non-Javadoc) * @see org.eclipse.jdt.core.dom.ASTNode#internalGetSetObjectProperty(org.eclipse.jdt.core.dom.SimplePropertyDescriptor, boolean, java.lang.Object) */ final Object internalGetSetObjectProperty( SimplePropertyDescriptor property, - boolean isGet, - Object value) + boolean isGet, + Object value) { if (property == DIRECTION_PROPERTY) @@ -213,8 +213,8 @@ public class ParameterMapping extends Expression } return super.internalGetSetObjectProperty(property, isGet, value); } - - public boolean hasResultFlag() + + public boolean hasResultFlag() { return _isResult; } @@ -253,7 +253,7 @@ public class ParameterMapping extends Expression preReplaceChild(oldChild, identifier, IDENTIFIER_PROPERTY); _identifier = identifier; postReplaceChild(oldChild, identifier, IDENTIFIER_PROPERTY); - } + } public String getDirection() { @@ -270,11 +270,11 @@ public class ParameterMapping extends Expression } return _direction; } - + public boolean isBindIN() { return "<-".equals(getDirection()); } - + public void setDirection(String direction) { if (direction == null) @@ -313,7 +313,7 @@ public class ParameterMapping extends Expression _expression = expression; postReplaceChild(oldChild, expression, EXPRESSION_PROPERTY); } - + /* (non-Javadoc) * @see org.eclipse.jdt.core.dom.ASTNode#getNodeType0() */ @@ -321,7 +321,7 @@ public class ParameterMapping extends Expression { return ASTNode.PARAMETER_MAPPING; } - + /* (non-Javadoc) * @see org.eclipse.jdt.core.dom.ASTNode#subtreeMatch0(org.eclipse.jdt.core.dom.ASTMatcher, java.lang.Object) */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ParameterizedType.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ParameterizedType.java index 1d108ce31..d0ea6ba22 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ParameterizedType.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ParameterizedType.java @@ -25,7 +25,7 @@ import java.util.List; * </pre> * The first type may be a simple type or a qualified type; * other kinds of types are meaningless. - * + * * @since 3.1 * @noinstantiate This class is not intended to be instantiated by clients. */ @@ -34,26 +34,26 @@ public class ParameterizedType extends Type { * This index represents the position inside a parameterized qualified type. */ int index; - + /** * The "type" structural property of this node type. */ - public static final ChildPropertyDescriptor TYPE_PROPERTY = + public static final ChildPropertyDescriptor TYPE_PROPERTY = new ChildPropertyDescriptor(ParameterizedType.class, "type", Type.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ /** * The "typeArguments" structural property of this node type. */ - public static final ChildListPropertyDescriptor TYPE_ARGUMENTS_PROPERTY = + public static final ChildListPropertyDescriptor TYPE_ARGUMENTS_PROPERTY = new ChildListPropertyDescriptor(ParameterizedType.class, "typeArguments", Type.class, CYCLE_RISK); //$NON-NLS-1$ - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List propertyList = new ArrayList(3); createPropertyList(ParameterizedType.class, propertyList); @@ -65,30 +65,30 @@ public class ParameterizedType extends Type { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - - /** + + /** * The type node; lazily initialized; defaults to an unspecfied, but legal, * type. */ private Type type = null; - + /** - * The type arguments (element type: <code>Type</code>). + * The type arguments (element type: <code>Type</code>). * Defaults to an empty list. */ private ASTNode.NodeList typeArguments = new ASTNode.NodeList(TYPE_ARGUMENTS_PROPERTY); - + /** * Creates a new unparented node for a parameterized type owned by the * given AST. By default, an unspecified, but legal, type, and no type @@ -96,7 +96,7 @@ public class ParameterizedType extends Type { * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ ParameterizedType(AST ast) { @@ -110,7 +110,7 @@ public class ParameterizedType extends Type { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -126,7 +126,7 @@ public class ParameterizedType extends Type { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -177,12 +177,12 @@ public class ParameterizedType extends Type { } visitor.endVisit(this); } - + /** * Returns the type of this parameterized type. - * + * * @return the type of this parameterized type - */ + */ public Type getType() { if (this.type == null) { // lazy init must be thread-safe for readers @@ -196,17 +196,17 @@ public class ParameterizedType extends Type { } return this.type; } - + /** * Sets the type of this parameterized type. - * + * * @param type the new type of this parameterized type * @exception IllegalArgumentException if: * <ul> * <li>the node belongs to a different AST</li> * <li>the node already has a parent</li> * </ul> - */ + */ public void setType(Type type) { if (type == null) { throw new IllegalArgumentException(); @@ -218,17 +218,17 @@ public class ParameterizedType extends Type { } /** - * Returns the live ordered list of type arguments of this parameterized + * Returns the live ordered list of type arguments of this parameterized * type. For the parameterized type to be plausible, the list should contain * at least one element and not contain primitive types. - * + * * @return the live list of type arguments * (element type: <code>Type</code>) - */ + */ public List typeArguments() { return this.typeArguments; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -236,18 +236,18 @@ public class ParameterizedType extends Type { // treat Code as free return BASE_NODE_SIZE + 3 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int treeSize() { - return + return memSize() + (this.type == null ? 0 : getType().treeSize()) + this.typeArguments.listSize(); } -//{ObjectTeams: value dependent type? +//{ObjectTeams: value dependent type? public boolean isDependentType(boolean onlyRelevant) { if (this.typeArguments.listSize() == 0) return false; diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ParenthesizedExpression.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ParenthesizedExpression.java index 8be31ffe7..f16a0508c 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ParenthesizedExpression.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ParenthesizedExpression.java @@ -21,26 +21,26 @@ import java.util.List; * ParenthesizedExpression: * <b>(</b> Expression <b>)</b> * </pre> - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ public class ParenthesizedExpression extends Expression { - + /** * The "expression" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor EXPRESSION_PROPERTY = + public static final ChildPropertyDescriptor EXPRESSION_PROPERTY = new ChildPropertyDescriptor(ParenthesizedExpression.class, "expression", Expression.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List propertyList = new ArrayList(2); createPropertyList(ParenthesizedExpression.class, propertyList); @@ -51,17 +51,17 @@ public class ParenthesizedExpression extends Expression { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** * The expression; lazily initialized; defaults to a unspecified, but legal, * expression. @@ -69,13 +69,13 @@ public class ParenthesizedExpression extends Expression { private Expression expression = null; /** - * Creates a new unparented parenthesized expression node owned by the given + * Creates a new unparented parenthesized expression node owned by the given * AST. By default, the parenthesized expression has an unspecified, but * legal, expression. * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ ParenthesizedExpression(AST ast) { @@ -88,7 +88,7 @@ public class ParenthesizedExpression extends Expression { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -104,7 +104,7 @@ public class ParenthesizedExpression extends Expression { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -121,7 +121,7 @@ public class ParenthesizedExpression extends Expression { result.setExpression((Expression) getExpression().clone(target)); return result; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -140,12 +140,12 @@ public class ParenthesizedExpression extends Expression { } visitor.endVisit(this); } - + /** * Returns the expression of this parenthesized expression. - * + * * @return the expression node - */ + */ public Expression getExpression() { if (this.expression == null) { // lazy init must be thread-safe for readers @@ -159,10 +159,10 @@ public class ParenthesizedExpression extends Expression { } return this.expression; } - + /** * Sets the expression of this parenthesized expression. - * + * * @param expression the new expression node * @exception IllegalArgumentException if: * <ul> @@ -170,7 +170,7 @@ public class ParenthesizedExpression extends Expression { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setExpression(Expression expression) { if (expression == null) { throw new IllegalArgumentException(); @@ -187,12 +187,12 @@ public class ParenthesizedExpression extends Expression { int memSize() { return BASE_NODE_SIZE + 1 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int treeSize() { - return + return memSize() + (this.expression == null ? 0 : getExpression().treeSize()); } diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/PostfixExpression.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/PostfixExpression.java index a51db30d8..1b4950a5f 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/PostfixExpression.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/PostfixExpression.java @@ -23,7 +23,7 @@ import java.util.Map; * PostfixExpression: * Expression PostfixOperator * </pre> - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ @@ -38,39 +38,39 @@ public class PostfixExpression extends Expression { * </pre> */ public static class Operator { - + /** * The token for the operator. */ private String token; - + /** * Creates a new postfix operator with the given token. * <p> * Note: this constructor is private. The only instances * ever created are the ones for the standard operators. * </p> - * + * * @param token the character sequence for the operator */ private Operator(String token) { this.token = token; } - + /** * Returns the character sequence for the operator. - * + * * @return the character sequence for the operator */ public String toString() { return this.token; } - + /** Postfix increment "++" operator. */ public static final Operator INCREMENT = new Operator("++");//$NON-NLS-1$ /** Postfix decrement "--" operator. */ public static final Operator DECREMENT = new Operator("--");//$NON-NLS-1$ - + /** * Map from token to operator (key type: <code>String</code>; * value type: <code>Operator</code>). @@ -92,10 +92,10 @@ public class PostfixExpression extends Expression { * or <code>null</code> if none. * <p> * <code>toOperator</code> is the converse of <code>toString</code>: - * that is, <code>Operator.toOperator(op.toString()) == op</code> for + * that is, <code>Operator.toOperator(op.toString()) == op</code> for * all operators <code>op</code>. * </p> - * + * * @param token the character sequence for the operator * @return the postfix operator, or <code>null</code> if none */ @@ -103,28 +103,28 @@ public class PostfixExpression extends Expression { return (Operator) CODES.get(token); } } - + /** * The "operator" structural property of this node type. * @since 3.0 */ - public static final SimplePropertyDescriptor OPERATOR_PROPERTY = + public static final SimplePropertyDescriptor OPERATOR_PROPERTY = new SimplePropertyDescriptor(PostfixExpression.class, "operator", PostfixExpression.Operator.class, MANDATORY); //$NON-NLS-1$ - + /** * The "operand" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor OPERAND_PROPERTY = + public static final ChildPropertyDescriptor OPERAND_PROPERTY = new ChildPropertyDescriptor(PostfixExpression.class, "operand", Expression.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List propertyList = new ArrayList(3); createPropertyList(PostfixExpression.class, propertyList); @@ -136,22 +136,22 @@ public class PostfixExpression extends Expression { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** * The operator; defaults to an unspecified postfix operator. */ - private PostfixExpression.Operator operator = + private PostfixExpression.Operator operator = PostfixExpression.Operator.INCREMENT; /** @@ -161,10 +161,10 @@ public class PostfixExpression extends Expression { private Expression operand = null; /** - * Creates a new AST node for an postfix expression owned by the given - * AST. By default, the node has unspecified (but legal) operator and + * Creates a new AST node for an postfix expression owned by the given + * AST. By default, the node has unspecified (but legal) operator and * operand. - * + * * @param ast the AST that is to own this node */ PostfixExpression(AST ast) { @@ -177,7 +177,7 @@ public class PostfixExpression extends Expression { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -209,7 +209,7 @@ public class PostfixExpression extends Expression { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -246,22 +246,22 @@ public class PostfixExpression extends Expression { } visitor.endVisit(this); } - + /** * Returns the operator of this postfix expression. - * + * * @return the operator - */ + */ public PostfixExpression.Operator getOperator() { return this.operator; } /** * Sets the operator of this postfix expression. - * + * * @param operator the operator * @exception IllegalArgumentException if the argument is incorrect - */ + */ public void setOperator(PostfixExpression.Operator operator) { if (operator == null) { throw new IllegalArgumentException(); @@ -273,9 +273,9 @@ public class PostfixExpression extends Expression { /** * Returns the operand of this postfix expression. - * + * * @return the operand expression node - */ + */ public Expression getOperand() { if (this.operand == null) { // lazy init must be thread-safe for readers @@ -289,10 +289,10 @@ public class PostfixExpression extends Expression { } return this.operand; } - + /** * Sets the operand of this postfix expression. - * + * * @param expression the operand expression node * @exception IllegalArgumentException if: * <ul> @@ -300,7 +300,7 @@ public class PostfixExpression extends Expression { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setOperand(Expression expression) { if (expression == null) { throw new IllegalArgumentException(); @@ -318,12 +318,12 @@ public class PostfixExpression extends Expression { // treat Operator as free return BASE_NODE_SIZE + 2 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int treeSize() { - return + return memSize() + (this.operand == null ? 0 : getOperand().treeSize()); } diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/PrecedenceDeclaration.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/PrecedenceDeclaration.java index 84165703d..83a84a3a7 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/PrecedenceDeclaration.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/PrecedenceDeclaration.java @@ -1,19 +1,19 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2006 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute for Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * $Id: PrecedenceDeclaration.java 23417 2010-02-03 20:13:55Z stephan $ - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation @@ -25,9 +25,9 @@ import java.util.List; /** * This class represents a precedence declaration in OT/J (OTJLD §4.8). - * A precedence declaration contains a list of names + * A precedence declaration contains a list of names * referring either to classes or to callin bindings. - * + * * @author stephan */ @SuppressWarnings("rawtypes") @@ -42,11 +42,11 @@ public class PrecedenceDeclaration extends ASTNode { * @since 0.7.0 */ @SuppressWarnings("nls") - public static final SimplePropertyDescriptor AFTER_PROPERTY = + public static final SimplePropertyDescriptor AFTER_PROPERTY = new SimplePropertyDescriptor(PrecedenceDeclaration.class, "after", boolean.class, MANDATORY); private static final List PROPERTY_DESCRIPTORS_3_0; - + static { List propertyList = new ArrayList(3); createPropertyList(PrecedenceDeclaration.class, propertyList); @@ -54,7 +54,7 @@ public class PrecedenceDeclaration extends ASTNode { addProperty(AFTER_PROPERTY, propertyList); PROPERTY_DESCRIPTORS_3_0 = reapPropertyList(propertyList); } - + public static List propertyDescriptors(int apiLevel) { if (apiLevel == AST.JLS2_INTERNAL) { throw new UnsupportedOperationException("JLS2 not supported"); //$NON-NLS-1$ @@ -62,19 +62,19 @@ public class PrecedenceDeclaration extends ASTNode { return PROPERTY_DESCRIPTORS_3_0; } } - + ASTNode.NodeList _elements = new ASTNode.NodeList(ELEMENTS_PROPERTY); /** * <code>true</code> for <code>precedence after</code>, else <code>false</code>. */ boolean isAfter = false; - + PrecedenceDeclaration(AST ast) { super(ast); } - + List internalGetChildListProperty(ChildListPropertyDescriptor property) { if (property == ELEMENTS_PROPERTY) { @@ -83,7 +83,7 @@ public class PrecedenceDeclaration extends ASTNode { // allow default implementation to flag the error return super.internalGetChildListProperty(property); } - + @Override boolean internalGetSetBooleanProperty(SimplePropertyDescriptor property, boolean get, boolean value) { if (property == AFTER_PROPERTY) { @@ -122,7 +122,7 @@ public class PrecedenceDeclaration extends ASTNode { @SuppressWarnings("unchecked") @Override ASTNode clone0(AST target) { - if (this.ast.apiLevel == AST.JLS2_INTERNAL) + if (this.ast.apiLevel == AST.JLS2_INTERNAL) unsupportedIn2(); PrecedenceDeclaration result = new PrecedenceDeclaration(target); result.setSourceRange(this.getStartPosition(), this.getLength()); @@ -140,22 +140,22 @@ public class PrecedenceDeclaration extends ASTNode { List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + public List elements() { return this._elements; } /** - * Mark whether this is a <code>precedence after</code> declaration. + * Mark whether this is a <code>precedence after</code> declaration. */ public void setAfter(boolean isAfter) { preValueChange(AFTER_PROPERTY); this.isAfter = isAfter; - postValueChange(AFTER_PROPERTY); + postValueChange(AFTER_PROPERTY); } /** - * Answer whether this is a <code>precedence after</code> declaration. + * Answer whether this is a <code>precedence after</code> declaration. */ public boolean isAfter() { return this.isAfter; diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/PrefixExpression.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/PrefixExpression.java index 196c800ba..97ab05d80 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/PrefixExpression.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/PrefixExpression.java @@ -21,9 +21,9 @@ import java.util.Map; * * <pre> * PrefixExpression: - * PrefixOperator Expression + * PrefixOperator Expression * </pre> - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ @@ -42,34 +42,34 @@ public class PrefixExpression extends Expression { * </pre> */ public static class Operator { - + /** * The token for the operator. */ private String token; - + /** * Creates a new prefix operator with the given token. * <p> * Note: this constructor is private. The only instances * ever created are the ones for the standard operators. * </p> - * + * * @param token the character sequence for the operator */ private Operator(String token) { this.token = token; } - + /** * Returns the character sequence for the operator. - * + * * @return the character sequence for the operator */ public String toString() { return this.token; } - + /** Prefix increment "++" operator. */ public static final Operator INCREMENT = new Operator("++");//$NON-NLS-1$ /** Prefix decrement "--" operator. */ @@ -82,7 +82,7 @@ public class PrefixExpression extends Expression { public static final Operator COMPLEMENT = new Operator("~");//$NON-NLS-1$ /** Logical complement "!" operator. */ public static final Operator NOT = new Operator("!");//$NON-NLS-1$ - + /** * Map from token to operator (key type: <code>String</code>; * value type: <code>Operator</code>). @@ -108,10 +108,10 @@ public class PrefixExpression extends Expression { * or <code>null</code> if none. * <p> * <code>toOperator</code> is the converse of <code>toString</code>: - * that is, <code>Operator.toOperator(op.toString()) == op</code> for + * that is, <code>Operator.toOperator(op.toString()) == op</code> for * all operators <code>op</code>. * </p> - * + * * @param token the character sequence for the operator * @return the prefix operator, or <code>null</code> if none */ @@ -119,28 +119,28 @@ public class PrefixExpression extends Expression { return (Operator) CODES.get(token); } } - + /** * The "operator" structural property of this node type. * @since 3.0 */ - public static final SimplePropertyDescriptor OPERATOR_PROPERTY = + public static final SimplePropertyDescriptor OPERATOR_PROPERTY = new SimplePropertyDescriptor(PrefixExpression.class, "operator", PrefixExpression.Operator.class, MANDATORY); //$NON-NLS-1$ - + /** * The "operand" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor OPERAND_PROPERTY = + public static final ChildPropertyDescriptor OPERAND_PROPERTY = new ChildPropertyDescriptor(PrefixExpression.class, "operand", Expression.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List propertyList = new ArrayList(3); createPropertyList(PrefixExpression.class, propertyList); @@ -152,22 +152,22 @@ public class PrefixExpression extends Expression { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** * The operator; defaults to an unspecified prefix operator. */ - private PrefixExpression.Operator operator = + private PrefixExpression.Operator operator = PrefixExpression.Operator.PLUS; /** @@ -177,10 +177,10 @@ public class PrefixExpression extends Expression { private Expression operand = null; /** - * Creates a new AST node for an prefix expression owned by the given - * AST. By default, the node has unspecified (but legal) operator and + * Creates a new AST node for an prefix expression owned by the given + * AST. By default, the node has unspecified (but legal) operator and * operand. - * + * * @param ast the AST that is to own this node */ PrefixExpression(AST ast) { @@ -193,7 +193,7 @@ public class PrefixExpression extends Expression { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -225,7 +225,7 @@ public class PrefixExpression extends Expression { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -263,22 +263,22 @@ public class PrefixExpression extends Expression { } visitor.endVisit(this); } - + /** * Returns the operator of this prefix expression. - * + * * @return the operator - */ + */ public PrefixExpression.Operator getOperator() { return this.operator; } /** * Sets the operator of this prefix expression. - * + * * @param operator the operator * @exception IllegalArgumentException if the argument is incorrect - */ + */ public void setOperator(PrefixExpression.Operator operator) { if (operator == null) { throw new IllegalArgumentException(); @@ -290,9 +290,9 @@ public class PrefixExpression extends Expression { /** * Returns the operand of this prefix expression. - * + * * @return the operand expression node - */ + */ public Expression getOperand() { if (this.operand == null) { // lazy init must be thread-safe for readers @@ -306,10 +306,10 @@ public class PrefixExpression extends Expression { } return this.operand; } - + /** * Sets the operand of this prefix expression. - * + * * @param expression the operand expression node * @exception IllegalArgumentException if: * <ul> @@ -317,7 +317,7 @@ public class PrefixExpression extends Expression { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setOperand(Expression expression) { if (expression == null) { throw new IllegalArgumentException(); @@ -335,12 +335,12 @@ public class PrefixExpression extends Expression { // treat Operator as free return BASE_NODE_SIZE + 2 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int treeSize() { - return + return memSize() + (this.operand == null ? 0 : getOperand().treeSize()); } diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/PrimitiveType.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/PrimitiveType.java index 0dcf6fff1..7c98424bf 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/PrimitiveType.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/PrimitiveType.java @@ -35,12 +35,12 @@ import java.util.Map; * have a specific parent, there needs to multiple instances of these * nodes. * </p> - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ public class PrimitiveType extends Type { - + /** * Primitive type codes (typesafe enumeration). * <pre> @@ -56,35 +56,35 @@ public class PrimitiveType extends Type { * </pre> */ public static class Code { - + /** * The name of the type. */ private String name; - + /** * Creates a new primitive type code with the given name. * <p> * Note: this constructor is package-private. The only instances * ever created are the ones for the standard primitive types. * </p> - * + * * @param name the standard name of the primitive type */ Code(String name) { this.name = name; } - + /** * Returns the standard name of the primitive type. - * + * * @return the standard name of the primitive type */ public String toString() { return this.name; } - } - + } + /** Type code for the primitive type "int". */ public static final Code INT = new Code("int");//$NON-NLS-1$ /** Type code for the primitive type "char". */ @@ -107,13 +107,13 @@ public class PrimitiveType extends Type { * type and as a type literal. */ public static final Code VOID = new Code("void");//$NON-NLS-1$ - - /** + + /** * The primitive type code; one of the PrimitiveType constants; default * is int. */ private PrimitiveType.Code typeCode = INT; - + /** * Map from token to primitive type code (key type: <code>String</code>; * value type: <code>PrimitiveType.Code</code>). @@ -136,38 +136,38 @@ public class PrimitiveType extends Type { CODES.put(ops[i].toString(), ops[i]); } } - + /** * Returns the primitive type code corresponding to the given string, * or <code>null</code> if none. * <p> * <code>toCode</code> is the converse of <code>toString</code>: - * that is, + * that is, * <code>PrimitiveType.Code.toCode(code.toString()) == code</code> * for all type code <code>code</code>. * </p> - * + * * @param token the standard name of the primitive type * @return the primitive type code, or <code>null</code> if none */ public static PrimitiveType.Code toCode(String token) { return (PrimitiveType.Code) CODES.get(token); } - + /** * The "primitiveTypeCode" structural property of this node type. * @since 3.0 */ - public static final SimplePropertyDescriptor PRIMITIVE_TYPE_CODE_PROPERTY = + public static final SimplePropertyDescriptor PRIMITIVE_TYPE_CODE_PROPERTY = new SimplePropertyDescriptor(PrimitiveType.class, "primitiveTypeCode", PrimitiveType.Code.class, MANDATORY); //$NON-NLS-1$ - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List propertyList = new ArrayList(2); createPropertyList(PrimitiveType.class, propertyList); @@ -178,38 +178,38 @@ public class PrimitiveType extends Type { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** * Creates a new unparented node for a primitive type owned by the given * AST. By default, the node has type "int". * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ PrimitiveType(AST ast) { super(ast); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -258,21 +258,21 @@ public class PrimitiveType extends Type { visitor.visit(this); visitor.endVisit(this); } - + /** * Returns the primitive type code. - * + * * @return one of the primitive type code constants declared in this * class */ public PrimitiveType.Code getPrimitiveTypeCode() { return this.typeCode; } - + /** * Sets the primitive type code. - * - * @param typeCode one of the primitive type code constants declared in + * + * @param typeCode one of the primitive type code constants declared in * this class * @exception IllegalArgumentException if the argument is incorrect */ @@ -292,7 +292,7 @@ public class PrimitiveType extends Type { // treat Code as free return BASE_NODE_SIZE + 1 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/QualifiedName.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/QualifiedName.java index 002c3604e..fe2b6cd81 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/QualifiedName.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/QualifiedName.java @@ -27,34 +27,34 @@ import java.util.List; * See <code>FieldAccess</code> for guidelines on handling other expressions * that resemble qualified names. * </p> - * + * * @see FieldAccess * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ public class QualifiedName extends Name { - + /** * The "qualifier" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor QUALIFIER_PROPERTY = + public static final ChildPropertyDescriptor QUALIFIER_PROPERTY = new ChildPropertyDescriptor(QualifiedName.class, "qualifier", Name.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ /** * The "name" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor NAME_PROPERTY = + public static final ChildPropertyDescriptor NAME_PROPERTY = new ChildPropertyDescriptor(QualifiedName.class, "name", SimpleName.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List propertyList = new ArrayList(3); createPropertyList(QualifiedName.class, propertyList); @@ -66,50 +66,50 @@ public class QualifiedName extends Name { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** - * The identifier; lazily initialized; defaults to a unspecified, legal + * The identifier; lazily initialized; defaults to a unspecified, legal * Java identifier. */ private Name qualifier = null; - + /** * The name being qualified; lazily initialized; defaults to a unspecified, * legal Java identifier. */ private SimpleName name = null; - + /** * Creates a new AST node for a qualified name owned by the given AST. * <p> - * N.B. This constructor is package-private; all subclasses must be - * declared in the same package; clients are unable to declare + * N.B. This constructor is package-private; all subclasses must be + * declared in the same package; clients are unable to declare * additional subclasses. * </p> - * + * * @param ast the AST that is to own this node */ QualifiedName(AST ast) { super(ast); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -133,7 +133,7 @@ public class QualifiedName extends Name { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -172,12 +172,12 @@ public class QualifiedName extends Name { } visitor.endVisit(this); } - + /** * Returns the qualifier part of this qualified name. - * + * * @return the qualifier part of this qualified name - */ + */ public Name getQualifier() { if (this.qualifier == null) { // lazy init must be thread-safe for readers @@ -191,10 +191,10 @@ public class QualifiedName extends Name { } return this.qualifier; } - + /** * Sets the qualifier of this qualified name to the given name. - * + * * @param qualifier the qualifier of this qualified name * @exception IllegalArgumentException if: * <ul> @@ -202,7 +202,7 @@ public class QualifiedName extends Name { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setQualifier(Name qualifier) { if (qualifier == null) { throw new IllegalArgumentException(); @@ -212,12 +212,12 @@ public class QualifiedName extends Name { this.qualifier = qualifier; postReplaceChild(oldChild, qualifier, QUALIFIER_PROPERTY); } - + /** * Returns the name part of this qualified name. - * - * @return the name being qualified - */ + * + * @return the name being qualified + */ public SimpleName getName() { if (this.name == null) { // lazy init must be thread-safe for readers @@ -231,17 +231,17 @@ public class QualifiedName extends Name { } return this.name; } - + /** * Sets the name part of this qualified name to the given simple name. - * + * * @param name the identifier of this qualified name * @exception IllegalArgumentException if: * <ul> * <li>the node belongs to a different AST</li> * <li>the node already has a parent</li> * </ul> - */ + */ public void setName(SimpleName name) { if (name == null) { throw new IllegalArgumentException(); @@ -251,7 +251,7 @@ public class QualifiedName extends Name { this.name = name; postReplaceChild(oldChild, name, NAME_PROPERTY); } - + /* (omit javadoc for this method) * Method declared on Name. */ @@ -267,12 +267,12 @@ public class QualifiedName extends Name { int memSize() { return BASE_NAME_NODE_SIZE + 3 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int treeSize() { - return + return memSize() + (this.name == null ? 0 : getName().treeSize()) + (this.qualifier == null ? 0 : getQualifier().treeSize()); diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/QualifiedType.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/QualifiedType.java index 5dc5edaa7..136881578 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/QualifiedType.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/QualifiedType.java @@ -35,12 +35,12 @@ import java.util.List; * <code>SimpleType(QualifiedName(SimpleName("A"),SimpleName("B")))</code> * </li> * </ol> - * The first form is preferred when "A" is known to be a type. However, a + * The first form is preferred when "A" is known to be a type. However, a * parser cannot always determine this. Clients should be prepared to handle * either rather than make assumptions. (Note also that the first form * became possible as of JLS3; only the second form existed in JLS2 API.) * </p> - * + * * @since 3.1 * @noinstantiate This class is not intended to be instantiated by clients. */ @@ -49,26 +49,26 @@ public class QualifiedType extends Type { * This index represents the position inside a parameterized qualified type. */ int index; - + /** * The "qualifier" structural property of this node type. */ - public static final ChildPropertyDescriptor QUALIFIER_PROPERTY = + public static final ChildPropertyDescriptor QUALIFIER_PROPERTY = new ChildPropertyDescriptor(QualifiedType.class, "qualifier", Type.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ /** * The "name" structural property of this node type. */ - public static final ChildPropertyDescriptor NAME_PROPERTY = + public static final ChildPropertyDescriptor NAME_PROPERTY = new ChildPropertyDescriptor(QualifiedType.class, "name", SimpleName.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List propertyList = new ArrayList(3); createPropertyList(QualifiedType.class, propertyList); @@ -80,22 +80,22 @@ public class QualifiedType extends Type { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - - /** + + /** * The type node; lazily initialized; defaults to a type with * an unspecfied, but legal, simple name. */ private Type qualifier = null; - + /** * The name being qualified; lazily initialized; defaults to a unspecified, * legal Java identifier. @@ -108,7 +108,7 @@ public class QualifiedType extends Type { * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ QualifiedType(AST ast) { @@ -122,7 +122,7 @@ public class QualifiedType extends Type { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -146,7 +146,7 @@ public class QualifiedType extends Type { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -185,12 +185,12 @@ public class QualifiedType extends Type { } visitor.endVisit(this); } - + /** * Returns the qualifier of this qualified type. - * + * * @return the qualifier of this qualified type - */ + */ public Type getQualifier() { if (this.qualifier == null) { // lazy init must be thread-safe for readers @@ -204,17 +204,17 @@ public class QualifiedType extends Type { } return this.qualifier; } - + /** * Sets the qualifier of this qualified type to the given type. - * + * * @param type the new qualifier of this qualified type * @exception IllegalArgumentException if: * <ul> * <li>the node belongs to a different AST</li> * <li>the node already has a parent</li> * </ul> - */ + */ public void setQualifier(Type type) { if (type == null) { throw new IllegalArgumentException(); @@ -227,9 +227,9 @@ public class QualifiedType extends Type { /** * Returns the name part of this qualified type. - * - * @return the name being qualified - */ + * + * @return the name being qualified + */ public SimpleName getName() { if (this.name == null) { // lazy init must be thread-safe for readers @@ -243,17 +243,17 @@ public class QualifiedType extends Type { } return this.name; } - + /** * Sets the name part of this qualified type to the given simple name. - * + * * @param name the identifier of this qualified name * @exception IllegalArgumentException if: * <ul> * <li>the node belongs to a different AST</li> * <li>the node already has a parent</li> * </ul> - */ + */ public void setName(SimpleName name) { if (name == null) { throw new IllegalArgumentException(); @@ -263,7 +263,7 @@ public class QualifiedType extends Type { this.name = name; postReplaceChild(oldChild, name, NAME_PROPERTY); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -271,12 +271,12 @@ public class QualifiedType extends Type { // treat Code as free return BASE_NODE_SIZE + 3 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int treeSize() { - return + return memSize() + (this.qualifier == null ? 0 : getQualifier().treeSize()) + (this.name == null ? 0 : getName().treeSize()); diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/RecoveredTypeBinding.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/RecoveredTypeBinding.java index 3b40c3ed4..33fe02279 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/RecoveredTypeBinding.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/RecoveredTypeBinding.java @@ -105,14 +105,14 @@ class RecoveredTypeBinding implements ITypeBinding { public ITypeBinding getGenericTypeOfWildcardType() { return null; } - + /* (non-Javadoc) * @see org.eclipse.jdt.core.dom.ITypeBinding#getRank() */ public int getRank() { return -1; } - + /* (non-Javadoc) * @see org.eclipse.jdt.core.dom.ITypeBinding#getComponentType() */ @@ -281,7 +281,7 @@ class RecoveredTypeBinding implements ITypeBinding { buffer.append(CharOperation.toString(referenceBinding.compoundName)); buffer.append(brackets); return String.valueOf(buffer); - } else { + } else { return getName(); } } @@ -582,7 +582,7 @@ class RecoveredTypeBinding implements ITypeBinding { public String getOptimalName() { return this.getQualifiedName(); } -// SH} +// SH} /* (non-Javadoc) * @see org.eclipse.jdt.core.dom.IBinding#getAnnotations() @@ -757,7 +757,7 @@ class RecoveredTypeBinding implements ITypeBinding { return RoleTypeBinding.isRoleWithExplicitAnchor(this.binding); return DependentTypeBinding.isDependentType(this.binding); } - if ( this.currentType != null + if ( this.currentType != null && this.currentType.isParameterizedType()) return ((ParameterizedType)this.currentType).isDependentType(onlyRelevant); return false; @@ -775,12 +775,12 @@ class RecoveredTypeBinding implements ITypeBinding { } return new String[0]; } - + public IMethodMappingBinding[] getResolvedMethodMappings() { // copy of TypeBinding.getResolvedMethodMappings: List<IMethodMappingBinding> mappings = new ArrayList<IMethodMappingBinding>(); if (this.isRole()) { - org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding roleBinding + org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding roleBinding = (org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding)this.binding; if (roleBinding.callinCallouts != null) { for (CallinCalloutBinding mapping : roleBinding.callinCallouts) { diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ReturnStatement.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ReturnStatement.java index 66a01c19a..ec26455fc 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ReturnStatement.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ReturnStatement.java @@ -21,26 +21,26 @@ import java.util.List; * ReturnStatement: * <b>return</b> [ Expression ] <b>;</b> * </pre> - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ public class ReturnStatement extends Statement { - + /** * The "expression" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor EXPRESSION_PROPERTY = + public static final ChildPropertyDescriptor EXPRESSION_PROPERTY = new ChildPropertyDescriptor(ReturnStatement.class, "expression", Expression.class, OPTIONAL, CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List propertyList = new ArrayList(2); createPropertyList(ReturnStatement.class, propertyList); @@ -51,26 +51,26 @@ public class ReturnStatement extends Statement { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** * The expression; <code>null</code> for none; defaults to none. */ private Expression optionalExpression = null; - + /** - * Creates a new AST node for a return statement owned by the + * Creates a new AST node for a return statement owned by the * given AST. By default, the statement has no expression. - * + * * @param ast the AST that is to own this node */ ReturnStatement(AST ast) { @@ -83,7 +83,7 @@ public class ReturnStatement extends Statement { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -99,7 +99,7 @@ public class ReturnStatement extends Statement { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -137,21 +137,21 @@ public class ReturnStatement extends Statement { } visitor.endVisit(this); } - + /** - * Returns the expression of this return statement, or + * Returns the expression of this return statement, or * <code>null</code> if there is none. - * + * * @return the expression node, or <code>null</code> if there is none - */ + */ public Expression getExpression() { return this.optionalExpression; } - + /** * Sets or clears the expression of this return statement. - * - * @param expression the expression node, or <code>null</code> if + * + * @param expression the expression node, or <code>null</code> if * there is none * @exception IllegalArgumentException if: * <ul> @@ -159,21 +159,21 @@ public class ReturnStatement extends Statement { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setExpression(Expression expression) { ASTNode oldChild = this.optionalExpression; preReplaceChild(oldChild, expression, EXPRESSION_PROPERTY); this.optionalExpression = expression; postReplaceChild(oldChild, expression, EXPRESSION_PROPERTY); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int memSize() { return super.memSize() + 1 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/RoleTypeDeclaration.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/RoleTypeDeclaration.java index 7d574b228..15351f435 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/RoleTypeDeclaration.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/RoleTypeDeclaration.java @@ -5,7 +5,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * $Id$ - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. * * Contributors: @@ -24,10 +24,10 @@ import java.util.List; * NEW for OTDT, built in analogy to TypeDeclaration (its superclass) * * - * Represents the DOM-ASTNode for a SubType of TypeDeclaration. This node represents a role in a - * compilation unit (a "role file"). - * - * Contained AST elements: + * Represents the DOM-ASTNode for a SubType of TypeDeclaration. This node represents a role in a + * compilation unit (a "role file"). + * + * Contained AST elements: * RoleTypeDeclaration is a Subtyp of TypeDeclaration, so it contains all properties and methods from * TypeDeclaration, like e.g. TEAM-PROPERTY and getRoles()-Method. This is mandatory, because a role can also * be a team see <a href="#codeexample1">CodeExample1</a>.<br> @@ -37,14 +37,14 @@ import java.util.List; * <dt>2. TeamProperty <dd> Team, which includes this Role -> TypeDeclaration * <dt>3. CallinProperty <dd> a list of all callins which exist inside a role -> List * <dt>4. CalloutProperty <dd> a list of all callouts which exist inside a role -> List - * </dl> - * - * + * </dl> + * + * * Locations in source code: - * This node is used in BodyDeclaration. - * - * TODO(ike): javadoc is not completed yet... - * + * This node is used in BodyDeclaration. + * + * TODO(ike): javadoc is not completed yet... + * * <a name="codeexample1">CodeExample1</a> * <pre> * public team MyTeam1 { @@ -60,7 +60,7 @@ public class RoleTypeDeclaration extends TypeDeclaration { * The "javadoc" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor JAVADOC_PROPERTY = + public static final ChildPropertyDescriptor JAVADOC_PROPERTY = internalJavadocPropertyFactory(RoleTypeDeclaration.class); /** @@ -68,39 +68,39 @@ public class RoleTypeDeclaration extends TypeDeclaration { * @since 3.0 * @deprecated Replaced by {@link #MODIFIERS2_PROPERTY} in the JLS3 API. */ - public static final SimplePropertyDescriptor MODIFIERS_PROPERTY = + public static final SimplePropertyDescriptor MODIFIERS_PROPERTY = internalModifiersPropertyFactory(RoleTypeDeclaration.class); - + /** * The "modifiers" structural property of this node type (added in JLS3 API). * @since 3.0 */ - public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = + public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = internalModifiers2PropertyFactory(RoleTypeDeclaration.class); /** * The "interface" structural property of this node type. * @since 3.0 */ - public static final SimplePropertyDescriptor INTERFACE_PROPERTY = + public static final SimplePropertyDescriptor INTERFACE_PROPERTY = new SimplePropertyDescriptor(RoleTypeDeclaration.class, "interface", boolean.class, MANDATORY); //$NON-NLS-1$ /** * The "team" structural property of this node type. */ - public static final SimplePropertyDescriptor TEAM_PROPERTY = + public static final SimplePropertyDescriptor TEAM_PROPERTY = new SimplePropertyDescriptor(RoleTypeDeclaration.class, "team", boolean.class, MANDATORY); //$NON-NLS-1$ /** * The "role" structural property of this node type. */ - public static final SimplePropertyDescriptor ROLE_PROPERTY = + public static final SimplePropertyDescriptor ROLE_PROPERTY = new SimplePropertyDescriptor(RoleTypeDeclaration.class, "role", boolean.class, MANDATORY); //$NON-NLS-1$ /** * The "rolefile" structural property of this node type. */ - public static final SimplePropertyDescriptor ROLE_FILE_PROPERTY = + public static final SimplePropertyDescriptor ROLE_FILE_PROPERTY = new SimplePropertyDescriptor(RoleTypeDeclaration.class, "rolefile", boolean.class, MANDATORY); //$NON-NLS-1$ /** @@ -108,14 +108,14 @@ public class RoleTypeDeclaration extends TypeDeclaration { * @since 3.0 * @deprecated Replaced by {@link #BASECLASS_TYPE_PROPERTY} in the JLS3 API. */ - public static final ChildPropertyDescriptor BASECLASS_PROPERTY = + public static final ChildPropertyDescriptor BASECLASS_PROPERTY = new ChildPropertyDescriptor(RoleTypeDeclaration.class, "baseClass", Name.class, OPTIONAL, NO_CYCLE_RISK); //$NON-NLS-1$ - + /** * The "baseClassType" structural property of this node type (added in JLS3 API). * @since 3.0 */ - public static final ChildPropertyDescriptor BASECLASS_TYPE_PROPERTY = + public static final ChildPropertyDescriptor BASECLASS_TYPE_PROPERTY = new ChildPropertyDescriptor(RoleTypeDeclaration.class, "baseClassType", Type.class, OPTIONAL, NO_CYCLE_RISK); //$NON-NLS-1$ /** @@ -123,21 +123,21 @@ public class RoleTypeDeclaration extends TypeDeclaration { * @since 3.0 * @deprecated Replaced by {@link #TEAMCLASS_TYPE_PROPERTY} in the JLS3 API. */ - public static final ChildPropertyDescriptor TEAMCLASS_PROPERTY = + public static final ChildPropertyDescriptor TEAMCLASS_PROPERTY = new ChildPropertyDescriptor(RoleTypeDeclaration.class, "teamClass", Name.class, OPTIONAL, NO_CYCLE_RISK); //$NON-NLS-1$ - + /** * The "baseClassType" structural property of this node type (added in JLS3 API). * @since 3.0 */ - public static final ChildPropertyDescriptor TEAMCLASS_TYPE_PROPERTY = + public static final ChildPropertyDescriptor TEAMCLASS_TYPE_PROPERTY = new ChildPropertyDescriptor(RoleTypeDeclaration.class, "teamClassType", Type.class, OPTIONAL, NO_CYCLE_RISK); //$NON-NLS-1$ - + /** * The "name" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor NAME_PROPERTY = + public static final ChildPropertyDescriptor NAME_PROPERTY = new ChildPropertyDescriptor(RoleTypeDeclaration.class, "name", SimpleName.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ /** @@ -145,7 +145,7 @@ public class RoleTypeDeclaration extends TypeDeclaration { * @since 3.0 * @deprecated Replaced by {@link #SUPERCLASS_TYPE_PROPERTY} in the JLS3 API. */ - public static final ChildPropertyDescriptor SUPERCLASS_PROPERTY = + public static final ChildPropertyDescriptor SUPERCLASS_PROPERTY = new ChildPropertyDescriptor(RoleTypeDeclaration.class, "superclass", Name.class, OPTIONAL, NO_CYCLE_RISK); //$NON-NLS-1$ /** @@ -153,44 +153,44 @@ public class RoleTypeDeclaration extends TypeDeclaration { * @since 3.0 * @deprecated Replaced by {@link #SUPER_INTERFACE_TYPES_PROPERTY} in the JLS3 API. */ - public static final ChildListPropertyDescriptor SUPER_INTERFACES_PROPERTY = + public static final ChildListPropertyDescriptor SUPER_INTERFACES_PROPERTY = new ChildListPropertyDescriptor(RoleTypeDeclaration.class, "superInterfaces", Name.class, NO_CYCLE_RISK); //$NON-NLS-1$ /** * The "superclassType" structural property of this node type (added in JLS3 API). * @since 3.0 */ - public static final ChildPropertyDescriptor SUPERCLASS_TYPE_PROPERTY = + public static final ChildPropertyDescriptor SUPERCLASS_TYPE_PROPERTY = new ChildPropertyDescriptor(RoleTypeDeclaration.class, "superclassType", Type.class, OPTIONAL, NO_CYCLE_RISK); //$NON-NLS-1$ /** * The "superInterfaceTypes" structural property of this node type (added in JLS3 API). * @since 3.0 */ - public static final ChildListPropertyDescriptor SUPER_INTERFACE_TYPES_PROPERTY = + public static final ChildListPropertyDescriptor SUPER_INTERFACE_TYPES_PROPERTY = new ChildListPropertyDescriptor(RoleTypeDeclaration.class, "superInterfaceTypes", Type.class, NO_CYCLE_RISK); //$NON-NLS-1$ - + /** * The "typeParameters" structural property of this node type (added in JLS3 API). * @since 3.0 */ - public static final ChildListPropertyDescriptor TYPE_PARAMETERS_PROPERTY = + public static final ChildListPropertyDescriptor TYPE_PARAMETERS_PROPERTY = new ChildListPropertyDescriptor(RoleTypeDeclaration.class, "typeParameters", TypeParameter.class, NO_CYCLE_RISK); //$NON-NLS-1$ - + /** * The "guardPredicate" structural property of this node type (added in JLS3 API). * @since 0.9.25 */ - public static final ChildPropertyDescriptor GUARD_PROPERTY = + public static final ChildPropertyDescriptor GUARD_PROPERTY = new ChildPropertyDescriptor(RoleTypeDeclaration.class, "guardPredicate", GuardPredicateDeclaration.class, OPTIONAL, NO_CYCLE_RISK); //$NON-NLS-1$ /** * The "bodyDeclarations" structural property of this node type (added in JLS3 API). * @since 3.0 */ - public static final ChildListPropertyDescriptor BODY_DECLARATIONS_PROPERTY = + public static final ChildListPropertyDescriptor BODY_DECLARATIONS_PROPERTY = internalBodyDeclarationPropertyFactory(RoleTypeDeclaration.class); - + /** * The "precedence" structural property. * @since 0.9.24 @@ -198,18 +198,18 @@ public class RoleTypeDeclaration extends TypeDeclaration { public static final ChildListPropertyDescriptor PRECEDENCE_PROPERTY = new ChildListPropertyDescriptor(RoleTypeDeclaration.class, "precedence", Name.class, NO_CYCLE_RISK); //$NON-NLS-1$ - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. * @since 3.0 */ @SuppressWarnings("rawtypes") private static final List PROPERTY_DESCRIPTORS_2_0; - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. * @since 3.0 @@ -218,7 +218,7 @@ public class RoleTypeDeclaration extends TypeDeclaration { private static final List PROPERTY_DESCRIPTORS_3_0; - + static { List<StructuralPropertyDescriptor> propertyList = new ArrayList<StructuralPropertyDescriptor>(14); createPropertyList(RoleTypeDeclaration.class, propertyList); @@ -236,7 +236,7 @@ public class RoleTypeDeclaration extends TypeDeclaration { addProperty(BODY_DECLARATIONS_PROPERTY, propertyList); addProperty(PRECEDENCE_PROPERTY, propertyList); PROPERTY_DESCRIPTORS_2_0 = reapPropertyList(propertyList); - + propertyList = new ArrayList<StructuralPropertyDescriptor>(16); createPropertyList(RoleTypeDeclaration.class, propertyList); addProperty(JAVADOC_PROPERTY, propertyList); @@ -260,11 +260,11 @@ public class RoleTypeDeclaration extends TypeDeclaration { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ @@ -287,7 +287,7 @@ public class RoleTypeDeclaration extends TypeDeclaration { * interface declarations. Not used in 3.0. */ private Name optionalBaseClassName = null; - + /** * The optional baseClass type; <code>null</code> if none. * Defaults to none. Note that this field is not used for @@ -295,7 +295,7 @@ public class RoleTypeDeclaration extends TypeDeclaration { * @since 3.0 */ private Type optionalBaseClassType = null; - + private Name teamClassName = null; private Type teamClassType = null; @@ -305,17 +305,17 @@ public class RoleTypeDeclaration extends TypeDeclaration { private boolean isRoleFile = false; /** - * Creates a new AST node for a type declaration owned by the given + * Creates a new AST node for a type declaration owned by the given * AST. By default, the type declaration is for a class of an - * unspecified, but legal, name; no modifiers; no javadoc; + * unspecified, but legal, name; no modifiers; no javadoc; * no type parameters; no superclass or superinterfaces; and an empty list * of body declarations. * <p> - * N.B. This constructor is package-private; all subclasses must be - * declared in the same package; clients are unable to declare + * N.B. This constructor is package-private; all subclasses must be + * declared in the same package; clients are unable to declare * additional subclasses. * </p> - * + * * @param ast the AST that is to own this node */ RoleTypeDeclaration(AST ast) { @@ -337,14 +337,14 @@ public class RoleTypeDeclaration extends TypeDeclaration { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); - } - + } + /* (omit javadoc for this method) * Method declared on ASTNode. */ - final int internalGetSetIntProperty(SimplePropertyDescriptor property, boolean get, int value) + final int internalGetSetIntProperty(SimplePropertyDescriptor property, boolean get, int value) { - if (property == MODIFIERS_PROPERTY) + if (property == MODIFIERS_PROPERTY) { if (get) { return getModifiers(); @@ -372,9 +372,9 @@ public class RoleTypeDeclaration extends TypeDeclaration { { setInterface(value); return false; - } + } } - + if (property == TEAM_PROPERTY) { if (get) @@ -397,7 +397,7 @@ public class RoleTypeDeclaration extends TypeDeclaration { { setRole(value); return false; - } + } } if (property == ROLE_FILE_PROPERTY) { @@ -409,19 +409,19 @@ public class RoleTypeDeclaration extends TypeDeclaration { { setRoleFile(value); return false; - } + } } // allow default implementation to flag the error return super.internalGetSetBooleanProperty(property, get, value); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @Override - final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) + final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) { - if (property == JAVADOC_PROPERTY) + if (property == JAVADOC_PROPERTY) { if (get) { return getJavadoc(); @@ -480,7 +480,7 @@ public class RoleTypeDeclaration extends TypeDeclaration { return null; } } - + if (property == TEAMCLASS_PROPERTY) { if (get) @@ -521,31 +521,31 @@ public class RoleTypeDeclaration extends TypeDeclaration { { return modifiers(); } - + if (property == TYPE_PARAMETERS_PROPERTY) { return typeParameters(); } - + if (property == SUPER_INTERFACES_PROPERTY) { return superInterfaces(); } - + if (property == SUPER_INTERFACE_TYPES_PROPERTY) { return superInterfaceTypes(); } - + if (property == BODY_DECLARATIONS_PROPERTY) { return bodyDeclarations(); } - + // allow default implementation to flag the error return super.internalGetChildListProperty(property); } - + /* (omit javadoc for this method) * Method declared on BodyDeclaration. */ @@ -585,7 +585,7 @@ public class RoleTypeDeclaration extends TypeDeclaration { { return BODY_DECLARATIONS_PROPERTY; } - + ChildPropertyDescriptor internalGuardPredicateProperty() { return GUARD_PROPERTY; } @@ -622,7 +622,7 @@ public class RoleTypeDeclaration extends TypeDeclaration { result.setBaseClass( (Name) ASTNode.copySubtree(target, getBaseClass())); - + result.setTeamClass( (Name) ASTNode.copySubtree(target, getTeamClass())); } @@ -639,10 +639,10 @@ public class RoleTypeDeclaration extends TypeDeclaration { (Type) ASTNode.copySubtree(target, getSuperclassType())); result.superInterfaceTypes().addAll( ASTNode.copySubtrees(target, superInterfaceTypes())); - + result.setBaseClassType( (Type) ASTNode.copySubtree(target, getBaseClassType())); - + result.setTeamClassType( (Type) ASTNode.copySubtree(target, getTeamClassType())); } @@ -661,7 +661,7 @@ public class RoleTypeDeclaration extends TypeDeclaration { // dispatch to correct overloaded match method return matcher.match(this, other); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -696,10 +696,10 @@ public class RoleTypeDeclaration extends TypeDeclaration { /** * Sets wether this type declaration declares a team class or a class. - * + * * @param isTeam <code>true</code> if this is a team class * declaration, and <code>false</code> if this is a class declaration - */ + */ public void setTeam(boolean isTeam) { preValueChange(TEAM_PROPERTY); @@ -709,10 +709,10 @@ public class RoleTypeDeclaration extends TypeDeclaration { /** * Sets whether this type declaration declares a role class or a class. - * + * * @param isRole <code>true</code> if this is a role class * declaration, and <code>false</code> if this is a class declaration - */ + */ public void setRole(boolean isRole) { preValueChange(ROLE_PROPERTY); @@ -722,32 +722,32 @@ public class RoleTypeDeclaration extends TypeDeclaration { /** * Sets whether this type declaration resides in a role file. - */ + */ public void setRoleFile(boolean isRoleFile) { preValueChange(ROLE_FILE_PROPERTY); this.isRoleFile = isRoleFile; postValueChange(ROLE_FILE_PROPERTY); } - - /** + + /** * Answer whether this role is a role file. */ public boolean isRoleFile() { return this.isRoleFile; } - + /** @deprecated replaced by {@link #getBaseClassType()} in JLS3. */ public Name getBaseClass() { supportedOnlyIn2(); return this.optionalBaseClassName; } - + public Type getBaseClassType() { unsupportedIn2(); - return this.optionalBaseClassType; + return this.optionalBaseClassType; } /** @deprecated replaced by {@link #getTeamClassType()} in JLS3. */ @@ -755,14 +755,14 @@ public class RoleTypeDeclaration extends TypeDeclaration { { supportedOnlyIn2(); return this.teamClassName; - } - + } + public Type getTeamClassType() { unsupportedIn2(); - return this.teamClassType; + return this.teamClassType; } - + /** @deprecated use {@link #setBaseClassType(Type)} (JLS3) */ public void setBaseClass(Name baseClassName) { @@ -770,7 +770,7 @@ public class RoleTypeDeclaration extends TypeDeclaration { ASTNode oldChild = this.optionalBaseClassName; preReplaceChild(oldChild, baseClassName, BASECLASS_PROPERTY); this.optionalBaseClassName = baseClassName; - postReplaceChild(oldChild, baseClassName, BASECLASS_PROPERTY); + postReplaceChild(oldChild, baseClassName, BASECLASS_PROPERTY); } public void setBaseClassType(Type baseClassType) @@ -780,8 +780,8 @@ public class RoleTypeDeclaration extends TypeDeclaration { preReplaceChild(oldChild, baseClassType, BASECLASS_TYPE_PROPERTY); this.optionalBaseClassType = baseClassType; postReplaceChild(oldChild, baseClassType, BASECLASS_TYPE_PROPERTY); - } - + } + /** @deprecated use {@link #setTeamClassType(Type)} (JLS3) */ public void setTeamClass(Name teamClassName) { @@ -789,7 +789,7 @@ public class RoleTypeDeclaration extends TypeDeclaration { ASTNode oldChild = this.teamClassName; preReplaceChild(oldChild, teamClassName, TEAMCLASS_PROPERTY); this.teamClassName = teamClassName; - postReplaceChild(oldChild, teamClassName, TEAMCLASS_PROPERTY); + postReplaceChild(oldChild, teamClassName, TEAMCLASS_PROPERTY); } public void setTeamClassType(Type teamClassType) @@ -800,17 +800,17 @@ public class RoleTypeDeclaration extends TypeDeclaration { this.teamClassType = teamClassType; postReplaceChild(oldChild, teamClassType, TEAMCLASS_TYPE_PROPERTY); } - + /** * Returns the name of the superclass declared in this type * declaration, or <code>null</code> if there is none (JLS2 API only). * <p> - * Note that this child is not relevant for interface + * Note that this child is not relevant for interface * declarations (although it does still figure in subtree * equality comparisons). * </p> - * - * @return the superclass name node, or <code>null</code> if + * + * @return the superclass name node, or <code>null</code> if * there is none * @exception UnsupportedOperationException if this operation is used in * an AST later than JLS2 @@ -825,17 +825,17 @@ public class RoleTypeDeclaration extends TypeDeclaration { * Returns the superclass declared in this type * declaration, or <code>null</code> if there is none (added in JLS3 API). * <p> - * Note that this child is not relevant for interface + * Note that this child is not relevant for interface * declarations (although it does still figure in subtree * equality comparisons). * </p> - * - * @return the superclass type node, or <code>null</code> if + * + * @return the superclass type node, or <code>null</code> if * there is none * @exception UnsupportedOperationException if this operation is used in * a JLS2 AST * @since 3.0 - */ + */ public Type getSuperclassType() { unsupportedIn2(); return this.optionalSuperclassType; @@ -845,12 +845,12 @@ public class RoleTypeDeclaration extends TypeDeclaration { * Sets or clears the name of the superclass declared in this type * declaration (JLS2 API only). * <p> - * Note that this child is not relevant for interface + * Note that this child is not relevant for interface * declarations (although it does still figure in subtree * equality comparisons). * </p> - * - * @param superclassName the superclass name node, or <code>null</code> if + * + * @param superclassName the superclass name node, or <code>null</code> if * there is none * @exception IllegalArgumentException if: * <ul> @@ -876,8 +876,8 @@ public class RoleTypeDeclaration extends TypeDeclaration { * Note that this child is not relevant for interface declarations * (although it does still figure in subtree equality comparisons). * </p> - * - * @param superclassType the superclass type node, or <code>null</code> if + * + * @param superclassType the superclass type node, or <code>null</code> if * there is none * @exception IllegalArgumentException if: * <ul> @@ -887,7 +887,7 @@ public class RoleTypeDeclaration extends TypeDeclaration { * @exception UnsupportedOperationException if this operation is used in * a JLS2 AST * @since 3.0 - */ + */ public void setSuperclassType(Type superclassType) { unsupportedIn2(); ASTNode oldChild = this.optionalSuperclassType; @@ -897,16 +897,16 @@ public class RoleTypeDeclaration extends TypeDeclaration { } /** - * Returns the ordered list of callout declarations of this type + * Returns the ordered list of callout declarations of this type * declaration. * <p> * This convenience method returns this node's body declarations * with non-methods filtered out. Unlike <code>bodyDeclarations</code>, * this method does not return a live result. * </p> - * + * * @return the (possibly empty) list of role type declarations - */ + */ @SuppressWarnings("rawtypes") public CalloutMappingDeclaration[] getCallOuts() { @@ -933,16 +933,16 @@ public class RoleTypeDeclaration extends TypeDeclaration { } /** - * Returns the ordered list of CallIn declarations of this type + * Returns the ordered list of CallIn declarations of this type * declaration. * <p> * This convenience method returns this node's body declarations * with non-methods filtered out. Unlike <code>bodyDeclarations</code>, * this method does not return a live result. * </p> - * + * * @return the (possibly empty) list of role type declarations - */ + */ @SuppressWarnings("rawtypes") public CallinMappingDeclaration[] getCallIns() { @@ -967,35 +967,35 @@ public class RoleTypeDeclaration extends TypeDeclaration { } return callIns; } - - - - - + + + + + /* (omit javadoc for this method) * Method declared on ASTNode. */ @SuppressWarnings({ "nls", "rawtypes" }) void appendDebugString(StringBuffer buffer) { - buffer.append("RoleTypeDeclaration[\n"); - buffer.append("class "); + buffer.append("RoleTypeDeclaration[\n"); + buffer.append("class "); buffer.append(getName().getIdentifier()); - buffer.append("\n"); + buffer.append("\n"); if (this.optionalGuardPredicate != null) { getGuardPredicate().appendDebugString(buffer); - buffer.append("\n"); + buffer.append("\n"); } for (Iterator it = bodyDeclarations().iterator(); it.hasNext();) { BodyDeclaration d = (BodyDeclaration) it.next(); d.appendDebugString(buffer); if (it.hasNext()) { - buffer.append(";\n"); + buffer.append(";\n"); } } buffer.append("]"); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -1003,7 +1003,7 @@ public class RoleTypeDeclaration extends TypeDeclaration { { return super.memSize() + 12 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SimpleName.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SimpleName.java index 42cd9a155..a52f69c2a 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SimpleName.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SimpleName.java @@ -28,7 +28,7 @@ import org.eclipse.jdt.internal.compiler.parser.TerminalTokens; * SimpleName: * Identifier * </pre> - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ @@ -36,65 +36,65 @@ public class SimpleName extends Name { /** * The "identifier" structural property of this node type. - * + * * @since 3.0 */ - public static final SimplePropertyDescriptor IDENTIFIER_PROPERTY = + public static final SimplePropertyDescriptor IDENTIFIER_PROPERTY = new SimplePropertyDescriptor(SimpleName.class, "identifier", String.class, MANDATORY); //$NON-NLS-1$ - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. * @since 3.0 */ private static final List PROPERTY_DESCRIPTORS; - + static { List propertyList = new ArrayList(2); createPropertyList(SimpleName.class, propertyList); addProperty(IDENTIFIER_PROPERTY, propertyList); PROPERTY_DESCRIPTORS = reapPropertyList(propertyList); } - + /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the AST.JLS* constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** * An unspecified (but externally observable) legal Java identifier. */ private static final String MISSING_IDENTIFIER = "MISSING";//$NON-NLS-1$ - + /** * The identifier; defaults to a unspecified, legal Java identifier. */ private String identifier = MISSING_IDENTIFIER; - + /** * Creates a new AST node for a simple name owned by the given AST. * The new node has an unspecified, legal Java identifier. * <p> - * N.B. This constructor is package-private; all subclasses must be - * declared in the same package; clients are unable to declare + * N.B. This constructor is package-private; all subclasses must be + * declared in the same package; clients are unable to declare * additional subclasses. * </p> - * + * * @param ast the AST that is to own this node */ SimpleName(AST ast) { super(ast); } - + /* (omit javadoc for this method) * Method declared on ASTNode. * @since 3.0 @@ -102,7 +102,7 @@ public class SimpleName extends Name { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -135,7 +135,7 @@ public class SimpleName extends Name { result.setIdentifier(getIdentifier()); return result; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -154,13 +154,13 @@ public class SimpleName extends Name { /** * Returns this node's identifier. - * + * * @return the identifier of this node - */ + */ public String getIdentifier() { return this.identifier; } - + /** * Sets the identifier of this node to the given value. * The identifier should be legal according to the rules @@ -170,10 +170,10 @@ public class SimpleName extends Name { * Note that the list of keywords may depend on the version of the * language (determined when the AST object was created). * </p> - * + * * @param identifier the identifier of this node * @exception IllegalArgumentException if the identifier is invalid - */ + */ public void setIdentifier(String identifier) { // update internalSetIdentifier if this is changed if (identifier == null) { @@ -193,7 +193,7 @@ public class SimpleName extends Name { case TerminalTokens.TokenNamethis: // like in: T.this.anchor.Type tokenType = TerminalTokens.TokenNameIdentifier; } -//SH} +//SH} if (tokenType != TerminalTokens.TokenNameIdentifier) { throw new IllegalArgumentException(); } @@ -217,7 +217,7 @@ public class SimpleName extends Name { this.identifier = ident; postValueChange(IDENTIFIER_PROPERTY); } - + /** * Returns whether this simple name represents a name that is being defined, * as opposed to one being referenced. The following positions are considered @@ -243,10 +243,10 @@ public class SimpleName extends Name { * this node appears in the declaration position relative to its parent. * It always returns <code>false</code> if this node is unparented. * </p> - * - * @return <code>true</code> if this node declares a name, and + * + * @return <code>true</code> if this node declares a name, and * <code>false</code> otherwise - */ + */ public boolean isDeclaration() { StructuralPropertyDescriptor d = getLocationInParent(); if (d == null) { @@ -285,7 +285,7 @@ public class SimpleName extends Name { } return false; } - + /* (omit javadoc for this method) * Method declared on Name. */ @@ -304,7 +304,7 @@ public class SimpleName extends Name { } return size; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SimplePropertyDescriptor.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SimplePropertyDescriptor.java index e30c3019e..b9038b181 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SimplePropertyDescriptor.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SimplePropertyDescriptor.java @@ -16,32 +16,32 @@ package org.eclipse.jdt.core.dom; * primitive type (such as <code>int</code> or <code>boolean</code>) * or some simple value type (such as <code>String</code> or * <code>InfixExpression.Operator</code>). - * + * * @see org.eclipse.jdt.core.dom.ASTNode#getStructuralProperty(StructuralPropertyDescriptor) * @see org.eclipse.jdt.core.dom.ASTNode#setStructuralProperty(StructuralPropertyDescriptor, Object) * @since 3.0 * @noinstantiate This class is not intended to be instantiated by clients. */ public final class SimplePropertyDescriptor extends StructuralPropertyDescriptor { - + /** * Value type. For example, for a node type like * SingleVariableDeclaration, the modifiers property is int.class */ private final Class valueType; - + /** * Indicates whether a value is mandatory. A property value is allowed * to be <code>null</code> only if it is not mandatory. */ - private final boolean mandatory; - + private final boolean mandatory; + /** * Creates a new simple property descriptor with the given property id. * Note that this constructor is declared package-private so that * property descriptors can only be created by the AST * implementation. - * + * * @param nodeClass concrete AST node type that owns this property * @param propertyId the property id * @param valueType the value type of this property @@ -56,24 +56,24 @@ public final class SimplePropertyDescriptor extends StructuralPropertyDescriptor this.valueType = valueType; this.mandatory = mandatory; } - + /** * Returns the value type of this property. * <p> * For example, for a node type like SingleVariableDeclaration, * the "modifiers" property returns <code>int.class</code>. * </p> - * + * * @return the value type of the property */ public Class getValueType() { return this.valueType; } - + /** * Returns whether this property is mandatory. A property value * is not allowed to be <code>null</code> if it is mandatory. - * + * * @return <code>true</code> if the property is mandatory, * and <code>false</code> if it is may be <code>null</code> */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SimpleType.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SimpleType.java index 2050281bc..6dc099ab9 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SimpleType.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SimpleType.java @@ -20,26 +20,26 @@ import java.util.List; * This kind of node is used to convert a name (<code>Name</code>) into a type * (<code>Type</code>) by wrapping it. * </p> - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ public class SimpleType extends Type { - + /** * The "name" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor NAME_PROPERTY = + public static final ChildPropertyDescriptor NAME_PROPERTY = new ChildPropertyDescriptor(SimpleType.class, "name", Name.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List propertyList = new ArrayList(2); createPropertyList(SimpleType.class, propertyList); @@ -50,30 +50,30 @@ public class SimpleType extends Type { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - - /** + + /** * The type name node; lazily initialized; defaults to a type with * an unspecfied, but legal, name. */ private Name typeName = null; - + /** * Creates a new unparented node for a simple type owned by the given AST. * By default, an unspecified, but legal, name. * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ SimpleType(AST ast) { @@ -86,7 +86,7 @@ public class SimpleType extends Type { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -102,7 +102,7 @@ public class SimpleType extends Type { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -138,12 +138,12 @@ public class SimpleType extends Type { } visitor.endVisit(this); } - + /** * Returns the name of this simple type. - * + * * @return the name of this simple type - */ + */ public Name getName() { if (this.typeName == null) { // lazy init must be thread-safe for readers @@ -157,17 +157,17 @@ public class SimpleType extends Type { } return this.typeName; } - + /** * Sets the name of this simple type to the given name. - * + * * @param typeName the new name of this simple type * @exception IllegalArgumentException if: * <ul> * <li>the node belongs to a different AST</li> * <li>the node already has a parent</li> * </ul> - */ + */ public void setName(Name typeName) { if (typeName == null) { throw new IllegalArgumentException(); @@ -185,12 +185,12 @@ public class SimpleType extends Type { // treat Code as free return BASE_NODE_SIZE + 1 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int treeSize() { - return + return memSize() + (this.typeName == null ? 0 : getName().treeSize()); } diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SingleMemberAnnotation.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SingleMemberAnnotation.java index a6ed58525..edb2b4b8e 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SingleMemberAnnotation.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SingleMemberAnnotation.java @@ -14,8 +14,8 @@ import java.util.ArrayList; import java.util.List; /** - * Single member annotation node (added in JLS3 API). The single member annotation - * "@foo(bar)" is equivalent to the normal annotation "@foo(value=bar)". + * Single member annotation node (added in JLS3 API). The single member annotation + * "@foo(bar)" is equivalent to the normal annotation "@foo(value=bar)". * <p> * <pre> * SingleMemberAnnotation: @@ -24,31 +24,31 @@ import java.util.List; * Within annotations, only certain kinds of expressions are meaningful, * including other annotations. * </p> - * + * * @since 3.1 * @noinstantiate This class is not intended to be instantiated by clients. */ public final class SingleMemberAnnotation extends Annotation { - + /** * The "typeName" structural property of this node type. */ - public static final ChildPropertyDescriptor TYPE_NAME_PROPERTY = + public static final ChildPropertyDescriptor TYPE_NAME_PROPERTY = internalTypeNamePropertyFactory(SingleMemberAnnotation.class); /** * The "value" structural property of this node type. */ - public static final ChildPropertyDescriptor VALUE_PROPERTY = + public static final ChildPropertyDescriptor VALUE_PROPERTY = new ChildPropertyDescriptor(SingleMemberAnnotation.class, "value", Expression.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List propertyList = new ArrayList(3); createPropertyList(SingleMemberAnnotation.class, propertyList); @@ -56,19 +56,19 @@ public final class SingleMemberAnnotation extends Annotation { addProperty(VALUE_PROPERTY, propertyList); PROPERTY_DESCRIPTORS = reapPropertyList(propertyList); } - + /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the AST.JLS* constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** * The value; lazily initialized; defaults to a unspecified, but legal, * expression. @@ -76,13 +76,13 @@ public final class SingleMemberAnnotation extends Annotation { private Expression value = null; /** - * Creates a new unparented normal annotation node owned + * Creates a new unparented normal annotation node owned * by the given AST. By default, the annotation has an * unspecified type name and an unspecified value. * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ SingleMemberAnnotation(AST ast) { @@ -96,7 +96,7 @@ public final class SingleMemberAnnotation extends Annotation { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -120,7 +120,7 @@ public final class SingleMemberAnnotation extends Annotation { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on BodyDeclaration. */ @@ -145,7 +145,7 @@ public final class SingleMemberAnnotation extends Annotation { result.setValue((Expression) ASTNode.copySubtree(target, getValue())); return result; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -153,7 +153,7 @@ public final class SingleMemberAnnotation extends Annotation { // dispatch to correct overloaded match method return matcher.match(this, other); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -166,12 +166,12 @@ public final class SingleMemberAnnotation extends Annotation { } visitor.endVisit(this); } - + /** * Returns the value of this annotation. - * + * * @return the value node - */ + */ public Expression getValue() { if (this.value == null) { // lazy init must be thread-safe for readers @@ -185,10 +185,10 @@ public final class SingleMemberAnnotation extends Annotation { } return this.value; } - + /** * Sets the value of this annotation. - * + * * @param value the new value * @exception IllegalArgumentException if: * <ul> @@ -196,7 +196,7 @@ public final class SingleMemberAnnotation extends Annotation { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setValue(Expression value) { if (value == null) { throw new IllegalArgumentException(); @@ -213,7 +213,7 @@ public final class SingleMemberAnnotation extends Annotation { int memSize() { return super.memSize() + 1 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SingleVariableDeclaration.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SingleVariableDeclaration.java index 3cf671763..c2b7519cb 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SingleVariableDeclaration.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SingleVariableDeclaration.java @@ -32,77 +32,77 @@ import java.util.List; * SingleVariableDeclaration: * { ExtendedModifier } Type [ <b>...</b> ] Identifier { <b>[</b><b>]</b> } [ <b>=</b> Expression ] * </pre> - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ public class SingleVariableDeclaration extends VariableDeclaration { - + /** * The "modifiers" structural property of this node type (JLS2 API only). * @since 3.0 */ - public static final SimplePropertyDescriptor MODIFIERS_PROPERTY = + public static final SimplePropertyDescriptor MODIFIERS_PROPERTY = new SimplePropertyDescriptor(SingleVariableDeclaration.class, "modifiers", int.class, MANDATORY); //$NON-NLS-1$ - + /** * The "modifiers" structural property of this node type (added in JLS3 API). * @since 3.1 */ - public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = + public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = new ChildListPropertyDescriptor(SingleVariableDeclaration.class, "modifiers", IExtendedModifier.class, CYCLE_RISK); //$NON-NLS-1$ - + /** * The "name" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor NAME_PROPERTY = + public static final ChildPropertyDescriptor NAME_PROPERTY = new ChildPropertyDescriptor(SingleVariableDeclaration.class, "name", SimpleName.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ /** * The "type" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor TYPE_PROPERTY = + public static final ChildPropertyDescriptor TYPE_PROPERTY = new ChildPropertyDescriptor(SingleVariableDeclaration.class, "type", Type.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ /** * The "varargs" structural property of this node type (added in JLS3 API). * @since 3.1 */ - public static final SimplePropertyDescriptor VARARGS_PROPERTY = + public static final SimplePropertyDescriptor VARARGS_PROPERTY = new SimplePropertyDescriptor(SingleVariableDeclaration.class, "varargs", boolean.class, MANDATORY); //$NON-NLS-1$ - + /** * The "extraDimensions" structural property of this node type. * @since 3.0 */ - public static final SimplePropertyDescriptor EXTRA_DIMENSIONS_PROPERTY = + public static final SimplePropertyDescriptor EXTRA_DIMENSIONS_PROPERTY = new SimplePropertyDescriptor(SingleVariableDeclaration.class, "extraDimensions", int.class, MANDATORY); //$NON-NLS-1$ - + /** * The "initializer" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor INITIALIZER_PROPERTY = + public static final ChildPropertyDescriptor INITIALIZER_PROPERTY = new ChildPropertyDescriptor(SingleVariableDeclaration.class, "initializer", Expression.class, OPTIONAL, CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. * @since 3.0 */ private static final List PROPERTY_DESCRIPTORS_2_0; - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. * @since 3.1 */ private static final List PROPERTY_DESCRIPTORS_3_0; - + static { List propertyList = new ArrayList(6); createPropertyList(SingleVariableDeclaration.class, propertyList); @@ -112,7 +112,7 @@ public class SingleVariableDeclaration extends VariableDeclaration { addProperty(EXTRA_DIMENSIONS_PROPERTY, propertyList); addProperty(INITIALIZER_PROPERTY, propertyList); PROPERTY_DESCRIPTORS_2_0 = reapPropertyList(propertyList); - + propertyList = new ArrayList(7); createPropertyList(SingleVariableDeclaration.class, propertyList); addProperty(MODIFIERS2_PROPERTY, propertyList); @@ -127,10 +127,10 @@ public class SingleVariableDeclaration extends VariableDeclaration { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ @@ -141,22 +141,22 @@ public class SingleVariableDeclaration extends VariableDeclaration { return PROPERTY_DESCRIPTORS_3_0; } } - + /** - * The extended modifiers (element type: <code>IExtendedModifier</code>). + * The extended modifiers (element type: <code>IExtendedModifier</code>). * Null in JLS2. Added in JLS3; defaults to an empty list * (see constructor). - * + * * @since 3.1 */ private ASTNode.NodeList modifiers = null; - + /** * The modifiers; bit-wise or of Modifier flags. * Defaults to none. Not used in 3.0. */ private int modifierFlags = Modifier.NONE; - + /** * The variable name; lazily initialized; defaults to a unspecified, * legal Java identifier. @@ -172,7 +172,7 @@ public class SingleVariableDeclaration extends VariableDeclaration { /** * Indicates the last parameter of a variable arity method; * defaults to false. - * + * * @since 3.1 */ private boolean variableArity = false; @@ -180,7 +180,7 @@ public class SingleVariableDeclaration extends VariableDeclaration { /** * The number of extra array dimensions that appear after the variable; * defaults to 0. - * + * * @since 2.1 */ private int extraArrayDimensions = 0; @@ -192,14 +192,14 @@ public class SingleVariableDeclaration extends VariableDeclaration { private Expression optionalInitializer = null; /** - * Creates a new AST node for a variable declaration owned by the given - * AST. By default, the variable declaration has: no modifiers, an - * unspecified (but legal) type, an unspecified (but legal) variable name, + * Creates a new AST node for a variable declaration owned by the given + * AST. By default, the variable declaration has: no modifiers, an + * unspecified (but legal) type, an unspecified (but legal) variable name, * 0 dimensions after the variable; no initializer; not variable arity. * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ SingleVariableDeclaration(AST ast) { @@ -239,7 +239,7 @@ public class SingleVariableDeclaration extends VariableDeclaration { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -263,7 +263,7 @@ public class SingleVariableDeclaration extends VariableDeclaration { // allow default implementation to flag the error return super.internalGetSetIntProperty(property, get, value); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -279,7 +279,7 @@ public class SingleVariableDeclaration extends VariableDeclaration { // allow default implementation to flag the error return super.internalGetSetBooleanProperty(property, get, value); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -311,7 +311,7 @@ public class SingleVariableDeclaration extends VariableDeclaration { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -322,7 +322,7 @@ public class SingleVariableDeclaration extends VariableDeclaration { // allow default implementation to flag the error return super.internalGetChildListProperty(property); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -357,7 +357,7 @@ public class SingleVariableDeclaration extends VariableDeclaration { // dispatch to correct overloaded match method return matcher.match(this, other); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -374,7 +374,7 @@ public class SingleVariableDeclaration extends VariableDeclaration { } visitor.endVisit(this); } - + /** * Returns the live ordered list of modifiers and annotations * of this declaration (added in JLS3 API). @@ -382,13 +382,13 @@ public class SingleVariableDeclaration extends VariableDeclaration { * Note that the final modifier is the only meaningful modifier for local * variable and formal parameter declarations. * </p> - * + * * @return the live list of modifiers and annotations * (element type: <code>IExtendedModifier</code>) * @exception UnsupportedOperationException if this operation is used in * a JLS2 AST * @since 3.1 - */ + */ public List modifiers() { // more efficient than just calling unsupportedIn2() to check if (this.modifiers == null) { @@ -396,17 +396,17 @@ public class SingleVariableDeclaration extends VariableDeclaration { } return this.modifiers; } - + /** * Returns the modifiers explicitly specified on this declaration. * <p> * In the JLS3 API, this method is a convenience method that * computes these flags from <code>modifiers()</code>. * </p> - * + * * @return the bit-wise or of <code>Modifier</code> constants * @see Modifier - */ + */ public int getModifiers() { // more efficient than checking getAST().API_LEVEL if (this.modifiers == null) { @@ -434,14 +434,14 @@ public class SingleVariableDeclaration extends VariableDeclaration { * static, final, volatile, and transient. For local variable and formal * parameter declarations, the only meaningful modifier is final. * </p> - * + * * @param modifiers the given modifiers (bit-wise or of <code>Modifier</code> constants) * @exception UnsupportedOperationException if this operation is used in * an AST later than JLS2 * @see Modifier - * @deprecated In the JLS3 API, this method is replaced by + * @deprecated In the JLS3 API, this method is replaced by * {@link #modifiers()} which contains a list of a <code>Modifier</code> nodes. - */ + */ public void setModifiers(int modifiers) { internalSetModifiers(modifiers); } @@ -460,7 +460,7 @@ public class SingleVariableDeclaration extends VariableDeclaration { /* (omit javadoc for this method) * Method declared on VariableDeclaration. - */ + */ public SimpleName getName() { if (this.variableName == null) { // lazy init must be thread-safe for readers @@ -474,10 +474,10 @@ public class SingleVariableDeclaration extends VariableDeclaration { } return this.variableName; } - + /* (omit javadoc for this method) * Method declared on VariableDeclaration. - */ + */ public void setName(SimpleName variableName) { if (variableName == null) { throw new IllegalArgumentException(); @@ -491,9 +491,9 @@ public class SingleVariableDeclaration extends VariableDeclaration { /** * Returns the type of the variable declared in this variable declaration, * exclusive of any extra array dimensions. - * + * * @return the type - */ + */ public Type getType() { if (this.type == null) { // lazy init must be thread-safe for readers @@ -509,16 +509,16 @@ public class SingleVariableDeclaration extends VariableDeclaration { } /** - * Sets the type of the variable declared in this variable declaration to + * Sets the type of the variable declared in this variable declaration to * the given type, exclusive of any extra array dimensions. - * + * * @param type the new type * @exception IllegalArgumentException if: * <ul> * <li>the node belongs to a different AST</li> * <li>the node already has a parent</li> * </ul> - */ + */ public void setType(Type type) { if (type == null) { throw new IllegalArgumentException(); @@ -534,20 +534,20 @@ public class SingleVariableDeclaration extends VariableDeclaration { * a variable arity method (added in JLS3 API). * <p> * Note that the binding for the type <code>Foo</code>in the vararg method - * declaration <code>void fun(Foo... args)</code> is always for the type as + * declaration <code>void fun(Foo... args)</code> is always for the type as * written; i.e., the type binding for <code>Foo</code>. However, if you * navigate from the method declaration to its method binding to the * type binding for its last parameter, the type binding for the vararg * parameter is always an array type (i.e., <code>Foo[]</code>) reflecting * the way vararg methods get compiled. * </p> - * + * * @return <code>true</code> if this is a variable arity parameter declaration, * and <code>false</code> otherwise * @exception UnsupportedOperationException if this operation is used in * a JLS2 AST * @since 3.1 - */ + */ public boolean isVarargs() { // more efficient than just calling unsupportedIn2() to check if (this.modifiers == null) { @@ -555,15 +555,15 @@ public class SingleVariableDeclaration extends VariableDeclaration { } return this.variableArity; } - + /** * Sets whether this declaration declares the last parameter of * a variable arity method (added in JLS3 API). - * + * * @param variableArity <code>true</code> if this is a variable arity * parameter declaration, and <code>false</code> otherwise * @since 3.1 - */ + */ public void setVarargs(boolean variableArity) { // more efficient than just calling unsupportedIn2() to check if (this.modifiers == null) { @@ -577,7 +577,7 @@ public class SingleVariableDeclaration extends VariableDeclaration { /* (omit javadoc for this method) * Method declared on VariableDeclaration. * @since 2.1 - */ + */ public int getExtraDimensions() { return this.extraArrayDimensions; } @@ -585,7 +585,7 @@ public class SingleVariableDeclaration extends VariableDeclaration { /* (omit javadoc for this method) * Method declared on VariableDeclaration. * @since 2.1 - */ + */ public void setExtraDimensions(int dimensions) { if (dimensions < 0) { throw new IllegalArgumentException(); @@ -597,16 +597,16 @@ public class SingleVariableDeclaration extends VariableDeclaration { /* (omit javadoc for this method) * Method declared on VariableDeclaration. - */ + */ public Expression getInitializer() { return this.optionalInitializer; } - + /* (omit javadoc for this method) * Method declared on VariableDeclaration. - */ + */ public void setInitializer(Expression initializer) { - // a SingleVariableDeclaration may occur inside an Expression + // a SingleVariableDeclaration may occur inside an Expression // must check cycles ASTNode oldChild = this.optionalInitializer; preReplaceChild(oldChild, initializer,INITIALIZER_PROPERTY); @@ -621,12 +621,12 @@ public class SingleVariableDeclaration extends VariableDeclaration { // treat Operator as free return BASE_NODE_SIZE + 7 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int treeSize() { - return + return memSize() + (this.modifiers == null ? 0 : this.modifiers.listSize()) + (this.type == null ? 0 : getType().treeSize()) diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Statement.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Statement.java index 31fff4779..84d426b5c 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Statement.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Statement.java @@ -70,31 +70,31 @@ import org.eclipse.jdt.internal.compiler.parser.TerminalTokens; * SuperConstructorInvocation * </pre> * </p> - * + * * @since 2.0 */ public abstract class Statement extends ASTNode { - + /** * The leading comment, or <code>null</code> if none. * Defaults to none. - * + * * @deprecated The leading comment feature was removed in 2.1. */ private String optionalLeadingComment = null; - + /** * Creates a new AST node for a statement owned by the given AST. * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ Statement(AST ast) { super(ast); } - + /** * Returns the leading comment string, including the starting * and ending comment delimiters, and any embedded line breaks. @@ -106,7 +106,7 @@ public abstract class Statement extends ASTNode { * must end with a line delimiter (as per JLS 3.7), and must not contain * line breaks. * </p> - * + * * @return the comment string, or <code>null</code> if none * @deprecated This feature was removed in the 2.1 release because it was * only a partial, and inadequate, solution to the issue of associating @@ -146,7 +146,7 @@ public abstract class Statement extends ASTNode { * </pre> * </code> * </p> - * + * * @param comment the comment string, or <code>null</code> if none * @exception IllegalArgumentException if the comment string is invalid * @deprecated This feature was removed in the 2.1 release because it was @@ -191,14 +191,14 @@ public abstract class Statement extends ASTNode { /** * Copies the leading comment from the given statement. - * + * * @param source the statement that supplies the leading comment * @since 2.1 */ void copyLeadingComment(Statement source) { setLeadingComment(source.getLeadingComment()); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -206,5 +206,5 @@ public abstract class Statement extends ASTNode { int size = BASE_NODE_SIZE + 1 * 4 + stringSize(getLeadingComment()); return size; } -} +} diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/StringLiteral.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/StringLiteral.java index 26f55872e..f2e34c0ac 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/StringLiteral.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/StringLiteral.java @@ -20,7 +20,7 @@ import org.eclipse.jdt.internal.compiler.parser.TerminalTokens; /** * String literal nodes. - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ @@ -30,16 +30,16 @@ public class StringLiteral extends Expression { * The "escapedValue" structural property of this node type. * @since 3.0 */ - public static final SimplePropertyDescriptor ESCAPED_VALUE_PROPERTY = + public static final SimplePropertyDescriptor ESCAPED_VALUE_PROPERTY = new SimplePropertyDescriptor(StringLiteral.class, "escapedValue", String.class, MANDATORY); //$NON-NLS-1$ - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List propertyList = new ArrayList(2); createPropertyList(StringLiteral.class, propertyList); @@ -50,20 +50,20 @@ public class StringLiteral extends Expression { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** - * The literal string, including quotes and escapes; defaults to the + * The literal string, including quotes and escapes; defaults to the * literal for the empty string. */ private String escapedValue = "\"\"";//$NON-NLS-1$ @@ -74,7 +74,7 @@ public class StringLiteral extends Expression { * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ StringLiteral(AST ast) { @@ -87,7 +87,7 @@ public class StringLiteral extends Expression { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -103,7 +103,7 @@ public class StringLiteral extends Expression { // allow default implementation to flag the error return super.internalGetSetObjectProperty(property, get, value); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -136,20 +136,20 @@ public class StringLiteral extends Expression { visitor.visit(this); visitor.endVisit(this); } - + /** * Returns the string value of this literal node to the given string * literal token. The token is the sequence of characters that would appear * in the source program, including enclosing double quotes and embedded * escapes. - * + * * @return the string literal token, including enclosing double * quotes and embedded escapes - */ + */ public String getEscapedValue() { return this.escapedValue; } - + /** * Sets the string value of this literal node to the given string literal * token. The token is the sequence of characters that would appear in the @@ -160,11 +160,11 @@ public class StringLiteral extends Expression { * <li><code>"hello world"</code> <code>setLiteral("\"hello world\"")</code></li> * <li><code>"boo\nhoo"</code> <code>setLiteral("\"boo\\nhoo\"")</code></li> * </ul> - * + * * @param token the string literal token, including enclosing double * quotes and embedded escapes * @exception IllegalArgumentException if the argument is incorrect - */ + */ public void setEscapedValue(String token) { // update internalSetEscapedValue(String) if this is changed if (token == null) { @@ -200,7 +200,7 @@ public class StringLiteral extends Expression { } /** - * Returns the value of this literal node. + * Returns the value of this literal node. * <p> * For example, * <pre> @@ -210,21 +210,21 @@ public class StringLiteral extends Expression { * </pre> * </p> * <p> - * Note that this is a convenience method that converts from the stored + * Note that this is a convenience method that converts from the stored * string literal token returned by <code>getEscapedLiteral</code>. * </p> - * + * * @return the string value without enclosing double quotes and embedded * escapes * @exception IllegalArgumentException if the literal value cannot be converted - */ + */ public String getLiteralValue() { String s = getEscapedValue(); int len = s.length(); if (len < 2 || s.charAt(0) != '\"' || s.charAt(len-1) != '\"' ) { throw new IllegalArgumentException(); } - + Scanner scanner = this.ast.scanner; char[] source = s.toCharArray(); scanner.setSource(source); @@ -243,7 +243,7 @@ public class StringLiteral extends Expression { } /** - * Sets the value of this literal node. + * Sets the value of this literal node. * <p> * For example, * <pre> @@ -254,11 +254,11 @@ public class StringLiteral extends Expression { * </pre> * </p> * <p> - * Note that this is a convenience method that converts to the stored + * Note that this is a convenience method that converts to the stored * string literal token acceptable to <code>setEscapedLiteral</code>. * </p> - * - * @param value the string value without enclosing double quotes and + * + * @param value the string value without enclosing double quotes and * embedded escapes * @exception IllegalArgumentException if the argument is incorrect */ @@ -268,7 +268,7 @@ public class StringLiteral extends Expression { } int len = value.length(); StringBuffer b = new StringBuffer(len + 2); - + b.append("\""); // opening delimiter //$NON-NLS-1$ for (int i = 0; i < len; i++) { char c = value.charAt(i); @@ -320,7 +320,7 @@ public class StringLiteral extends Expression { break; case '\7' : b.append("\\7"); //$NON-NLS-1$ - break; + break; default: b.append(c); } @@ -335,7 +335,7 @@ public class StringLiteral extends Expression { int size = BASE_NODE_SIZE + 1 * 4 + stringSize(this.escapedValue); return size; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/StructuralPropertyDescriptor.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/StructuralPropertyDescriptor.java index ddd178af3..f036de4c1 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/StructuralPropertyDescriptor.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/StructuralPropertyDescriptor.java @@ -25,29 +25,29 @@ package org.eclipse.jdt.core.dom; * - properties where the value is a list of AST nodes; * for example, the statements of a {@link Block}</li> * </ul> - * + * * @since 3.0 * @noextend This class is not intended to be subclassed by clients. */ public abstract class StructuralPropertyDescriptor { - + /** * Property id. */ private final String propertyId; - + /** * The concrete AST node type that owns this property. */ private final Class nodeClass; - + /** * Creates a new property descriptor for the given node type * with the given property id. * Note that this constructor is declared package-private so that * property descriptors can only be created by the AST * implementation. - * + * * @param nodeClass concrete AST node type that owns this property * @param propertyId the property id */ @@ -58,59 +58,59 @@ public abstract class StructuralPropertyDescriptor { this.propertyId = propertyId; this.nodeClass = nodeClass; } - + /** * Returns the id of this property. - * + * * @return the property id */ public final String getId() { return this.propertyId; } - + /** * Returns the AST node type that owns this property. * <p> * For example, for all properties of the node type * TypeDeclaration, this method returns <code>TypeDeclaration.class</code>. * </p> - * + * * @return the node type that owns this property */ public final Class getNodeClass() { return this.nodeClass; } - + /** * Returns whether this property is a simple property * (instance of {@link SimplePropertyDescriptor}. - * - * @return <code>true</code> if this is a simple property, and + * + * @return <code>true</code> if this is a simple property, and * <code>false</code> otherwise */ public final boolean isSimpleProperty(){ return (this instanceof SimplePropertyDescriptor); } - + /** * Returns whether this property is a child property * (instance of {@link ChildPropertyDescriptor}. - * - * @return <code>true</code> if this is a child property, and + * + * @return <code>true</code> if this is a child property, and * <code>false</code> otherwise */ public final boolean isChildProperty() { return (this instanceof ChildPropertyDescriptor); } - + /** * Returns whether this property is a child list property * (instance of {@link ChildListPropertyDescriptor}. - * - * @return <code>true</code> if this is a child list property, and + * + * @return <code>true</code> if this is a child list property, and * <code>false</code> otherwise */ - public final boolean isChildListProperty() { + public final boolean isChildListProperty() { return (this instanceof ChildListPropertyDescriptor); } diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SuperConstructorInvocation.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SuperConstructorInvocation.java index 415798dff..8da893813 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SuperConstructorInvocation.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SuperConstructorInvocation.java @@ -28,56 +28,56 @@ import java.util.List; * [ <b><</b> Type { <b>,</b> Type } <b>></b> ] * <b>super</b> <b>(</b> [ Expression { <b>,</b> Expression } ] <b>)</b> <b>;</b> * </pre> - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ public class SuperConstructorInvocation extends Statement { - + /** * The "expression" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor EXPRESSION_PROPERTY = + public static final ChildPropertyDescriptor EXPRESSION_PROPERTY = new ChildPropertyDescriptor(SuperConstructorInvocation.class, "expression", Expression.class, OPTIONAL, CYCLE_RISK); //$NON-NLS-1$ /** * The "typeArguments" structural property of this node type (added in JLS3 API). * @since 3.1 */ - public static final ChildListPropertyDescriptor TYPE_ARGUMENTS_PROPERTY = + public static final ChildListPropertyDescriptor TYPE_ARGUMENTS_PROPERTY = new ChildListPropertyDescriptor(SuperConstructorInvocation.class, "typeArguments", Type.class, NO_CYCLE_RISK); //$NON-NLS-1$ - + /** * The "arguments" structural property of this node type. * @since 3.0 */ - public static final ChildListPropertyDescriptor ARGUMENTS_PROPERTY = + public static final ChildListPropertyDescriptor ARGUMENTS_PROPERTY = new ChildListPropertyDescriptor(SuperConstructorInvocation.class, "arguments", Expression.class, CYCLE_RISK); //$NON-NLS-1$ - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. * @since 3.0 */ private static final List PROPERTY_DESCRIPTORS_2_0; - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. * @since 3.1 */ private static final List PROPERTY_DESCRIPTORS_3_0; - + static { List propertyList = new ArrayList(3); createPropertyList(SuperConstructorInvocation.class, propertyList); addProperty(EXPRESSION_PROPERTY, propertyList); addProperty(ARGUMENTS_PROPERTY, propertyList); PROPERTY_DESCRIPTORS_2_0 = reapPropertyList(propertyList); - + propertyList = new ArrayList(4); createPropertyList(SuperConstructorInvocation.class, propertyList); addProperty(EXPRESSION_PROPERTY, propertyList); @@ -89,11 +89,11 @@ public class SuperConstructorInvocation extends Statement { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ @@ -104,14 +104,14 @@ public class SuperConstructorInvocation extends Statement { return PROPERTY_DESCRIPTORS_3_0; } } - + /** * The expression; <code>null</code> for none; defaults to none. */ private Expression optionalExpression = null; - + /** - * The type arguments (element type: <code>Type</code>). + * The type arguments (element type: <code>Type</code>). * Null in JLS2. Added in JLS3; defaults to an empty list * (see constructor). * @since 3.1 @@ -119,7 +119,7 @@ public class SuperConstructorInvocation extends Statement { private ASTNode.NodeList typeArguments = null; /** - * The list of argument expressions (element type: + * The list of argument expressions (element type: * <code>Expression</code>). Defaults to an empty list. */ private ASTNode.NodeList arguments = @@ -129,11 +129,11 @@ public class SuperConstructorInvocation extends Statement { * Creates a new AST node for an super constructor invocation statement * owned by the given AST. By default, no type arguments, and an empty list * of arguments. - * + * * @param ast the AST that is to own this node */ SuperConstructorInvocation(AST ast) { - super(ast); + super(ast); if (ast.apiLevel >= AST.JLS3) { this.typeArguments = new ASTNode.NodeList(TYPE_ARGUMENTS_PROPERTY); } @@ -145,7 +145,7 @@ public class SuperConstructorInvocation extends Statement { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -161,7 +161,7 @@ public class SuperConstructorInvocation extends Statement { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -222,22 +222,22 @@ public class SuperConstructorInvocation extends Statement { } visitor.endVisit(this); } - + /** * Returns the expression of this super constructor invocation statement, * or <code>null</code> if there is none. - * + * * @return the expression node, or <code>null</code> if there is none - */ + */ public Expression getExpression() { return this.optionalExpression; } - + /** * Sets or clears the expression of this super constructor invocation * statement. - * - * @param expression the expression node, or <code>null</code> if + * + * @param expression the expression node, or <code>null</code> if * there is none * @exception IllegalArgumentException if: * <ul> @@ -245,7 +245,7 @@ public class SuperConstructorInvocation extends Statement { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setExpression(Expression expression) { ASTNode oldChild = this.optionalExpression; preReplaceChild(oldChild, expression, EXPRESSION_PROPERTY); @@ -256,13 +256,13 @@ public class SuperConstructorInvocation extends Statement { /** * Returns the live ordered list of type arguments of this constructor * invocation (added in JLS3 API). - * + * * @return the live list of type arguments * (element type: <code>Type</code>) * @exception UnsupportedOperationException if this operation is used in * a JLS2 AST * @since 3.1 - */ + */ public List typeArguments() { // more efficient than just calling unsupportedIn2() to check if (this.typeArguments == null) { @@ -270,14 +270,14 @@ public class SuperConstructorInvocation extends Statement { } return this.typeArguments; } - + /** * Returns the live ordered list of argument expressions in this super * constructor invocation statement. - * - * @return the live list of argument expressions + * + * @return the live list of argument expressions * (element type: <code>Expression</code>) - */ + */ public List arguments() { return this.arguments; } @@ -289,10 +289,10 @@ public class SuperConstructorInvocation extends Statement { * Note that bindings are generally unavailable unless requested when the * AST is being built. * </p> - * + * * @return the constructor binding, or <code>null</code> if the binding * cannot be resolved - */ + */ public IMethodBinding resolveConstructorBinding() { return this.ast.getBindingResolver().resolveConstructor(this); } @@ -304,7 +304,7 @@ public class SuperConstructorInvocation extends Statement { // treat Code as free return BASE_NODE_SIZE + 3 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SuperFieldAccess.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SuperFieldAccess.java index a20c01fab..317270357 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SuperFieldAccess.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SuperFieldAccess.java @@ -21,12 +21,12 @@ import java.util.List; * SuperFieldAccess: * [ ClassName <b>.</b> ] <b>super</b> <b>.</b> Identifier * </pre> - * + * * <p> * See <code>FieldAccess</code> for guidelines on handling other expressions * that resemble qualified names. * </p> - * + * * @see FieldAccess * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. @@ -37,23 +37,23 @@ public class SuperFieldAccess extends Expression { * The "qualifier" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor QUALIFIER_PROPERTY = + public static final ChildPropertyDescriptor QUALIFIER_PROPERTY = new ChildPropertyDescriptor(SuperFieldAccess.class, "qualifier", Name.class, OPTIONAL, NO_CYCLE_RISK); //$NON-NLS-1$ /** * The "name" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor NAME_PROPERTY = + public static final ChildPropertyDescriptor NAME_PROPERTY = new ChildPropertyDescriptor(SuperFieldAccess.class, "name", SimpleName.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List propertyList = new ArrayList(3); createPropertyList(SuperFieldAccess.class, propertyList); @@ -65,17 +65,17 @@ public class SuperFieldAccess extends Expression { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** * The optional qualifier; <code>null</code> for none; defaults to none. */ @@ -89,12 +89,12 @@ public class SuperFieldAccess extends Expression { /** * Creates a new unparented node for a super field access expression owned - * by the given AST. By default, field name is an unspecified, but legal, + * by the given AST. By default, field name is an unspecified, but legal, * name, and there is no qualifier. * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ SuperFieldAccess(AST ast) { @@ -107,7 +107,7 @@ public class SuperFieldAccess extends Expression { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -131,7 +131,7 @@ public class SuperFieldAccess extends Expression { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -170,28 +170,28 @@ public class SuperFieldAccess extends Expression { } visitor.endVisit(this); } - + /** - * Returns the qualifier of this "super" field access expression, or + * Returns the qualifier of this "super" field access expression, or * <code>null</code> if there is none. - * + * * @return the qualifier name node, or <code>null</code> if there is none - */ + */ public Name getQualifier() { return this.optionalQualifier; } - + /** * Sets or clears the qualifier of this "super" field access expression. - * - * @param name the qualifier name node, or <code>null</code> if + * + * @param name the qualifier name node, or <code>null</code> if * there is none * @exception IllegalArgumentException if: * <ul> * <li>the node belongs to a different AST</li> * <li>the node already has a parent</li> * </ul> - */ + */ public void setQualifier(Name name) { ASTNode oldChild = this.optionalQualifier; preReplaceChild(oldChild, name, QUALIFIER_PROPERTY); @@ -200,11 +200,11 @@ public class SuperFieldAccess extends Expression { } /** - * Returns the name of the field accessed in this "super" field access + * Returns the name of the field accessed in this "super" field access * expression. - * + * * @return the field name - */ + */ public SimpleName getName() { if (this.fieldName == null) { // lazy init must be thread-safe for readers @@ -234,18 +234,18 @@ public class SuperFieldAccess extends Expression { public IVariableBinding resolveFieldBinding() { return this.ast.getBindingResolver().resolveField(this); } - + /** - * Sets the name of the field accessed in this "super" field access + * Sets the name of the field accessed in this "super" field access * expression. - * + * * @param fieldName the field name * @exception IllegalArgumentException if: * <ul> * <li>the node belongs to a different AST</li> * <li>the node already has a parent</li> * </ul> - */ + */ public void setName(SimpleName fieldName) { if (fieldName == null) { throw new IllegalArgumentException(); @@ -263,12 +263,12 @@ public class SuperFieldAccess extends Expression { // treat Code as free return BASE_NODE_SIZE + 2 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int treeSize() { - return + return memSize() + (this.optionalQualifier == null ? 0 : getQualifier().treeSize()) + (this.fieldName == null ? 0 : getName().treeSize()); diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SwitchCase.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SwitchCase.java index b28fbe85c..db72dbb28 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SwitchCase.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SwitchCase.java @@ -24,26 +24,26 @@ import java.util.List; * <b>default</b> <b>:</b> * </pre> * </p> - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ public class SwitchCase extends Statement { - + /** * The "expression" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor EXPRESSION_PROPERTY = + public static final ChildPropertyDescriptor EXPRESSION_PROPERTY = new ChildPropertyDescriptor(SwitchCase.class, "expression", Expression.class, OPTIONAL, CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List propertyList = new ArrayList(2); createPropertyList(SwitchCase.class, propertyList); @@ -54,17 +54,17 @@ public class SwitchCase extends Statement { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** * The expression; <code>null</code> for none; lazily initialized (but * does <b>not</b> default to none). @@ -76,11 +76,11 @@ public class SwitchCase extends Statement { * Indicates whether <code>optionalExpression</code> has been initialized. */ private boolean expressionInitialized = false; - + /** - * Creates a new AST node for a switch case pseudo-statement owned by the + * Creates a new AST node for a switch case pseudo-statement owned by the * given AST. By default, there is an unspecified, but legal, expression. - * + * * @param ast the AST that is to own this node */ SwitchCase(AST ast) { @@ -93,7 +93,7 @@ public class SwitchCase extends Statement { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -109,7 +109,7 @@ public class SwitchCase extends Statement { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -147,13 +147,13 @@ public class SwitchCase extends Statement { } visitor.endVisit(this); } - + /** - * Returns the expression of this switch case, or + * Returns the expression of this switch case, or * <code>null</code> if there is none (the "default:" case). - * + * * @return the expression node, or <code>null</code> if there is none - */ + */ public Expression getExpression() { if (!this.expressionInitialized) { // lazy init must be thread-safe for readers @@ -168,12 +168,12 @@ public class SwitchCase extends Statement { } return this.optionalExpression; } - + /** * Sets the expression of this switch case, or clears it (turns it into * the "default:" case). - * - * @param expression the expression node, or <code>null</code> to + * + * @param expression the expression node, or <code>null</code> to * turn it into the "default:" case * @exception IllegalArgumentException if: * <ul> @@ -181,7 +181,7 @@ public class SwitchCase extends Statement { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setExpression(Expression expression) { ASTNode oldChild = this.optionalExpression; preReplaceChild(oldChild, expression, EXPRESSION_PROPERTY); @@ -196,21 +196,21 @@ public class SwitchCase extends Statement { * This convenience method is equivalent to * <code>getExpression() == null</code>. * </p> - * + * * @return <code>true</code> if this is the default switch case, and * <code>false</code> if this is a non-default switch case - */ + */ public boolean isDefault() { return getExpression() == null; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int memSize() { return super.memSize() + 2 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SwitchStatement.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SwitchStatement.java index f8c51a596..e597dc7d5 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SwitchStatement.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SwitchStatement.java @@ -19,7 +19,7 @@ import java.util.List; * <p> * <pre> * SwitchStatement: - * <b>switch</b> <b>(</b> Expression <b>)</b> + * <b>switch</b> <b>(</b> Expression <b>)</b> * <b>{</b> { SwitchCase | Statement } } <b>}</b> * SwitchCase: * <b>case</b> Expression <b>:</b> @@ -28,33 +28,33 @@ import java.util.List; * <code>SwitchCase</code> nodes are treated as a kind of * <code>Statement</code>. * </p> - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ public class SwitchStatement extends Statement { - + /** * The "expression" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor EXPRESSION_PROPERTY = + public static final ChildPropertyDescriptor EXPRESSION_PROPERTY = new ChildPropertyDescriptor(SwitchStatement.class, "expression", Expression.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ /** * The "statements" structural property of this node type. * @since 3.0 */ - public static final ChildListPropertyDescriptor STATEMENTS_PROPERTY = + public static final ChildListPropertyDescriptor STATEMENTS_PROPERTY = new ChildListPropertyDescriptor(SwitchStatement.class, "statements", Statement.class, CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List propertyList = new ArrayList(3); createPropertyList(SwitchStatement.class, propertyList); @@ -66,17 +66,17 @@ public class SwitchStatement extends Statement { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** * The expression; lazily initialized; defaults to a unspecified, but legal, * expression. @@ -90,15 +90,15 @@ public class SwitchStatement extends Statement { */ private ASTNode.NodeList statements = new ASTNode.NodeList(STATEMENTS_PROPERTY); - + /** - * Creates a new unparented switch statement node owned by the given + * Creates a new unparented switch statement node owned by the given * AST. By default, the swicth statement has an unspecified, but legal, * expression, and an empty list of switch groups. * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ SwitchStatement(AST ast) { @@ -111,7 +111,7 @@ public class SwitchStatement extends Statement { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -127,7 +127,7 @@ public class SwitchStatement extends Statement { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -138,7 +138,7 @@ public class SwitchStatement extends Statement { // allow default implementation to flag the error return super.internalGetChildListProperty(property); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -178,12 +178,12 @@ public class SwitchStatement extends Statement { } visitor.endVisit(this); } - + /** * Returns the expression of this switch statement. - * + * * @return the expression node - */ + */ public Expression getExpression() { if (this.expression == null) { // lazy init must be thread-safe for readers @@ -197,10 +197,10 @@ public class SwitchStatement extends Statement { } return this.expression; } - + /** * Sets the expression of this switch statement. - * + * * @param expression the new expression node * @exception IllegalArgumentException if: * <ul> @@ -208,7 +208,7 @@ public class SwitchStatement extends Statement { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setExpression(Expression expression) { if (expression == null) { throw new IllegalArgumentException(); @@ -218,26 +218,26 @@ public class SwitchStatement extends Statement { this.expression = expression; postReplaceChild(oldChild, expression, EXPRESSION_PROPERTY); } - + /** * Returns the live ordered list of statements for this switch statement. - * Within this list, <code>SwitchCase</code> nodes mark the start of + * Within this list, <code>SwitchCase</code> nodes mark the start of * the switch groups. - * + * * @return the live list of statement nodes * (element type: <code>Statement</code>) - */ + */ public List statements() { return this.statements; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int memSize() { return super.memSize() + 2 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SynchronizedStatement.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SynchronizedStatement.java index 4fbf63f40..8e0acdc6e 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SynchronizedStatement.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/SynchronizedStatement.java @@ -21,7 +21,7 @@ import java.util.List; * SynchronizedStatement: * <b>synchronized</b> <b>(</b> Expression <b>)</b> Block * </pre> - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ @@ -31,23 +31,23 @@ public class SynchronizedStatement extends Statement { * The "expression" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor EXPRESSION_PROPERTY = + public static final ChildPropertyDescriptor EXPRESSION_PROPERTY = new ChildPropertyDescriptor(SynchronizedStatement.class, "expression", Expression.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ /** * The "body" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor BODY_PROPERTY = + public static final ChildPropertyDescriptor BODY_PROPERTY = new ChildPropertyDescriptor(SynchronizedStatement.class, "body", Block.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List propertyList = new ArrayList(3); createPropertyList(SynchronizedStatement.class, propertyList); @@ -59,20 +59,20 @@ public class SynchronizedStatement extends Statement { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** - * The expression; lazily initialized; defaults to an unspecified, but + * The expression; lazily initialized; defaults to an unspecified, but * legal, expression. */ private Expression expression = null; @@ -83,13 +83,13 @@ public class SynchronizedStatement extends Statement { private Block body = null; /** - * Creates a new unparented synchronized statement node owned by the given + * Creates a new unparented synchronized statement node owned by the given * AST. By default, the expression is unspecified, but legal, and the * blody is an empty block. * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ SynchronizedStatement(AST ast) { @@ -102,7 +102,7 @@ public class SynchronizedStatement extends Statement { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -126,7 +126,7 @@ public class SynchronizedStatement extends Statement { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -166,12 +166,12 @@ public class SynchronizedStatement extends Statement { } visitor.endVisit(this); } - + /** * Returns the expression of this synchronized statement. - * + * * @return the expression node - */ + */ public Expression getExpression() { if (this.expression == null) { // lazy init must be thread-safe for readers @@ -185,10 +185,10 @@ public class SynchronizedStatement extends Statement { } return this.expression; } - + /** * Sets the expression of this synchronized statement. - * + * * @param expression the expression node * @exception IllegalArgumentException if: * <ul> @@ -196,7 +196,7 @@ public class SynchronizedStatement extends Statement { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setExpression(Expression expression) { if (expression == null) { throw new IllegalArgumentException(); @@ -209,9 +209,9 @@ public class SynchronizedStatement extends Statement { /** * Returns the body of this synchronized statement. - * + * * @return the body block node - */ + */ public Block getBody() { if (this.body == null) { // lazy init must be thread-safe for readers @@ -225,10 +225,10 @@ public class SynchronizedStatement extends Statement { } return this.body; } - + /** * Sets the body of this synchronized statement. - * + * * @param block the body statement node * @exception IllegalArgumentException if: * <ul> @@ -236,7 +236,7 @@ public class SynchronizedStatement extends Statement { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setBody(Block block) { if (block == null) { throw new IllegalArgumentException(); @@ -246,14 +246,14 @@ public class SynchronizedStatement extends Statement { this.body = block; postReplaceChild(oldChild, block, BODY_PROPERTY); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int memSize() { return super.memSize() + 2 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TSuperConstructorInvocation.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TSuperConstructorInvocation.java index 50e877b84..bee92ef24 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TSuperConstructorInvocation.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TSuperConstructorInvocation.java @@ -1,19 +1,19 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute for Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * $Id: TSuperConstructorInvocation.java 23416 2010-02-03 19:59:31Z stephan $ - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation @@ -29,27 +29,27 @@ import java.util.List; * TSuperConstructorInvocation represents a 'tsuper call' to a constructor * of the role's implicit super role-class (OTJLD §2.4.2), * e.g. <code>tsuper();</code> or <code>tsuper(arg0, arg1);</code>. - * + * * Contained AST elements: * a list of argument expressions (<code>Expression</code>). - * + * * Locations in source code: * This node can only be used inside bodies of a role constructor, * it appears in <code>Block</code>s only. - * + * * @author mkr */ -public class TSuperConstructorInvocation extends Statement +public class TSuperConstructorInvocation extends Statement { /** * The "arguments" structural property of this node type. * @since 3.0 */ - public static final ChildListPropertyDescriptor ARGUMENTS_PROPERTY = + public static final ChildListPropertyDescriptor ARGUMENTS_PROPERTY = new ChildListPropertyDescriptor(TSuperConstructorInvocation.class, "arguments", Expression.class, CYCLE_RISK); //$NON-NLS-1$ - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. * @since 3.0 @@ -57,7 +57,7 @@ public class TSuperConstructorInvocation extends Statement @SuppressWarnings("rawtypes") private static final List PROPERTY_DESCRIPTORS; - + static { ArrayList<StructuralPropertyDescriptor> propertyList = new ArrayList<StructuralPropertyDescriptor>(2); createPropertyList(TSuperConstructorInvocation.class, propertyList); @@ -68,22 +68,22 @@ public class TSuperConstructorInvocation extends Statement /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ @SuppressWarnings("rawtypes") - public static List propertyDescriptors(int apiLevel) + public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** - * The list of argument expressions (element type: + * The list of argument expressions (element type: * <code>Expression</code>). Defaults to an empty list. */ private ASTNode.NodeList arguments = @@ -93,23 +93,23 @@ public class TSuperConstructorInvocation extends Statement * Creates a new AST node for an tsuper constructor invocation statement * owned by the given AST. By default, no type arguments, and an empty list * of arguments. - * + * * @param ast the AST that is to own this node */ - TSuperConstructorInvocation(AST ast) + TSuperConstructorInvocation(AST ast) { - super(ast); + super(ast); } - + /** - * Returns the live ordered list of argument expressions in this + * Returns the live ordered list of argument expressions in this * base constructor invocation expression. - * - * @return the live list of argument expressions + * + * @return the live list of argument expressions * (element type: <code>Expression</code>) - */ + */ @SuppressWarnings("rawtypes") - public List getArguments() + public List getArguments() { return this.arguments; } @@ -121,9 +121,9 @@ public class TSuperConstructorInvocation extends Statement } @SuppressWarnings("rawtypes") - final List internalGetChildListProperty(ChildListPropertyDescriptor property) + final List internalGetChildListProperty(ChildListPropertyDescriptor property) { - if (property == ARGUMENTS_PROPERTY) + if (property == ARGUMENTS_PROPERTY) { return getArguments(); } @@ -146,7 +146,7 @@ public class TSuperConstructorInvocation extends Statement return result; } - + final boolean subtreeMatch0(ASTMatcher matcher, Object other) { // dispatch to correct overloaded match method @@ -156,8 +156,8 @@ public class TSuperConstructorInvocation extends Statement void accept0(ASTVisitor visitor) { boolean visitChildren = visitor.visit(this); - - if (visitChildren) + + if (visitChildren) { // visit children in normal left to right reading order acceptChildren(visitor, this.arguments); @@ -170,14 +170,14 @@ public class TSuperConstructorInvocation extends Statement // treat Operator as free return BASE_NODE_SIZE + 1 * 4; } - + int treeSize() { - return memSize() + (this.arguments == null - ? 0 + return memSize() + (this.arguments == null + ? 0 : this.arguments.listSize()); } - + public IMethodBinding resolveConstructorBinding() { return this.ast.getBindingResolver().resolveConstructor(this); } diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TSuperMessageSend.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TSuperMessageSend.java index 1546865e4..2df191daa 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TSuperMessageSend.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TSuperMessageSend.java @@ -1,19 +1,19 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2004, 2006 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute for Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * $Id: TSuperMessageSend.java 23416 2010-02-03 19:59:31Z stephan $ - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation @@ -27,17 +27,17 @@ import java.util.List; * NEW for OTDT. * * TSuperMessageSend represents a super call along the implicit - * inheritance of roles (OTJLD §1.3.1(f)), + * inheritance of roles (OTJLD §1.3.1(f)), * e.g. <code>tsuper.m(arg1, arg2)</code> (only inside method <code>m</code> of a role method) * or <code>tsuper(arg1, arg2)</code> (only in a constructor of a role class). - * + * * Contained AST elements: * a selector name (<code>SimpleName</code>), e.g. <code>myRoleMethod</code>. * a List of argument expressions (<code>Expression</code>). - * + * * Locations in source code: * This node can only be used within role methods. - * + * * @author mkr */ public class TSuperMessageSend extends Expression @@ -46,40 +46,40 @@ public class TSuperMessageSend extends Expression * The "name" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor NAME_PROPERTY = + public static final ChildPropertyDescriptor NAME_PROPERTY = new ChildPropertyDescriptor(TSuperMessageSend.class, "name",//$NON-NLS-1$ SimpleName.class, MANDATORY, - NO_CYCLE_RISK); + NO_CYCLE_RISK); /** * The "arguments" structural property of this node type. * @since 3.0 */ - public static final ChildListPropertyDescriptor ARGUMENTS_PROPERTY = + public static final ChildListPropertyDescriptor ARGUMENTS_PROPERTY = new ChildListPropertyDescriptor(TSuperMessageSend.class, "arguments",//$NON-NLS-1$ Expression.class, - CYCLE_RISK); + CYCLE_RISK); /** * The "qualifier" structural property of this node type. */ - public static final ChildPropertyDescriptor QUALIFIER_PROPERTY = - new ChildPropertyDescriptor(TSuperMessageSend.class, + public static final ChildPropertyDescriptor QUALIFIER_PROPERTY = + new ChildPropertyDescriptor(TSuperMessageSend.class, "qualifier", //$NON-NLS-1$ - Name.class, - OPTIONAL, NO_CYCLE_RISK); + Name.class, + OPTIONAL, NO_CYCLE_RISK); /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ @SuppressWarnings("rawtypes") private static final List PROPERTY_DESCRIPTORS; - + static { ArrayList<StructuralPropertyDescriptor> propertyList = new ArrayList<StructuralPropertyDescriptor>(4); @@ -93,10 +93,10 @@ public class TSuperMessageSend extends Expression /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) */ @SuppressWarnings("rawtypes") @@ -104,14 +104,14 @@ public class TSuperMessageSend extends Expression { return PROPERTY_DESCRIPTORS; } - + /** * The method name; lazily initialized; */ private SimpleName methodName = null; - + /** - * The list of argument expressions (element type: + * The list of argument expressions (element type: * <code>Expression</code>). Defaults to an empty list. */ private ASTNode.NodeList arguments = @@ -121,11 +121,11 @@ public class TSuperMessageSend extends Expression * The tsuper-qualification; lazily initialized; */ private Name optionalQualification = null; - + /** * Creates a new AST node for a tsuper expression owned by the given AST. * By default, there is no qualifier. - * + * * @param ast the AST that is to own this node */ TSuperMessageSend(AST ast) @@ -138,7 +138,7 @@ public class TSuperMessageSend extends Expression { return propertyDescriptors(apiLevel); } - + final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) @@ -165,9 +165,9 @@ public class TSuperMessageSend extends Expression return null; } } - + // allow default implementation to flag the error - return super.internalGetSetChildProperty(property, get, child); + return super.internalGetSetChildProperty(property, get, child); } @SuppressWarnings("rawtypes") @@ -177,7 +177,7 @@ public class TSuperMessageSend extends Expression { return getArguments(); } - + // allow default implementation to flag the error return super.internalGetChildListProperty(property); } @@ -190,20 +190,20 @@ public class TSuperMessageSend extends Expression @SuppressWarnings("unchecked") ASTNode clone0(AST target) { - TSuperMessageSend result = new TSuperMessageSend(target); + TSuperMessageSend result = new TSuperMessageSend(target); result.setSourceRange(this.getStartPosition(), this.getLength()); result.setName((SimpleName)this.methodName.clone(target)); result.getArguments().addAll(ASTNode.copySubtrees(target, this.arguments)); result.setQualification((Name)this.optionalQualification.clone(target)); - return result; + return result; } - + /** * Returns the name of the method invoked in this expression. - * + * * @return the method name node - */ - public SimpleName getName() + */ + public SimpleName getName() { if (this.methodName == null) { @@ -220,19 +220,19 @@ public class TSuperMessageSend extends Expression } return this.methodName; } - + /** * Sets the name of the method invoked in this expression to the * given name. - * + * * @param name the new method name * @exception IllegalArgumentException if: * <ul> * <li>the node belongs to a different AST</li> * <li>the node already has a parent</li> * </ul> - */ - public void setName(SimpleName name) + */ + public void setName(SimpleName name) { if (name == null) { @@ -243,43 +243,43 @@ public class TSuperMessageSend extends Expression this.methodName = name; postReplaceChild(oldChild, name, NAME_PROPERTY); } - + /** - * Returns the ordered list of argument expressions in this + * Returns the ordered list of argument expressions in this * base call method send expression. - * - * @return the live list of argument expressions + * + * @return the live list of argument expressions * (element type: <code>Expression</code>) - */ + */ @SuppressWarnings("rawtypes") - public List getArguments() + public List getArguments() { return this.arguments; } /** - * Returns the qualifier of this qualified creation expression, or + * Returns the qualifier of this qualified creation expression, or * <code>null</code> if there is none. - * + * * @return the qualifier name node, or <code>null</code> if there is none - */ + */ public Name getQualifier() { return this.optionalQualification; } - + /** * Sets the tsuper qualification - * + * * @param qualification the new qualification * @exception IllegalArgumentException if: * <ul> * <li>the node belongs to a different AST</li> * <li>the node already has a parent</li> * </ul> - */ - public void setQualification(Name qualification) + */ + public void setQualification(Name qualification) { if (qualification == null) { @@ -290,7 +290,7 @@ public class TSuperMessageSend extends Expression this.optionalQualification = qualification; postReplaceChild(oldChild, qualification, QUALIFIER_PROPERTY); } - + final boolean subtreeMatch0(ASTMatcher matcher, Object other) { @@ -301,7 +301,7 @@ public class TSuperMessageSend extends Expression void accept0(ASTVisitor visitor) { boolean visitChildren = visitor.visit(this); - if (visitChildren) + if (visitChildren) { // visit children in normal left to right reading order acceptChild(visitor, this.optionalQualification); @@ -316,20 +316,20 @@ public class TSuperMessageSend extends Expression // treat Operator as free return BASE_NODE_SIZE + 4 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ - int treeSize() + int treeSize() { - return + return memSize() + (this.methodName == null ? 0 : this.methodName.treeSize()) + (this.arguments == null ? 0 : this.arguments.listSize()); } - + public IMethodBinding resolveMethodBinding() { return this.ast.getBindingResolver().resolveMethod(this); } - + } diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TagElement.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TagElement.java index 2261a2ad5..8c148b9e4 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TagElement.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TagElement.java @@ -28,7 +28,7 @@ import java.util.List; * MemberRef * <b>{</b> TagElement <b>}</b> * </pre> - * + * * @see Javadoc * @since 3.0 * @noinstantiate This class is not intended to be instantiated by clients. @@ -37,27 +37,27 @@ public final class TagElement extends ASTNode implements IDocElement { /** * The "tagName" structural property of this node type. - * + * * @since 3.0 */ - public static final SimplePropertyDescriptor TAG_NAME_PROPERTY = + public static final SimplePropertyDescriptor TAG_NAME_PROPERTY = new SimplePropertyDescriptor(TagElement.class, "tagName", String.class, OPTIONAL); //$NON-NLS-1$ - + /** * The "fragments" structural property of this node type. * @since 3.0 */ - public static final ChildListPropertyDescriptor FRAGMENTS_PROPERTY = + public static final ChildListPropertyDescriptor FRAGMENTS_PROPERTY = new ChildListPropertyDescriptor(TagElement.class, "fragments", IDocElement.class, CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. * @since 3.0 */ private static final List PROPERTY_DESCRIPTORS; - + static { List propertyList = new ArrayList(3); createPropertyList(TagElement.class, propertyList); @@ -65,21 +65,21 @@ public final class TagElement extends ASTNode implements IDocElement { addProperty(FRAGMENTS_PROPERTY, propertyList); PROPERTY_DESCRIPTORS = reapPropertyList(propertyList); } - + /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** * Standard doc tag name (value {@value}). */ @@ -187,36 +187,36 @@ public final class TagElement extends ASTNode implements IDocElement { * The tag name, or null if none; defaults to null. */ private String optionalTagName = null; - + /** - * The list of doc elements (element type: <code>IDocElement</code>). + * The list of doc elements (element type: <code>IDocElement</code>). * Defaults to an empty list. */ - private ASTNode.NodeList fragments = + private ASTNode.NodeList fragments = new ASTNode.NodeList(FRAGMENTS_PROPERTY); /** * Creates a new AST node for a tag element owned by the given AST. * The new node has no name and an empty list of fragments. * <p> - * N.B. This constructor is package-private; all subclasses must be - * declared in the same package; clients are unable to declare + * N.B. This constructor is package-private; all subclasses must be + * declared in the same package; clients are unable to declare * additional subclasses. * </p> - * + * * @param ast the AST that is to own this node */ TagElement(AST ast) { super(ast); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -243,7 +243,7 @@ public final class TagElement extends ASTNode implements IDocElement { // allow default implementation to flag the error return super.internalGetChildListProperty(property); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -261,7 +261,7 @@ public final class TagElement extends ASTNode implements IDocElement { result.fragments().addAll(ASTNode.copySubtrees(target, fragments())); return result; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -292,11 +292,11 @@ public final class TagElement extends ASTNode implements IDocElement { * the first explicit tag. * * @return the tag name, or <code>null</code> if none - */ + */ public String getTagName() { return this.optionalTagName; } - + /** * Sets the tag name of this node to the given value. * For top level doc tags such as parameter tags, the tag name @@ -308,22 +308,22 @@ public final class TagElement extends ASTNode implements IDocElement { * the first explicit tag. * * @param tagName the tag name, or <code>null</code> if none - */ + */ public void setTagName(String tagName) { preValueChange(TAG_NAME_PROPERTY); this.optionalTagName = tagName; postValueChange(TAG_NAME_PROPERTY); } - + /** - * Returns the live list of fragments in this tag element. + * Returns the live list of fragments in this tag element. * <p> * The fragments cover everything following the tag name * (or everything if there is no tag name), and generally omit * embedded line breaks (and leading whitespace on new lines, * including any leading "*"). {@link org.eclipse.jdt.core.dom.TagElement} * nodes are used to represent tag elements (e.g., "@link") - * nested within this tag element. + * nested within this tag element. * </p> * <p> * Here are some typical examples: @@ -334,7 +334,7 @@ public final class TagElement extends ASTNode implements IDocElement { * TagElement with tag name "@param"; * 2 fragments: SimpleName ("args"), TextElement * (" the program arguments")</li> - * <li>"@return See {@link #foo foo} instead." - + * <li>"@return See {@link #foo foo} instead." - * TagElement with tag name "@return"; * 3 fragments: TextElement ("See "), * TagElement (for "@link #foo foo"), @@ -347,24 +347,24 @@ public final class TagElement extends ASTNode implements IDocElement { * <p> * Adding and removing nodes from this list affects this node * dynamically. The nodes in this list may be of various - * types, including {@link TextElement}, - * {@link org.eclipse.jdt.core.dom.TagElement}, {@link Name}, + * types, including {@link TextElement}, + * {@link org.eclipse.jdt.core.dom.TagElement}, {@link Name}, * {@link MemberRef}, and {@link MethodRef}. * Clients should assume that the list of types may grow in * the future, and write their code to deal with unexpected * nodes types. However, attempts to add a non-proscribed type * of node will trigger an exception. - * + * * @return the live list of doc elements in this tag element * (element type: <code>ASTNode</code>) - */ + */ public List fragments() { return this.fragments; } /** * Returns whether this tag element is nested within another - * tag element. Nested tag elements appears enclosed in + * tag element. Nested tag elements appears enclosed in * "{" and "}"; certain doc tags, including "@link" and * "@linkplain" are only meaningful as nested tags. * Top-level (i.e., non-nested) doc tags begin on a new line; @@ -374,7 +374,7 @@ public final class TagElement extends ASTNode implements IDocElement { * This convenience methods checks to see whether the parent * of this node is of type {@link org.eclipse.jdt.core.dom.TagElement}. * </p> - * + * * @return <code>true</code> if this node is a nested tag element, * and false if this node is either parented by a doc comment node * ({@link Javadoc}), or is unparented @@ -382,7 +382,7 @@ public final class TagElement extends ASTNode implements IDocElement { public boolean isNested() { return (getParent() instanceof TagElement); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -390,7 +390,7 @@ public final class TagElement extends ASTNode implements IDocElement { int size = BASE_NODE_SIZE + 2 * 4 + stringSize(this.optionalTagName); return size; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TextElement.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TextElement.java index 4bae86903..3e21f29d3 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TextElement.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TextElement.java @@ -22,7 +22,7 @@ import org.eclipse.jdt.internal.compiler.util.Util; * TextElement: * Sequence of characters not including a close comment delimiter <b>*</b><b>/</b> * </pre> - * + * * @see Javadoc * @since 3.0 * @noinstantiate This class is not intended to be instantiated by clients. @@ -31,68 +31,68 @@ public final class TextElement extends ASTNode implements IDocElement { /** * The "text" structural property of this node type. - * + * * @since 3.0 */ - public static final SimplePropertyDescriptor TEXT_PROPERTY = + public static final SimplePropertyDescriptor TEXT_PROPERTY = new SimplePropertyDescriptor(TextElement.class, "text", String.class, MANDATORY); //$NON-NLS-1$ - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. * @since 3.0 */ private static final List PROPERTY_DESCRIPTORS; - + static { List propertyList = new ArrayList(2); createPropertyList(TextElement.class, propertyList); addProperty(TEXT_PROPERTY, propertyList); PROPERTY_DESCRIPTORS = reapPropertyList(propertyList); } - + /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** * The text element; defaults to the empty string. */ private String text = Util.EMPTY_STRING; - + /** * Creates a new AST node for a text element owned by the given AST. * The new node has an empty text string. * <p> - * N.B. This constructor is package-private; all subclasses must be - * declared in the same package; clients are unable to declare + * N.B. This constructor is package-private; all subclasses must be + * declared in the same package; clients are unable to declare * additional subclasses. * </p> - * + * * @param ast the AST that is to own this node */ TextElement(AST ast) { super(ast); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -125,7 +125,7 @@ public final class TextElement extends ASTNode implements IDocElement { result.setText(getText()); return result; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -144,13 +144,13 @@ public final class TextElement extends ASTNode implements IDocElement { /** * Returns this node's text. - * + * * @return the text of this node - */ + */ public String getText() { return this.text; } - + /** * Sets the text of this node to the given value. * <p> @@ -159,11 +159,11 @@ public final class TextElement extends ASTNode implements IDocElement { * or following elements. The text element must not include * a block comment closing delimiter "*"+"/". * </p> - * + * * @param text the text of this node * @exception IllegalArgumentException if the text is null * or contains a block comment closing delimiter - */ + */ public void setText(String text) { if (text == null) { throw new IllegalArgumentException(); @@ -175,7 +175,7 @@ public final class TextElement extends ASTNode implements IDocElement { this.text = text; postValueChange(TEXT_PROPERTY); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -187,7 +187,7 @@ public final class TextElement extends ASTNode implements IDocElement { } return size; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ThisExpression.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ThisExpression.java index aa5d8ab38..766c223d5 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ThisExpression.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ThisExpression.java @@ -25,27 +25,27 @@ import java.util.List; * See <code>FieldAccess</code> for guidelines on handling other expressions * that resemble qualified names. * </p> - * + * * @see FieldAccess * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ public class ThisExpression extends Expression { - + /** * The "qualifier" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor QUALIFIER_PROPERTY = + public static final ChildPropertyDescriptor QUALIFIER_PROPERTY = new ChildPropertyDescriptor(ThisExpression.class, "qualifier", Name.class, OPTIONAL, NO_CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List propertyList = new ArrayList(2); createPropertyList(ThisExpression.class, propertyList); @@ -56,26 +56,26 @@ public class ThisExpression extends Expression { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** * The optional qualifier; <code>null</code> for none; defaults to none. */ private Name optionalQualifier = null; /** - * Creates a new AST node for a "this" expression owned by the + * Creates a new AST node for a "this" expression owned by the * given AST. By default, there is no qualifier. - * + * * @param ast the AST that is to own this node */ ThisExpression(AST ast) { @@ -88,7 +88,7 @@ public class ThisExpression extends Expression { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -104,7 +104,7 @@ public class ThisExpression extends Expression { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -140,28 +140,28 @@ public class ThisExpression extends Expression { } visitor.endVisit(this); } - + /** - * Returns the qualifier of this "this" expression, or + * Returns the qualifier of this "this" expression, or * <code>null</code> if there is none. - * + * * @return the qualifier name node, or <code>null</code> if there is none - */ + */ public Name getQualifier() { return this.optionalQualifier; } - + /** * Sets or clears the qualifier of this "this" expression. - * - * @param name the qualifier name node, or <code>null</code> if + * + * @param name the qualifier name node, or <code>null</code> if * there is none * @exception IllegalArgumentException if: * <ul> * <li>the node belongs to a different AST</li> * <li>the node already has a parent</li> * </ul> - */ + */ public void setQualifier(Name name) { ASTNode oldChild = this.optionalQualifier; preReplaceChild(oldChild, name, QUALIFIER_PROPERTY); @@ -176,12 +176,12 @@ public class ThisExpression extends Expression { // treat Operator as free return BASE_NODE_SIZE + 1 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int treeSize() { - return + return memSize() + (this.optionalQualifier == null ? 0 : getQualifier().treeSize()); } diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ThrowStatement.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ThrowStatement.java index 9b3cf78d5..e4f1da871 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ThrowStatement.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ThrowStatement.java @@ -21,26 +21,26 @@ import java.util.List; * ThrowStatement: * <b>throw</b> Expression <b>;</b> * </pre> - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ public class ThrowStatement extends Statement { - + /** * The "expression" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor EXPRESSION_PROPERTY = + public static final ChildPropertyDescriptor EXPRESSION_PROPERTY = new ChildPropertyDescriptor(ThrowStatement.class, "expression", Expression.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List propertyList = new ArrayList(2); createPropertyList(ThrowStatement.class, propertyList); @@ -51,18 +51,18 @@ public class ThrowStatement extends Statement { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** * The expression; lazily initialized; defaults to a unspecified, but legal, * expression. @@ -70,13 +70,13 @@ public class ThrowStatement extends Statement { private Expression expression = null; /** - * Creates a new unparented throw statement node owned by the given + * Creates a new unparented throw statement node owned by the given * AST. By default, the throw statement has an unspecified, but legal, * expression. * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ ThrowStatement(AST ast) { @@ -89,7 +89,7 @@ public class ThrowStatement extends Statement { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -105,7 +105,7 @@ public class ThrowStatement extends Statement { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -123,7 +123,7 @@ public class ThrowStatement extends Statement { result.setExpression((Expression) getExpression().clone(target)); return result; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -142,12 +142,12 @@ public class ThrowStatement extends Statement { } visitor.endVisit(this); } - + /** * Returns the expression of this throw statement. - * + * * @return the expression node - */ + */ public Expression getExpression() { if (this.expression == null) { // lazy init must be thread-safe for readers @@ -161,10 +161,10 @@ public class ThrowStatement extends Statement { } return this.expression; } - + /** * Sets the expression of this throw statement. - * + * * @param expression the new expression node * @exception IllegalArgumentException if: * <ul> @@ -172,7 +172,7 @@ public class ThrowStatement extends Statement { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setExpression(Expression expression) { if (expression == null) { throw new IllegalArgumentException(); @@ -182,14 +182,14 @@ public class ThrowStatement extends Statement { this.expression = expression; postReplaceChild(oldChild, expression, EXPRESSION_PROPERTY); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int memSize() { return super.memSize() + 1 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TryStatement.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TryStatement.java index 1afbee8b1..bb87b8c94 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TryStatement.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TryStatement.java @@ -19,44 +19,44 @@ import java.util.List; * * <pre> * TryStatement: - * <b>try</b> Block + * <b>try</b> Block * { CatchClause } * [ <b>finally</b> Block ] * </pre> - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ public class TryStatement extends Statement { - + /** * The "body" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor BODY_PROPERTY = + public static final ChildPropertyDescriptor BODY_PROPERTY = new ChildPropertyDescriptor(TryStatement.class, "body", Block.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ /** * The "catchClauses" structural property of this node type. * @since 3.0 */ - public static final ChildListPropertyDescriptor CATCH_CLAUSES_PROPERTY = + public static final ChildListPropertyDescriptor CATCH_CLAUSES_PROPERTY = new ChildListPropertyDescriptor(TryStatement.class, "catchClauses", CatchClause.class, CYCLE_RISK); //$NON-NLS-1$ /** * The "finally" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor FINALLY_PROPERTY = + public static final ChildPropertyDescriptor FINALLY_PROPERTY = new ChildPropertyDescriptor(TryStatement.class, "finally", Block.class, OPTIONAL, CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List propertyList = new ArrayList(4); createPropertyList(TryStatement.class, propertyList); @@ -69,17 +69,17 @@ public class TryStatement extends Statement { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** * The body; lazily initialized; defaults to an empty block. */ @@ -91,22 +91,22 @@ public class TryStatement extends Statement { */ private ASTNode.NodeList catchClauses = new ASTNode.NodeList(CATCH_CLAUSES_PROPERTY); - + /** * The finally block, or <code>null</code> if none. * Defaults to none. */ private Block optionalFinallyBody = null; - + /** - * Creates a new AST node for a try statement owned by the given + * Creates a new AST node for a try statement owned by the given * AST. By default, the try statement has an empty block, no catch * clauses, and no finally block. * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ TryStatement(AST ast) { @@ -119,7 +119,7 @@ public class TryStatement extends Statement { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -143,7 +143,7 @@ public class TryStatement extends Statement { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -198,12 +198,12 @@ public class TryStatement extends Statement { } visitor.endVisit(this); } - + /** * Returns the body of this try statement. - * + * * @return the try body - */ + */ public Block getBody() { if (this.body == null) { // lazy init must be thread-safe for readers @@ -217,10 +217,10 @@ public class TryStatement extends Statement { } return this.body; } - + /** * Sets the body of this try statement. - * + * * @param body the block node * @exception IllegalArgumentException if: * <ul> @@ -228,7 +228,7 @@ public class TryStatement extends Statement { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setBody(Block body) { if (body == null) { throw new IllegalArgumentException(); @@ -241,29 +241,29 @@ public class TryStatement extends Statement { /** * Returns the live ordered list of catch clauses for this try statement. - * + * * @return the live list of catch clauses * (element type: <code>CatchClause</code>) - */ + */ public List catchClauses() { return this.catchClauses; } - + /** - * Returns the finally block of this try statement, or <code>null</code> if + * Returns the finally block of this try statement, or <code>null</code> if * this try statement has <b>no</b> finally block. - * + * * @return the finally block, or <code>null</code> if this try statement * has none - */ + */ public Block getFinally() { return this.optionalFinallyBody; } /** * Sets or clears the finally block of this try statement. - * - * @param block the finally block node, or <code>null</code> if + * + * @param block the finally block node, or <code>null</code> if * there is none * @exception IllegalArgumentException if: * <ul> @@ -271,21 +271,21 @@ public class TryStatement extends Statement { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setFinally(Block block) { ASTNode oldChild = this.optionalFinallyBody; preReplaceChild(oldChild, block, FINALLY_PROPERTY); this.optionalFinallyBody = block; postReplaceChild(oldChild, block, FINALLY_PROPERTY); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int memSize() { return super.memSize() + 3 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Type.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Type.java index 6504333d8..bdffe9221 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Type.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/Type.java @@ -12,7 +12,7 @@ package org.eclipse.jdt.core.dom; /** - * Abstract base class of all type AST node types. A type node represents a + * Abstract base class of all type AST node types. A type node represents a * reference to a primitive type (including void), to an array type, or to a * simple named type (or type variable), to a qualified type, to a * parameterized type, or to a wildcard type. Note that not all of these @@ -46,31 +46,31 @@ package org.eclipse.jdt.core.dom; * QualifiedType: * Type <b>.</b> SimpleName * WildcardType: - * <b>?</b> [ ( <b>extends</b> | <b>super</b>) Type ] + * <b>?</b> [ ( <b>extends</b> | <b>super</b>) Type ] * </pre> * </p> - * + * * @since 2.0 */ public abstract class Type extends ASTNode { - + /** * Creates a new AST node for a type owned by the given AST. * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ Type(AST ast) { super(ast); } - + /** * Returns whether this type is a primitive type - * (<code>PrimitiveType</code>). - * - * @return <code>true</code> if this is a primitive type, and + * (<code>PrimitiveType</code>). + * + * @return <code>true</code> if this is a primitive type, and * <code>false</code> otherwise */ public final boolean isPrimitiveType() { @@ -78,10 +78,10 @@ public abstract class Type extends ASTNode { } /** - * Returns whether this type is a simple type + * Returns whether this type is a simple type * (<code>SimpleType</code>). - * - * @return <code>true</code> if this is a simple type, and + * + * @return <code>true</code> if this is a simple type, and * <code>false</code> otherwise */ public final boolean isSimpleType() { @@ -91,8 +91,8 @@ public abstract class Type extends ASTNode { /** * Returns whether this type is an array type * (<code>ArrayType</code>). - * - * @return <code>true</code> if this is an array type, and + * + * @return <code>true</code> if this is an array type, and * <code>false</code> otherwise */ public final boolean isArrayType() { @@ -101,9 +101,9 @@ public abstract class Type extends ASTNode { /** * Returns whether this type is a parameterized type - * (<code>ParameterizedType</code>). - * - * @return <code>true</code> if this is a parameterized type, and + * (<code>ParameterizedType</code>). + * + * @return <code>true</code> if this is a parameterized type, and * <code>false</code> otherwise * @since 3.1 */ @@ -113,7 +113,7 @@ public abstract class Type extends ASTNode { /** * Returns whether this type is a qualified type - * (<code>QualifiedType</code>). + * (<code>QualifiedType</code>). * <p> * Note that a type like "A.B" can be represented either of two ways: * <ol> @@ -124,14 +124,14 @@ public abstract class Type extends ASTNode { * <code>SimpleType(QualifiedName(SimpleName("A"),SimpleName("B")))</code> * </li> * </ol> - * The first form is preferred when "A" is known to be a type. However, a + * The first form is preferred when "A" is known to be a type. However, a * parser cannot always determine this. Clients should be prepared to handle * either rather than make assumptions. (Note also that the first form - * became possible as of JLS3; only the second form existed in the + * became possible as of JLS3; only the second form existed in the * JLS2 API.) * </p> - * - * @return <code>true</code> if this is a qualified type, and + * + * @return <code>true</code> if this is a qualified type, and * <code>false</code> otherwise * @since 3.1 */ @@ -143,11 +143,11 @@ public abstract class Type extends ASTNode { * Returns whether this type is a wildcard type * (<code>WildcardType</code>). * <p> - * Note that a wildcard type is only meaningful as a + * Note that a wildcard type is only meaningful as a * type argument of a <code>ParameterizedType</code> node. * </p> - * - * @return <code>true</code> if this is a wildcard type, and + * + * @return <code>true</code> if this is a wildcard type, and * <code>false</code> otherwise * @since 3.1 */ @@ -161,10 +161,10 @@ public abstract class Type extends ASTNode { * Note that bindings are generally unavailable unless requested when the * AST is being built. * </p> - * - * @return the type binding, or <code>null</code> if the binding cannot be + * + * @return the type binding, or <code>null</code> if the binding cannot be * resolved - */ + */ public final ITypeBinding resolveBinding() { return this.ast.getBindingResolver().resolveType(this); } diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeAnchor.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeAnchor.java index c80e18746..c83dc6d1f 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeAnchor.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeAnchor.java @@ -1,19 +1,19 @@ /********************************************************************** * This file is part of "Object Teams Development Tooling"-Software - * + * * Copyright 2006 Fraunhofer Gesellschaft, Munich, Germany, * for its Fraunhofer Institute for Computer Architecture and Software * Technology (FIRST), Berlin, Germany and Technical University Berlin, * Germany. - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * $Id: LiftingType.java 14417 2006-09-23 11:18:42Z stephan $ - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. - * + * * Contributors: * Fraunhofer FIRST - Initial API and implementation * Technical University Berlin - Initial API and implementation @@ -24,30 +24,30 @@ import java.util.ArrayList; import java.util.List; /** * NEW for OTDT - * + * * This class represents the anchor "@anchor" of a dependent type T<@anchor>. * For the compiler this is a value reference but syntactically we treat it * as a type reference so the whole type can mimic as a regular generic type. - * + * * @author stephan * @version $Id: LiftingType.java 14417 2006-09-23 11:18:42Z stephan $ */ public class TypeAnchor extends Type { - + /** * The "path" structural property of this node type. */ - public static final ChildPropertyDescriptor PATH_PROPERTY = + public static final ChildPropertyDescriptor PATH_PROPERTY = new ChildPropertyDescriptor(TypeAnchor.class, "path", Name.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ @SuppressWarnings("rawtypes") private static final List PROPERTY_DESCRIPTORS; - + static { List<StructuralPropertyDescriptor> propertyList = new ArrayList<StructuralPropertyDescriptor>(2); @@ -59,10 +59,10 @@ public class TypeAnchor extends Type { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) */ @SuppressWarnings("rawtypes") @@ -70,20 +70,20 @@ public class TypeAnchor extends Type { { return PROPERTY_DESCRIPTORS; } - - /** + + /** * The path node; lazily initialized; defaults to a unspecified, but legal, path. */ private Name path = null; - - + + /** * Creates a new unparented node for a type anchor owned by the given AST. * By default, an unspecified, but legal, expression. * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ TypeAnchor(AST ast) @@ -97,7 +97,7 @@ public class TypeAnchor extends Type { { return propertyDescriptors(apiLevel); } - + @Override final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) { @@ -116,12 +116,12 @@ public class TypeAnchor extends Type { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /** * Returns the path of this type anchor. - * + * * @return the path node - */ + */ public Name getPath() { if (this.path == null) { // lazy init must be thread-safe for readers @@ -135,10 +135,10 @@ public class TypeAnchor extends Type { } return this.path; } - + /** * Sets the path of this type anchor. - * + * * @param path the new path node * @exception IllegalArgumentException if: * <ul> @@ -146,7 +146,7 @@ public class TypeAnchor extends Type { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setPath(Name path) { if (path == null) { throw new IllegalArgumentException(); @@ -192,7 +192,7 @@ public class TypeAnchor extends Type { @Override int treeSize() { - return memSize() + return memSize() + (this.path == null ? 0 : getPath().treeSize()); } diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeBinding.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeBinding.java index f7cce87fc..2aa91ae6b 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeBinding.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeBinding.java @@ -5,7 +5,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * $Id: TypeBinding.java 23405 2010-02-03 17:02:18Z stephan $ - * + * * Contributors: * IBM Corporation - initial API and implementation * Fraunhofer FIRST - extended API and implementation @@ -54,13 +54,13 @@ import org.eclipse.objectteams.otdt.internal.core.compiler.model.RoleModel; /** * MIGRATION_STATE: 3.4 - * + * * <h4>OTDT changes:</h4> * <dl> * <dt>What:<dd> implement methods from ITypeBinding - * + * * <dt>What:<dd> Check for role files. - * </dl> + * </dl> * <hr> * Internal implementation of type bindings. */ @@ -114,7 +114,7 @@ class TypeBinding implements ITypeBinding { } if (refType != null) { //{ObjectTeams: calling getAnnotations() requires Dependencies control: -/* orig: +/* orig: org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding[] internalAnnotations = refType.getAnnotations(); :giro */ org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding[] internalAnnotations = null; @@ -122,7 +122,7 @@ class TypeBinding implements ITypeBinding { try { internalAnnotations = refType.getAnnotations(); } finally { - Dependencies.release(this); + Dependencies.release(this); } // SH} int length = internalAnnotations == null ? 0 : internalAnnotations.length; @@ -204,7 +204,7 @@ class TypeBinding implements ITypeBinding { } return null; } - + /* (non-Javadoc) * @see org.eclipse.jdt.core.dom.ITypeBinding#getGenericTypeOfWildcardType() */ @@ -220,7 +220,7 @@ class TypeBinding implements ITypeBinding { } return null; } - + /* (non-Javadoc) * @see org.eclipse.jdt.core.dom.ITypeBinding#getRank() */ @@ -234,7 +234,7 @@ class TypeBinding implements ITypeBinding { return -1; } } - + /* * @see ITypeBinding#getComponentType() */ @@ -255,13 +255,13 @@ class TypeBinding implements ITypeBinding { } //{ObjectTeams: may need Dependencies: boolean usesDependencies = false; -// SH} +// SH} try { if (isClass() || isInterface() || isEnum()) { //{ObjectTeams: calling methods() requires Dependencies control: Dependencies.setup(this, null, this.resolver.lookupEnvironment(), true, true); // TODO(SH): parser, flags? usesDependencies = true; -// SH} +// SH} ReferenceBinding referenceBinding = (ReferenceBinding) this.binding; FieldBinding[] fieldBindings = referenceBinding.availableFields(); // resilience int length = fieldBindings.length; @@ -302,7 +302,7 @@ class TypeBinding implements ITypeBinding { if (usesDependencies) Dependencies.release(this); } -// SH} +// SH} return this.fields = NO_VARIABLE_BINDINGS; } @@ -315,13 +315,13 @@ class TypeBinding implements ITypeBinding { } //{ObjectTeams: may need Dependencies: boolean usesDependencies = false; -// SH} +// SH} try { if (isClass() || isInterface() || isEnum()) { //{ObjectTeams: calling methods() requires Dependencies control: Dependencies.setup(this, null, this.resolver.lookupEnvironment(), true, true); // TODO(SH): parser, flags? usesDependencies = true; -// SH} +// SH} ReferenceBinding referenceBinding = (ReferenceBinding) this.binding; org.eclipse.jdt.internal.compiler.lookup.MethodBinding[] internalMethods = referenceBinding.availableMethods(); // be resilient int length = internalMethods.length; @@ -334,7 +334,7 @@ class TypeBinding implements ITypeBinding { continue; } //{ObjectTeams: - if ( methodBinding.copyInheritanceSrc != null + if ( methodBinding.copyInheritanceSrc != null || CharOperation.prefixEquals(IOTConstants.OT_DOLLAR_NAME, methodBinding.selector())) continue; // SH} @@ -365,7 +365,7 @@ class TypeBinding implements ITypeBinding { if (usesDependencies) Dependencies.release(this); } -// SH} +// SH} return this.methods = NO_METHOD_BINDINGS; } @@ -857,7 +857,7 @@ class TypeBinding implements ITypeBinding { } } - + //{ObjectTeams: uniform handling of regular types names and anchored role type names: public String getOptimalName() { if (binding instanceof ReferenceBinding) @@ -1236,14 +1236,14 @@ class TypeBinding implements ITypeBinding { public boolean isTeam() { return this.binding.isTeam(); } - + /* * @see ITypeBinding#isRole() */ public boolean isRole() { return this.binding.isRole(); } - + /* * @see ITypeBinding#isClassPartOf() */ @@ -1253,7 +1253,7 @@ class TypeBinding implements ITypeBinding { RoleModel roleModel = ((ReferenceBinding)this.binding).roleModel; if (roleModel == null) return false; - org.eclipse.jdt.internal.compiler.lookup.TypeBinding otherBinding = (other instanceof RecoveredTypeBinding) + org.eclipse.jdt.internal.compiler.lookup.TypeBinding otherBinding = (other instanceof RecoveredTypeBinding) ? ((RecoveredTypeBinding)other).getResolvedBinding() : ((TypeBinding)other).binding; return roleModel.getInterfacePartBinding() == otherBinding; @@ -1290,7 +1290,7 @@ class TypeBinding implements ITypeBinding { } return this.resolver.getTypeBinding(baseclass); } -// ira+SH} +// ira+SH} /* * @see ITypeBinding#isLocal() @@ -1345,11 +1345,11 @@ class TypeBinding implements ITypeBinding { return RoleTypeBinding.isRoleWithExplicitAnchor(this.binding); return DependentTypeBinding.isDependentType(this.binding); } - + public String[] getAnchorPath() { if (!DependentTypeBinding.isDependentType(this.binding)) return new String[0]; - + return getBestNamePath((DependentTypeBinding)this.binding); } @@ -1450,7 +1450,7 @@ class TypeBinding implements ITypeBinding { public IMethodMappingBinding[] getResolvedMethodMappings() { List<IMethodMappingBinding> mappings = new ArrayList<IMethodMappingBinding>(); if (this.isRole()) { - org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding roleBinding + org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding roleBinding = (org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding)this.binding; if (roleBinding.callinCallouts != null) { for (CallinCalloutBinding mapping : roleBinding.callinCallouts) { diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeDeclaration.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeDeclaration.java index b72a70ff6..bf44a8653 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeDeclaration.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeDeclaration.java @@ -37,8 +37,8 @@ import java.util.List; * <b>{</b> { InterfaceBodyDeclaration | <b>;</b> } <b>}</b> * </pre> * For JLS3, type parameters and reified modifiers - * (and annotations) were added, and the superclass type name and superinterface - * types names are generalized to type so that parameterized types can be + * (and annotations) were added, and the superclass type name and superinterface + * types names are generalized to type so that parameterized types can be * referenced: * <pre> * TypeDeclaration: @@ -65,67 +65,67 @@ import java.util.List; * modifiers or annotations). The source range extends through the last character of the "}" * token following the body declarations. * </p> - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ public class TypeDeclaration extends AbstractTypeDeclaration { - + /** * The "javadoc" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor JAVADOC_PROPERTY = + public static final ChildPropertyDescriptor JAVADOC_PROPERTY = internalJavadocPropertyFactory(TypeDeclaration.class); /** * The "modifiers" structural property of this node type (JLS2 API only). * @since 3.0 */ - public static final SimplePropertyDescriptor MODIFIERS_PROPERTY = + public static final SimplePropertyDescriptor MODIFIERS_PROPERTY = internalModifiersPropertyFactory(TypeDeclaration.class); - + /** * The "modifiers" structural property of this node type (added in JLS3 API). * @since 3.1 */ - public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = + public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = internalModifiers2PropertyFactory(TypeDeclaration.class); - + /** * The "interface" structural property of this node type. * @since 3.0 */ - public static final SimplePropertyDescriptor INTERFACE_PROPERTY = + public static final SimplePropertyDescriptor INTERFACE_PROPERTY = new SimplePropertyDescriptor(TypeDeclaration.class, "interface", boolean.class, MANDATORY); //$NON-NLS-1$ - + //{ObjectTeams: OT-specific properties /** * The "team" structural property of this node type. */ - public static final SimplePropertyDescriptor TEAM_PROPERTY = + public static final SimplePropertyDescriptor TEAM_PROPERTY = new SimplePropertyDescriptor(TypeDeclaration.class, "team", boolean.class, MANDATORY); //$NON-NLS-1$ /** * The "role" structural property of this node type. */ - public static final SimplePropertyDescriptor ROLE_PROPERTY = + public static final SimplePropertyDescriptor ROLE_PROPERTY = new SimplePropertyDescriptor(TypeDeclaration.class, "role", boolean.class, MANDATORY); //$NON-NLS-1$ - + /** * The "precedence" structural property. */ public static final ChildListPropertyDescriptor PRECEDENCE_PROPERTY = new ChildListPropertyDescriptor(TypeDeclaration.class, "precedence", PrecedenceDeclaration.class, NO_CYCLE_RISK); //$NON-NLS-1$ - + /** * The "guardPredicate" structural property of this node type. * @since 0.9.25 */ - public static final ChildPropertyDescriptor GUARD_PROPERTY = + public static final ChildPropertyDescriptor GUARD_PROPERTY = new ChildPropertyDescriptor(TypeDeclaration.class, "guardPredicate", GuardPredicateDeclaration.class, OPTIONAL, NO_CYCLE_RISK); //$NON-NLS-1$ -//gbr+SH} - +//gbr+SH} + /** * The "name" structural property of this node type. * @since 3.0 @@ -137,60 +137,60 @@ public class TypeDeclaration extends AbstractTypeDeclaration { * The "superclass" structural property of this node type (JLS2 API only). * @since 3.0 */ - public static final ChildPropertyDescriptor SUPERCLASS_PROPERTY = + public static final ChildPropertyDescriptor SUPERCLASS_PROPERTY = new ChildPropertyDescriptor(TypeDeclaration.class, "superclass", Name.class, OPTIONAL, NO_CYCLE_RISK); //$NON-NLS-1$ /** * The "superInterfaces" structural property of this node type (JLS2 API only). * @since 3.0 */ - public static final ChildListPropertyDescriptor SUPER_INTERFACES_PROPERTY = + public static final ChildListPropertyDescriptor SUPER_INTERFACES_PROPERTY = new ChildListPropertyDescriptor(TypeDeclaration.class, "superInterfaces", Name.class, NO_CYCLE_RISK); //$NON-NLS-1$ /** * The "superclassType" structural property of this node type (added in JLS3 API). * @since 3.1 */ - public static final ChildPropertyDescriptor SUPERCLASS_TYPE_PROPERTY = + public static final ChildPropertyDescriptor SUPERCLASS_TYPE_PROPERTY = new ChildPropertyDescriptor(TypeDeclaration.class, "superclassType", Type.class, OPTIONAL, NO_CYCLE_RISK); //$NON-NLS-1$ /** * The "superInterfaceTypes" structural property of this node type (added in JLS3 API). * @since 3.1 */ - public static final ChildListPropertyDescriptor SUPER_INTERFACE_TYPES_PROPERTY = + public static final ChildListPropertyDescriptor SUPER_INTERFACE_TYPES_PROPERTY = new ChildListPropertyDescriptor(TypeDeclaration.class, "superInterfaceTypes", Type.class, NO_CYCLE_RISK); //$NON-NLS-1$ - + /** * The "typeParameters" structural property of this node type (added in JLS3 API). * @since 3.1 */ - public static final ChildListPropertyDescriptor TYPE_PARAMETERS_PROPERTY = + public static final ChildListPropertyDescriptor TYPE_PARAMETERS_PROPERTY = new ChildListPropertyDescriptor(TypeDeclaration.class, "typeParameters", TypeParameter.class, NO_CYCLE_RISK); //$NON-NLS-1$ - + /** * The "bodyDeclarations" structural property of this node type (added in JLS3 API). * @since 3.0 */ - public static final ChildListPropertyDescriptor BODY_DECLARATIONS_PROPERTY = + public static final ChildListPropertyDescriptor BODY_DECLARATIONS_PROPERTY = internalBodyDeclarationPropertyFactory(TypeDeclaration.class); - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. * @since 3.0 */ private static final List PROPERTY_DESCRIPTORS_2_0; - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. * @since 3.1 */ private static final List PROPERTY_DESCRIPTORS_3_0; - + static { List propertyList = new ArrayList(12); createPropertyList(TypeDeclaration.class, propertyList); @@ -208,7 +208,7 @@ public class TypeDeclaration extends AbstractTypeDeclaration { addProperty(SUPER_INTERFACES_PROPERTY, propertyList); addProperty(BODY_DECLARATIONS_PROPERTY, propertyList); PROPERTY_DESCRIPTORS_2_0 = reapPropertyList(propertyList); - + propertyList = new ArrayList(13); createPropertyList(TypeDeclaration.class, propertyList); addProperty(JAVADOC_PROPERTY, propertyList); @@ -218,7 +218,7 @@ public class TypeDeclaration extends AbstractTypeDeclaration { addProperty(TEAM_PROPERTY, propertyList); addProperty(ROLE_PROPERTY, propertyList); addProperty(PRECEDENCE_PROPERTY, propertyList); - addProperty(GUARD_PROPERTY, propertyList); + addProperty(GUARD_PROPERTY, propertyList); //gbr+SH} addProperty(NAME_PROPERTY, propertyList); addProperty(TYPE_PARAMETERS_PROPERTY, propertyList); @@ -231,11 +231,11 @@ public class TypeDeclaration extends AbstractTypeDeclaration { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ @@ -246,17 +246,17 @@ public class TypeDeclaration extends AbstractTypeDeclaration { return PROPERTY_DESCRIPTORS_3_0; } } - + /** * <code>true</code> for an interface, <code>false</code> for a class. * Defaults to class. */ //{ObjectTeams: avoid private to allow access from RoleTypeDeclaration without duplicating this field -/* orig: +/* orig: private boolean isInterface = false; :giro */ boolean isInterface = false; -// SH} +// SH} //{ObjectTeams: OT-specific fields added /** @@ -270,47 +270,47 @@ public class TypeDeclaration extends AbstractTypeDeclaration { * Defaults to class. */ boolean _isRole = false; - + ASTNode.NodeList _precedences = new ASTNode.NodeList(PRECEDENCE_PROPERTY); - + GuardPredicateDeclaration optionalGuardPredicate = null; //gbr} - + /** - * The type paramters (element type: <code>TypeParameter</code>). + * The type paramters (element type: <code>TypeParameter</code>). * Null in JLS2. Added in JLS3; defaults to an empty list * (see constructor). * @since 3.1 */ //{ObjectTeams: avoid private to allow access from RoleTypeDeclaration without duplicating this field -/* orig: +/* orig: private ASTNode.NodeList typeParameters = null; :giro */ ASTNode.NodeList typeParameters = null; -// SH} +// SH} /** * The optional superclass name; <code>null</code> if none. * Defaults to none. Note that this field is not used for * interface declarations. Not used in 3.0. */ //{ObjectTeams: avoid private to allow access from RoleTypeDeclaration without duplicating this field -/* orig: +/* orig: private Name optionalSuperclassName = null; :giro */ Name optionalSuperclassName = null; -// SH} +// SH} /** - * The superinterface names (element type: <code>Name</code>). + * The superinterface names (element type: <code>Name</code>). * JLS2 only; defaults to an empty list. Not used in JLS3. * (see constructor). - * + * */ //{ObjectTeams: avoid private to allow access from RoleTypeDeclaration without duplicating this field -/* orig: +/* orig: private ASTNode.NodeList superInterfaceNames = null; :giro */ ASTNode.NodeList superInterfaceNames = null; -// SH} +// SH} /** * The optional superclass type; <code>null</code> if none. * Defaults to none. Note that this field is not used for @@ -318,35 +318,35 @@ public class TypeDeclaration extends AbstractTypeDeclaration { * @since 3.1 */ //{ObjectTeams: avoid private to allow access from RoleTypeDeclaration without duplicating this field -/* orig: +/* orig: private Type optionalSuperclassType = null; :giro */ Type optionalSuperclassType = null; -// SH} +// SH} /** - * The superinterface types (element type: <code>Type</code>). + * The superinterface types (element type: <code>Type</code>). * Null in JLS2. Added in JLS3; defaults to an empty list * (see constructor). * @since 3.1 */ //{ObjectTeams: avoid private to allow access from RoleTypeDeclaration without duplicating this field -/* orig: +/* orig: private ASTNode.NodeList superInterfaceTypes = null; :giro */ ASTNode.NodeList superInterfaceTypes = null; // SH} /** - * Creates a new AST node for a type declaration owned by the given + * Creates a new AST node for a type declaration owned by the given * AST. By default, the type declaration is for a class of an - * unspecified, but legal, name; no modifiers; no javadoc; + * unspecified, but legal, name; no modifiers; no javadoc; * no type parameters; no superclass or superinterfaces; and an empty list * of body declarations. * <p> - * N.B. This constructor is package-private; all subclasses must be - * declared in the same package; clients are unable to declare + * N.B. This constructor is package-private; all subclasses must be + * declared in the same package; clients are unable to declare * additional subclasses. * </p> - * + * * @param ast the AST that is to own this node */ TypeDeclaration(AST ast) { @@ -364,16 +364,16 @@ public class TypeDeclaration extends AbstractTypeDeclaration { * Method declared on ASTNode. * @since 3.0 */ -//{ObjectTeams: RoleTypeDeclaration can not inherit all methods, so final modifier removed +//{ObjectTeams: RoleTypeDeclaration can not inherit all methods, so final modifier removed /*final*/ List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } //ike} - + /* (omit javadoc for this method) * Method declared on ASTNode. */ -// {ObjectTeams: RoleTypeDeclaration can not inherit all methods, so final modifier removed +// {ObjectTeams: RoleTypeDeclaration can not inherit all methods, so final modifier removed /*final*/ int internalGetSetIntProperty(SimplePropertyDescriptor property, boolean get, int value) { // ike} if (property == MODIFIERS_PROPERTY) { @@ -391,7 +391,7 @@ public class TypeDeclaration extends AbstractTypeDeclaration { /* (omit javadoc for this method) * Method declared on ASTNode. */ -// {ObjectTeams: RoleTypeDeclaration can not inherit all methods, so final modifier removed +// {ObjectTeams: RoleTypeDeclaration can not inherit all methods, so final modifier removed /*final*/ boolean internalGetSetBooleanProperty(SimplePropertyDescriptor property, boolean get, boolean value) { // ike} if (property == INTERFACE_PROPERTY) { @@ -402,7 +402,7 @@ public class TypeDeclaration extends AbstractTypeDeclaration { return false; } } -//{ObjectTeams: cases for OT-specific properties added +//{ObjectTeams: cases for OT-specific properties added if (property == TEAM_PROPERTY) { if (get) @@ -425,17 +425,17 @@ public class TypeDeclaration extends AbstractTypeDeclaration { { setRole(value); return false; - } + } } //gbr} // allow default implementation to flag the error return super.internalGetSetBooleanProperty(property, get, value); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ -// {ObjectTeams: RoleTypeDeclaration can not inherit all methods, so final modifier removed +// {ObjectTeams: RoleTypeDeclaration can not inherit all methods, so final modifier removed /*final*/ ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) { // ike} if (property == JAVADOC_PROPERTY) { @@ -484,11 +484,11 @@ public class TypeDeclaration extends AbstractTypeDeclaration { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ -// {ObjectTeams: RoleTypeDeclaration can not inherit all methods, so final modifier removed +// {ObjectTeams: RoleTypeDeclaration can not inherit all methods, so final modifier removed /*final*/ List internalGetChildListProperty(ChildListPropertyDescriptor property) // ike} { @@ -515,11 +515,11 @@ public class TypeDeclaration extends AbstractTypeDeclaration { // allow default implementation to flag the error return super.internalGetChildListProperty(property); } - + /* (omit javadoc for this method) * Method declared on BodyDeclaration. */ -//{ObjectTeams: RoleTypeDeclaration can not inherit all methods, so final modifier removed +//{ObjectTeams: RoleTypeDeclaration can not inherit all methods, so final modifier removed /*final*/ ChildPropertyDescriptor internalJavadocProperty() { //ike} @@ -529,7 +529,7 @@ public class TypeDeclaration extends AbstractTypeDeclaration { /* (omit javadoc for this method) * Method declared on BodyDeclaration. */ -//{ObjectTeams: RoleTypeDeclaration can not inherit all methods, so final modifier removed +//{ObjectTeams: RoleTypeDeclaration can not inherit all methods, so final modifier removed /*final*/ ChildListPropertyDescriptor internalModifiers2Property() { //ike} @@ -539,7 +539,7 @@ public class TypeDeclaration extends AbstractTypeDeclaration { /* (omit javadoc for this method) * Method declared on BodyDeclaration. */ -//{ObjectTeams: RoleTypeDeclaration can not inherit all methods, so final modifier removed +//{ObjectTeams: RoleTypeDeclaration can not inherit all methods, so final modifier removed /*final*/ SimplePropertyDescriptor internalModifiersProperty() { //ike} @@ -549,14 +549,14 @@ public class TypeDeclaration extends AbstractTypeDeclaration { /* (omit javadoc for this method) * Method declared on AbstractTypeDeclaration. */ -//{ObjectTeams: RoleTypeDeclaration can not inherit all methods, so final modifier removed +//{ObjectTeams: RoleTypeDeclaration can not inherit all methods, so final modifier removed /*final*/ ChildPropertyDescriptor internalNameProperty() { //ike} return NAME_PROPERTY; } -//{ObjectTeams: new elements +//{ObjectTeams: new elements ChildPropertyDescriptor internalGuardPredicateProperty() { return GUARD_PROPERTY; } @@ -564,12 +564,12 @@ public class TypeDeclaration extends AbstractTypeDeclaration { return PRECEDENCE_PROPERTY; } // SH} - + /* (omit javadoc for this method) * Method declared on AbstractTypeDeclaration. */ -//{ObjectTeams: RoleTypeDeclaration can not inherit all methods, so final modifier removed - /*final*/ ChildListPropertyDescriptor internalBodyDeclarationsProperty() +//{ObjectTeams: RoleTypeDeclaration can not inherit all methods, so final modifier removed + /*final*/ ChildListPropertyDescriptor internalBodyDeclarationsProperty() { //ike} return BODY_DECLARATIONS_PROPERTY; @@ -579,7 +579,7 @@ public class TypeDeclaration extends AbstractTypeDeclaration { /* (omit javadoc for this method) * Method declared on ASTNode. */ -//{ObjectTeams: RoleTypeDeclaration can not inherit all methods, so final modifier removed +//{ObjectTeams: RoleTypeDeclaration can not inherit all methods, so final modifier removed /*final*/ int getNodeType0() { //ike} @@ -608,7 +608,7 @@ public class TypeDeclaration extends AbstractTypeDeclaration { result.setRole(isRole()); result.precedences().addAll(ASTNode.copySubtrees(target, precedences())); result.setGuardPredicate((GuardPredicateDeclaration)ASTNode.copySubtree(target, getGuardPredicate())); -//gbr} +//gbr} result.setName((SimpleName) getName().clone(target)); if (this.ast.apiLevel >= AST.JLS3) { result.modifiers().addAll(ASTNode.copySubtrees(target, modifiers())); @@ -627,13 +627,13 @@ public class TypeDeclaration extends AbstractTypeDeclaration { /* (omit javadoc for this method) * Method declared on ASTNode. */ -// {ObjectTeams: RoleTypeDeclaration can not inherit all methods, so final modifier removed +// {ObjectTeams: RoleTypeDeclaration can not inherit all methods, so final modifier removed /*final*/ boolean subtreeMatch0(ASTMatcher matcher, Object other) { //ike} // dispatch to correct overloaded match method return matcher.match(this, other); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -664,14 +664,14 @@ public class TypeDeclaration extends AbstractTypeDeclaration { } visitor.endVisit(this); } - -//{ObjectTeams: convenience methods for dealing with OT-specific types, i.e. teams/roles + +//{ObjectTeams: convenience methods for dealing with OT-specific types, i.e. teams/roles /** * Returns whether this type declaration declares a team class or a class. - * + * * @return <code>true</code> if this is a team class declaration, * and <code>false</code> if this is a class declaration - */ + */ @Override public boolean isTeam() { @@ -680,10 +680,10 @@ public class TypeDeclaration extends AbstractTypeDeclaration { /** * Sets wether this type declaration declares a team class or a class. - * + * * @param isTeam <code>true</code> if this is a team class * declaration, and <code>false</code> if this is a class declaration - */ + */ public void setTeam(boolean isTeam) { preValueChange(TEAM_PROPERTY); @@ -693,7 +693,7 @@ public class TypeDeclaration extends AbstractTypeDeclaration { /** * Returns whether this type declaration declares a role class or a class. - * + * * @return <code>true</code> if this is a role class declaration, * and <code>false</code> if this is a class declaration */ @@ -705,41 +705,41 @@ public class TypeDeclaration extends AbstractTypeDeclaration { /** * Sets whether this type declaration declares a role class or a class. - * + * * @param isRole <code>true</code> if this is a role class * declaration, and <code>false</code> if this is a class declaration - */ + */ public void setRole(boolean isRole) { preValueChange(ROLE_PROPERTY); _isRole = isRole; postValueChange(ROLE_PROPERTY); } - + public List precedences() { return _precedences; } //gbr} - + /** - * Returns whether this type declaration declares a class or an + * Returns whether this type declaration declares a class or an * interface. - * + * * @return <code>true</code> if this is an interface declaration, * and <code>false</code> if this is a class declaration - */ + */ public boolean isInterface() { return this.isInterface; } - + /** - * Sets whether this type declaration declares a class or an + * Sets whether this type declaration declares a class or an * interface. - * + * * @param isInterface <code>true</code> if this is an interface * declaration, and <code>false</code> if this is a class * declaration - */ + */ public void setInterface(boolean isInterface) { preValueChange(INTERFACE_PROPERTY); this.isInterface = isInterface; @@ -747,15 +747,15 @@ public class TypeDeclaration extends AbstractTypeDeclaration { } /** - * Returns the live ordered list of type parameters of this type + * Returns the live ordered list of type parameters of this type * declaration (added in JLS3 API). This list is non-empty for parameterized types. - * + * * @return the live list of type parameters * (element type: <code>TypeParameter</code>) * @exception UnsupportedOperationException if this operation is used in * a JLS2 AST * @since 3.1 - */ + */ public List typeParameters() { // more efficient than just calling unsupportedIn2() to check if (this.typeParameters == null) { @@ -763,28 +763,28 @@ public class TypeDeclaration extends AbstractTypeDeclaration { } return this.typeParameters; } - + /** * Returns the name of the superclass declared in this type * declaration, or <code>null</code> if there is none (JLS2 API only). * <p> - * Note that this child is not relevant for interface + * Note that this child is not relevant for interface * declarations (although it does still figure in subtree * equality comparisons). * </p> - * - * @return the superclass name node, or <code>null</code> if + * + * @return the superclass name node, or <code>null</code> if * there is none * @exception UnsupportedOperationException if this operation is used in * an AST later than JLS2 * @deprecated In the JLS3 API, this method is replaced by * {@link #getSuperclassType()}, which returns a <code>Type</code> * instead of a <code>Name</code>. - */ + */ public Name getSuperclass() { return internalGetSuperclass(); } - + /** * Internal synonym for deprecated method. Used to avoid * deprecation warnings. @@ -799,17 +799,17 @@ public class TypeDeclaration extends AbstractTypeDeclaration { * Returns the superclass declared in this type * declaration, or <code>null</code> if there is none (added in JLS3 API). * <p> - * Note that this child is not relevant for interface + * Note that this child is not relevant for interface * declarations (although it does still figure in subtree * equality comparisons). * </p> - * - * @return the superclass type node, or <code>null</code> if + * + * @return the superclass type node, or <code>null</code> if * there is none * @exception UnsupportedOperationException if this operation is used in * a JLS2 AST * @since 3.1 - */ + */ public Type getSuperclassType() { unsupportedIn2(); return this.optionalSuperclassType; @@ -819,12 +819,12 @@ public class TypeDeclaration extends AbstractTypeDeclaration { * Sets or clears the name of the superclass declared in this type * declaration (JLS2 API only). * <p> - * Note that this child is not relevant for interface + * Note that this child is not relevant for interface * declarations (although it does still figure in subtree * equality comparisons). * </p> - * - * @param superclassName the superclass name node, or <code>null</code> if + * + * @param superclassName the superclass name node, or <code>null</code> if * there is none * @exception IllegalArgumentException if: * <ul> @@ -833,14 +833,14 @@ public class TypeDeclaration extends AbstractTypeDeclaration { * </ul> * @exception UnsupportedOperationException if this operation is used in * an AST later than JLS2 - * @deprecated In the JLS3 API, this method is replaced by + * @deprecated In the JLS3 API, this method is replaced by * {@link #setSuperclassType(Type)}, which expects a * <code>Type</code> instead of a <code>Name</code>. - */ + */ public void setSuperclass(Name superclassName) { internalSetSuperclass(superclassName); } - + /** * Internal synonym for deprecated method. Used to avoid * deprecation warnings. @@ -861,8 +861,8 @@ public class TypeDeclaration extends AbstractTypeDeclaration { * Note that this child is not relevant for interface declarations * (although it does still figure in subtree equality comparisons). * </p> - * - * @param superclassType the superclass type node, or <code>null</code> if + * + * @param superclassType the superclass type node, or <code>null</code> if * there is none * @exception IllegalArgumentException if: * <ul> @@ -872,7 +872,7 @@ public class TypeDeclaration extends AbstractTypeDeclaration { * @exception UnsupportedOperationException if this operation is used in * a JLS2 AST * @since 3.1 - */ + */ public void setSuperclassType(Type superclassType) { unsupportedIn2(); ASTNode oldChild = this.optionalSuperclassType; @@ -882,23 +882,23 @@ public class TypeDeclaration extends AbstractTypeDeclaration { } /** - * Returns the live ordered list of names of superinterfaces of this type + * Returns the live ordered list of names of superinterfaces of this type * declaration (JLS2 API only). For a class declaration, these are the names * of the interfaces that this class implements; for an interface * declaration, these are the names of the interfaces that this interface * extends. - * + * * @return the live list of interface names * (element type: <code>Name</code>) * @exception UnsupportedOperationException if this operation is used in * an AST later than JLS2 - * @deprecated In the JLS3 API, this method is replaced by + * @deprecated In the JLS3 API, this method is replaced by * {@link #superInterfaceTypes()}. - */ + */ public List superInterfaces() { return internalSuperInterfaces(); } - + /** * Internal synonym for deprecated method. Used to avoid * deprecation warnings. @@ -911,19 +911,19 @@ public class TypeDeclaration extends AbstractTypeDeclaration { } return this.superInterfaceNames; } - + /** - * Returns the live ordered list of superinterfaces of this type + * Returns the live ordered list of superinterfaces of this type * declaration (added in JLS3 API). For a class declaration, these are the interfaces * that this class implements; for an interface declaration, * these are the interfaces that this interface extends. - * + * * @return the live list of interface types * (element type: <code>Type</code>) * @exception UnsupportedOperationException if this operation is used in * a JLS2 AST * @since 3.1 - */ + */ public List superInterfaceTypes() { // more efficient than just calling unsupportedIn2() to check if (this.superInterfaceTypes == null) { @@ -931,9 +931,9 @@ public class TypeDeclaration extends AbstractTypeDeclaration { } return this.superInterfaceTypes; } - + /** - * Returns the ordered list of field declarations of this type + * Returns the ordered list of field declarations of this type * declaration. For a class declaration, these are the * field declarations; for an interface declaration, these are * the constant declarations. @@ -942,9 +942,9 @@ public class TypeDeclaration extends AbstractTypeDeclaration { * with non-fields filtered out. Unlike <code>bodyDeclarations</code>, * this method does not return a live result. * </p> - * + * * @return the (possibly empty) list of field declarations - */ + */ public FieldDeclaration[] getFields() { List bd = bodyDeclarations(); int fieldCount = 0; @@ -965,17 +965,17 @@ public class TypeDeclaration extends AbstractTypeDeclaration { } /** - * Returns the ordered list of method declarations of this type + * Returns the ordered list of method declarations of this type * declaration. * <p> * This convenience method returns this node's body declarations * with non-methods filtered out. Unlike <code>bodyDeclarations</code>, * this method does not return a live result. * </p> - * - * @return the (possibly empty) list of method (and constructor) + * + * @return the (possibly empty) list of method (and constructor) * declarations - */ + */ public MethodDeclaration[] getMethods() { List bd = bodyDeclarations(); int methodCount = 0; @@ -997,16 +997,16 @@ public class TypeDeclaration extends AbstractTypeDeclaration { //{ObjectTeams: method getRoles() /** - * Returns the ordered list of role type declarations of this type + * Returns the ordered list of role type declarations of this type * declaration. * <p> * This convenience method returns this node's body declarations * with non-roles filtered out. Unlike <code>bodyDeclarations</code>, * this method does not return a live result. * </p> - * + * * @return the (possibly empty) list of role type declarations - */ + */ public RoleTypeDeclaration[] getRoles() { List bd = bodyDeclarations(); int roleCount = 0; @@ -1038,18 +1038,18 @@ public class TypeDeclaration extends AbstractTypeDeclaration { } //jsv} - + /** - * Returns the ordered list of member type declarations of this type + * Returns the ordered list of member type declarations of this type * declaration. * <p> * This convenience method returns this node's body declarations * with non-types filtered out. Unlike <code>bodyDeclarations</code>, * this method does not return a live result. * </p> - * + * * @return the (possibly empty) list of member type declarations - */ + */ public TypeDeclaration[] getTypes() { List bd = bodyDeclarations(); int typeCount = 0; @@ -1075,14 +1075,14 @@ public class TypeDeclaration extends AbstractTypeDeclaration { ITypeBinding internalResolveBinding() { return this.ast.getBindingResolver().resolveType(this); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int memSize() { return super.memSize() + 6 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeDeclarationStatement.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeDeclarationStatement.java index 107800c0a..b8d2c4fd9 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeDeclarationStatement.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeDeclarationStatement.java @@ -32,50 +32,50 @@ import java.util.List; * EnumDeclaration * </pre> * Although allowed at the AST, not all arrangements of AST nodes are meaningful; - * in particular, only class and enum declarations are meaningful in the context of + * in particular, only class and enum declarations are meaningful in the context of * a block. - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ public class TypeDeclarationStatement extends Statement { - + /** * The "typeDeclaration" structural property of this node type (JLS2 API only). * @since 3.0 */ - public static final ChildPropertyDescriptor TYPE_DECLARATION_PROPERTY = + public static final ChildPropertyDescriptor TYPE_DECLARATION_PROPERTY = new ChildPropertyDescriptor(TypeDeclarationStatement.class, "typeDeclaration", TypeDeclaration.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ /** * The "declaration" structural property of this node type (added in JLS3 API). * @since 3.1 */ - public static final ChildPropertyDescriptor DECLARATION_PROPERTY = + public static final ChildPropertyDescriptor DECLARATION_PROPERTY = new ChildPropertyDescriptor(TypeDeclarationStatement.class, "declaration", AbstractTypeDeclaration.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. * @since 3.0 */ private static final List PROPERTY_DESCRIPTORS_2_0; - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. * @since 3.1 */ private static final List PROPERTY_DESCRIPTORS_3_0; - + static { List propertyList = new ArrayList(2); createPropertyList(TypeDeclarationStatement.class, propertyList); addProperty(TYPE_DECLARATION_PROPERTY, propertyList); PROPERTY_DESCRIPTORS_2_0 = reapPropertyList(propertyList); - + propertyList = new ArrayList(2); createPropertyList(TypeDeclarationStatement.class, propertyList); addProperty(DECLARATION_PROPERTY, propertyList); @@ -85,11 +85,11 @@ public class TypeDeclarationStatement extends Statement { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ @@ -100,20 +100,20 @@ public class TypeDeclarationStatement extends Statement { return PROPERTY_DESCRIPTORS_3_0; } } - + /** - * The type declaration; lazily initialized; defaults to a unspecified, + * The type declaration; lazily initialized; defaults to a unspecified, * but legal, type declaration. In JLS2, corresponds to TYPE_DECLARATION_PROPERTY. * After JLS2, corresponds to DECLARATION_PROPERTY. * @see #typeDeclProperty */ private AbstractTypeDeclaration typeDecl = null; - + /** * The child property stored on the <code>typeDecl</code> instance variable. - * In JLS2, corresponds to TYPE_DECLARATION_PROPERTY. After JLS2, corresponds to + * In JLS2, corresponds to TYPE_DECLARATION_PROPERTY. After JLS2, corresponds to * DECLARATION_PROPERTY. - * + * * @return the property corresponding to the <code>typeDecl</code> instance variable; * never <code>null</code> */ @@ -127,13 +127,13 @@ public class TypeDeclarationStatement extends Statement { /** - * Creates a new unparented local type declaration statement node owned + * Creates a new unparented local type declaration statement node owned * by the given AST. By default, the local type declaration is an * unspecified, but legal, type declaration. * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ TypeDeclarationStatement(AST ast) { @@ -147,7 +147,7 @@ public class TypeDeclarationStatement extends Statement { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -171,7 +171,7 @@ public class TypeDeclarationStatement extends Statement { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -183,7 +183,7 @@ public class TypeDeclarationStatement extends Statement { * Method declared on ASTNode. */ ASTNode clone0(AST target) { - TypeDeclarationStatement result = + TypeDeclarationStatement result = new TypeDeclarationStatement(target); result.setSourceRange(getStartPosition(), getLength()); result.copyLeadingComment(this); @@ -191,7 +191,7 @@ public class TypeDeclarationStatement extends Statement { (AbstractTypeDeclaration) getDeclaration().clone(target)); return result; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -210,14 +210,14 @@ public class TypeDeclarationStatement extends Statement { } visitor.endVisit(this); } - + /** * Returns the abstract type declaration of this local type declaration * statement (added in JLS3 API). - * + * * @return the type declaration node * @since 3.1 - */ + */ public AbstractTypeDeclaration getDeclaration() { if (this.typeDecl == null) { // lazy init must be thread-safe for readers @@ -231,11 +231,11 @@ public class TypeDeclarationStatement extends Statement { } return this.typeDecl; } - + /** * Sets the abstract type declaration of this local type declaration * statement (added in JLS3 API). - * + * * @param decl the type declaration node * @exception IllegalArgumentException if: * <ul> @@ -244,12 +244,12 @@ public class TypeDeclarationStatement extends Statement { * <li>a cycle in would be created</li> * </ul> * @since 3.1 - */ + */ public void setDeclaration(AbstractTypeDeclaration decl) { if (decl == null) { throw new IllegalArgumentException(); } - // a TypeDeclarationStatement may occur inside an + // a TypeDeclarationStatement may occur inside an // TypeDeclaration - must check cycles ASTNode oldChild = this.typeDecl; ChildPropertyDescriptor typeDeclProperty = typeDeclProperty(); @@ -257,22 +257,22 @@ public class TypeDeclarationStatement extends Statement { this.typeDecl= decl; postReplaceChild(oldChild, decl, typeDeclProperty); } - + /** * Returns the type declaration of this local type declaration * statement (JLS2 API only). - * + * * @return the type declaration node * @exception UnsupportedOperationException if this operation is used in * an AST later than JLS2 - * @deprecated In the JLS3 API, this method is replaced by + * @deprecated In the JLS3 API, this method is replaced by * {@link #getDeclaration()}, which returns <code>AbstractTypeDeclaration</code> * instead of <code>TypeDeclaration</code>. - */ + */ public TypeDeclaration getTypeDeclaration() { return internalGetTypeDeclaration(); } - + /** * Internal synonym for deprecated method. Used to avoid * deprecation warnings. @@ -282,11 +282,11 @@ public class TypeDeclarationStatement extends Statement { supportedOnlyIn2(); return (TypeDeclaration) getDeclaration(); } - + /** * Sets the type declaration of this local type declaration * statement (JLS2 API only). - * + * * @param decl the type declaration node * @exception IllegalArgumentException if: * <ul> @@ -296,15 +296,15 @@ public class TypeDeclarationStatement extends Statement { * </ul> * @exception UnsupportedOperationException if this operation is used in * an AST later than JLS2 - * @deprecated In the JLS3 API, this method is replaced by + * @deprecated In the JLS3 API, this method is replaced by * {@link #setDeclaration(AbstractTypeDeclaration)} which takes * <code>AbstractTypeDeclaration</code> instead of * <code>TypeDeclaration</code>. - */ + */ public void setTypeDeclaration(TypeDeclaration decl) { internalSetTypeDeclaration(decl); } - + /** * Internal synonym for deprecated method. Used to avoid * deprecation warnings. @@ -315,7 +315,7 @@ public class TypeDeclarationStatement extends Statement { // forward to non-deprecated replacement method setDeclaration(decl); } - + /** * Resolves and returns the binding for the class or interface declared in * this type declaration statement. @@ -323,10 +323,10 @@ public class TypeDeclarationStatement extends Statement { * Note that bindings are generally unavailable unless requested when the * AST is being built. * </p> - * - * @return the binding, or <code>null</code> if the binding cannot be + * + * @return the binding, or <code>null</code> if the binding cannot be * resolved - */ + */ public ITypeBinding resolveBinding() { // forward request to the wrapped type declaration AbstractTypeDeclaration d = getDeclaration(); @@ -339,14 +339,14 @@ public class TypeDeclarationStatement extends Statement { return null; } } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int memSize() { return super.memSize() + 1 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeLiteral.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeLiteral.java index fca75acb7..bed1fa173 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeLiteral.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeLiteral.java @@ -21,7 +21,7 @@ import java.util.List; * TypeLiteral: * ( Type | <b>void</b> ) <b>.</b> <b>class</b> * </pre> - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ @@ -31,16 +31,16 @@ public class TypeLiteral extends Expression { * The "type" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor TYPE_PROPERTY = + public static final ChildPropertyDescriptor TYPE_PROPERTY = new ChildPropertyDescriptor(TypeLiteral.class, "type", Type.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List propertyList = new ArrayList(2); createPropertyList(TypeLiteral.class, propertyList); @@ -51,17 +51,17 @@ public class TypeLiteral extends Expression { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** * The type; lazily initialized; defaults to a unspecified, * legal type. @@ -69,12 +69,12 @@ public class TypeLiteral extends Expression { private Type type = null; /** - * Creates a new AST node for a type literal owned by the given + * Creates a new AST node for a type literal owned by the given * AST. By default, the expression has an unspecified (but legal) type. * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ TypeLiteral(AST ast) { @@ -87,7 +87,7 @@ public class TypeLiteral extends Expression { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -103,7 +103,7 @@ public class TypeLiteral extends Expression { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -139,12 +139,12 @@ public class TypeLiteral extends Expression { } visitor.endVisit(this); } - + /** * Returns the type in this type literal expression. - * + * * @return the type - */ + */ public Type getType() { if (this.type == null) { // lazy init must be thread-safe for readers @@ -161,14 +161,14 @@ public class TypeLiteral extends Expression { /** * Sets the type in this type literal expression to the given type. - * + * * @param type the new type * @exception IllegalArgumentException if: * <ul> * <li>the node belongs to a different AST</li> * <li>the node already has a parent</li> * </ul> - */ + */ public void setType(Type type) { if (type == null) { throw new IllegalArgumentException(); @@ -186,12 +186,12 @@ public class TypeLiteral extends Expression { // treat Operator as free return BASE_NODE_SIZE + 1 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int treeSize() { - return + return memSize() + (this.type == null ? 0 : getType().treeSize()); } diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeParameter.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeParameter.java index 940302dd1..e5ee09d80 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeParameter.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/TypeParameter.java @@ -21,38 +21,38 @@ import java.util.List; * TypeParameter: * TypeVariable [ <b>extends</b> Type { <b>&</b> Type } ] * </pre> - * + * * @since 3.1 * @noinstantiate This class is not intended to be instantiated by clients. */ public class TypeParameter extends ASTNode { - + /** * The "name" structural property of this node type. */ - public static final ChildPropertyDescriptor NAME_PROPERTY = + public static final ChildPropertyDescriptor NAME_PROPERTY = new ChildPropertyDescriptor(TypeParameter.class, "name", SimpleName.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ /** * The "typeBounds" structural property of this node type. */ - public static final ChildListPropertyDescriptor TYPE_BOUNDS_PROPERTY = + public static final ChildListPropertyDescriptor TYPE_BOUNDS_PROPERTY = new ChildListPropertyDescriptor(TypeParameter.class, "typeBounds", Type.class, NO_CYCLE_RISK); //$NON-NLS-1$ //{ObjectTeams: distinguish value parameters and <B base R>: - public static final SimplePropertyDescriptor VALUE_PARAMETER_PROPERTY = + public static final SimplePropertyDescriptor VALUE_PARAMETER_PROPERTY = new SimplePropertyDescriptor(TypeParameter.class, "valueParameter", boolean.class, MANDATORY); //$NON-NLS-1$ - public static final SimplePropertyDescriptor BASE_BOUND_PROPERTY = + public static final SimplePropertyDescriptor BASE_BOUND_PROPERTY = new SimplePropertyDescriptor(TypeParameter.class, "baseBound", boolean.class, MANDATORY); //$NON-NLS-1$ // SH} /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List propertyList = new ArrayList(3); createPropertyList(TypeParameter.class, propertyList); @@ -68,42 +68,42 @@ public class TypeParameter extends ASTNode { private boolean isValueParameter= false; private boolean hasBaseBound= false; //SH} - + /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - - /** - * The type variable node; lazily initialized; defaults to an unspecfied, + + /** + * The type variable node; lazily initialized; defaults to an unspecfied, * but legal, name. */ private SimpleName typeVariableName = null; - + /** - * The type bounds (element type: <code>Type</code>). + * The type bounds (element type: <code>Type</code>). * Defaults to an empty list. */ private ASTNode.NodeList typeBounds = new ASTNode.NodeList(TYPE_BOUNDS_PROPERTY); - + /** * Creates a new unparented node for a parameterized type owned by the - * given AST. By default, an unspecified, but legal, type variable name, + * given AST. By default, an unspecified, but legal, type variable name, * and no type bounds. * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ TypeParameter(AST ast) { @@ -117,7 +117,7 @@ public class TypeParameter extends ASTNode { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -133,8 +133,8 @@ public class TypeParameter extends ASTNode { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - -//{ObjectTeams: value parameter? + +//{ObjectTeams: value parameter? boolean internalGetSetBooleanProperty(SimplePropertyDescriptor property, boolean get, boolean value) { if (property == VALUE_PARAMETER_PROPERTY) { if (get) { @@ -158,7 +158,7 @@ public class TypeParameter extends ASTNode { // allow default implementation to flag the error return super.internalGetChildListProperty(property); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -201,12 +201,12 @@ public class TypeParameter extends ASTNode { } visitor.endVisit(this); } - + /** * Returns the name of the type variable declared in this type parameter. - * + * * @return the name of the type variable - */ + */ public SimpleName getName() { if (this.typeVariableName == null) { // lazy init must be thread-safe for readers @@ -220,32 +220,32 @@ public class TypeParameter extends ASTNode { } return this.typeVariableName; } - + /** * Resolves and returns the binding for this type parameter. * <p> * Note that bindings are generally unavailable unless requested when the * AST is being built. * </p> - * - * @return the binding, or <code>null</code> if the binding cannot be + * + * @return the binding, or <code>null</code> if the binding cannot be * resolved - */ + */ public final ITypeBinding resolveBinding() { return this.ast.getBindingResolver().resolveTypeParameter(this); } - + /** * Sets the name of the type variable of this type parameter to the given * name. - * - * @param typeName the new name of this type parameter + * + * @param typeName the new name of this type parameter * @exception IllegalArgumentException if: * <ul> * <li>the node belongs to a different AST</li> * <li>the node already has a parent</li> * </ul> - */ + */ public void setName(SimpleName typeName) { if (typeName == null) { throw new IllegalArgumentException(); @@ -262,25 +262,25 @@ public class TypeParameter extends ASTNode { * class in the list, and it must be first, and the remaining ones must be * interfaces; the list should not contain primitive types (but array types * and parameterized types are allowed). - * + * * @return the live list of type bounds * (element type: <code>Type</code>) - */ + */ public List typeBounds() { return this.typeBounds; } - + //{ObjectTeams: value parameters & <B base R>: /** * Returns whether this type parameter is a value parameter. - */ + */ public boolean isValueParameter() { return this.isValueParameter; } - + /** * Sets whether this type parameter is a value parameter. - */ + */ public void setIsValueParameter(boolean isValueParameter) { preValueChange(VALUE_PARAMETER_PROPERTY); this.isValueParameter= isValueParameter; @@ -289,21 +289,21 @@ public class TypeParameter extends ASTNode { /** * Returns whether this type parameter has a "base" bound. - */ + */ public boolean hasBaseBound() { return this.hasBaseBound; } - + /** * Sets whether this type parameter has a "base" bound. - */ + */ public void setHasBaseBound(boolean hasBaseBound) { preValueChange(BASE_BOUND_PROPERTY); this.hasBaseBound = hasBaseBound; postValueChange(BASE_BOUND_PROPERTY); } // SH} - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -311,12 +311,12 @@ public class TypeParameter extends ASTNode { // treat Code as free return BASE_NODE_SIZE + 2 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int treeSize() { - return + return memSize() + (this.typeVariableName == null ? 0 : getName().treeSize()) + this.typeBounds.listSize(); diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/VariableBinding.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/VariableBinding.java index cb77d0f1f..afc79fae1 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/VariableBinding.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/VariableBinding.java @@ -46,7 +46,7 @@ class VariableBinding implements IVariableBinding { private BindingResolver resolver; private ITypeBinding type; private IAnnotationBinding[] annotations; - + VariableBinding(BindingResolver resolver, org.eclipse.jdt.internal.compiler.lookup.VariableBinding binding) { this.resolver = resolver; this.binding = binding; @@ -173,7 +173,7 @@ class VariableBinding implements IVariableBinding { default: node = node.getParent(); } - } + } } return null; } diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/VariableDeclaration.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/VariableDeclaration.java index 9abc14ad7..3aabae307 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/VariableDeclaration.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/VariableDeclaration.java @@ -12,7 +12,7 @@ package org.eclipse.jdt.core.dom; /** - * Abstract base class of all AST node types that declare a single local + * Abstract base class of all AST node types that declare a single local * variable. * <p> * <pre> @@ -21,17 +21,17 @@ package org.eclipse.jdt.core.dom; * VariableDeclarationFragment * </pre> * </p> - * + * * @see SingleVariableDeclaration * @see VariableDeclarationFragment * @since 2.0 */ public abstract class VariableDeclaration extends ASTNode { - + /** * Returns structural property descriptor for the "extraDimensions" property * of this node. - * + * * @return the property descriptor * @since 3.1 */ @@ -40,7 +40,7 @@ public abstract class VariableDeclaration extends ASTNode { /** * Returns structural property descriptor for the "extraDimensions" property * of this node. - * + * * @return the property descriptor * @since 3.1 */ @@ -51,7 +51,7 @@ public abstract class VariableDeclaration extends ASTNode { /** * Returns structural property descriptor for the "initializer" property * of this node. - * + * * @return the property descriptor * @since 3.1 */ @@ -60,7 +60,7 @@ public abstract class VariableDeclaration extends ASTNode { /** * Returns structural property descriptor for the "initializer" property * of this node. - * + * * @return the property descriptor * @since 3.1 */ @@ -71,7 +71,7 @@ public abstract class VariableDeclaration extends ASTNode { /** * Returns structural property descriptor for the "name" property * of this node. - * + * * @return the property descriptor * @since 3.1 */ @@ -80,7 +80,7 @@ public abstract class VariableDeclaration extends ASTNode { /** * Returns structural property descriptor for the "name" property * of this node. - * + * * @return the property descriptor * @since 3.1 */ @@ -93,81 +93,81 @@ public abstract class VariableDeclaration extends ASTNode { * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ VariableDeclaration(AST ast) { super(ast); } - + /** * Returns the name of the variable declared in this variable declaration. - * + * * @return the variable name node - */ + */ public abstract SimpleName getName(); - + /** - * Sets the name of the variable declared in this variable declaration + * Sets the name of the variable declared in this variable declaration * to the given name. - * + * * @param variableName the new variable name * @exception IllegalArgumentException if: * <ul> * <li>the node belongs to a different AST</li> * <li>the node already has a parent</li> * </ul> - */ + */ public abstract void setName(SimpleName variableName); /** - * Returns the number of extra array dimensions over and above the + * Returns the number of extra array dimensions over and above the * explicitly-specified type. * <p> - * For example, <code>int x[][]</code> has a type of - * <code>int</code> and two extra array dimensions; + * For example, <code>int x[][]</code> has a type of + * <code>int</code> and two extra array dimensions; * <code>int[][] x</code> has a type of <code>int[][]</code> * and zero extra array dimensions. The two constructs have different * ASTs, even though there are really syntactic variants of the same * variable declaration. * </p> - * + * * @return the number of extra array dimensions * @since 2.1 - */ + */ public abstract int getExtraDimensions(); /** - * Sets the number of extra array dimensions over and above the + * Sets the number of extra array dimensions over and above the * explicitly-specified type. * <p> - * For example, <code>int x[][]</code> has a type of - * <code>int</code> and two extra array dimensions; + * For example, <code>int x[][]</code> has a type of + * <code>int</code> and two extra array dimensions; * <code>int[][] x</code> has a type of <code>int[][]</code> * and zero extra array dimensions. The two constructs have different * ASTs, even though there are really syntactic variants of the same * variable declaration. * </p> - * + * * @param dimensions the number of array dimensions * @exception IllegalArgumentException if the number of dimensions is * negative * @since 2.1 - */ + */ public abstract void setExtraDimensions(int dimensions); /** - * Returns the initializer of this variable declaration, or + * Returns the initializer of this variable declaration, or * <code>null</code> if there is none. - * - * @return the initializer expression node, or <code>null</code> if + * + * @return the initializer expression node, or <code>null</code> if * there is none - */ + */ public abstract Expression getInitializer(); - + /** * Sets or clears the initializer of this variable declaration. - * + * * @param initializer the initializer expression node, or <code>null</code> * if there is none * @exception IllegalArgumentException if: @@ -176,7 +176,7 @@ public abstract class VariableDeclaration extends ASTNode { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public abstract void setInitializer(Expression initializer); /** @@ -186,10 +186,10 @@ public abstract class VariableDeclaration extends ASTNode { * Note that bindings are generally unavailable unless requested when the * AST is being built. * </p> - * - * @return the binding, or <code>null</code> if the binding cannot be + * + * @return the binding, or <code>null</code> if the binding cannot be * resolved - */ + */ public IVariableBinding resolveBinding() { return this.ast.getBindingResolver().resolveVariable(this); } diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/VariableDeclarationExpression.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/VariableDeclarationExpression.java index e02331c43..36e515879 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/VariableDeclarationExpression.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/VariableDeclarationExpression.java @@ -29,16 +29,16 @@ import java.util.List; * <pre> * VariableDeclarationExpression: * { Modifier } Type VariableDeclarationFragment - * { <b>,</b> VariableDeclarationFragment } + * { <b>,</b> VariableDeclarationFragment } * </pre> * For JLS3, the modifier flags were replaced by * a list of modifier nodes (intermixed with annotations): * <pre> * VariableDeclarationExpression: * { ExtendedModifier } Type VariableDeclarationFragment - * { <b>,</b> VariableDeclarationFragment } + * { <b>,</b> VariableDeclarationFragment } * </pre> - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ @@ -48,46 +48,46 @@ public class VariableDeclarationExpression extends Expression { * The "modifiers" structural property of this node type (JLS2 API only). * @since 3.0 */ - public static final SimplePropertyDescriptor MODIFIERS_PROPERTY = + public static final SimplePropertyDescriptor MODIFIERS_PROPERTY = new SimplePropertyDescriptor(VariableDeclarationExpression.class, "modifiers", int.class, MANDATORY); //$NON-NLS-1$ - + /** * The "modifiers" structural property of this node type (added in JLS3 API). * @since 3.1 */ - public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = + public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = new ChildListPropertyDescriptor(VariableDeclarationExpression.class, "modifiers", IExtendedModifier.class, CYCLE_RISK); //$NON-NLS-1$ - + /** * The "type" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor TYPE_PROPERTY = + public static final ChildPropertyDescriptor TYPE_PROPERTY = new ChildPropertyDescriptor(VariableDeclarationExpression.class, "type", Type.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ /** * The "fragments" structural property of this node type). * @since 3.0 */ - public static final ChildListPropertyDescriptor FRAGMENTS_PROPERTY = + public static final ChildListPropertyDescriptor FRAGMENTS_PROPERTY = new ChildListPropertyDescriptor(VariableDeclarationExpression.class, "fragments", VariableDeclarationFragment.class, CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. * @since 3.0 */ private static final List PROPERTY_DESCRIPTORS_2_0; - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. * @since 3.1 */ private static final List PROPERTY_DESCRIPTORS_3_0; - + static { List propertyList = new ArrayList(4); createPropertyList(VariableDeclarationExpression.class, propertyList); @@ -95,7 +95,7 @@ public class VariableDeclarationExpression extends Expression { addProperty(TYPE_PROPERTY, propertyList); addProperty(FRAGMENTS_PROPERTY, propertyList); PROPERTY_DESCRIPTORS_2_0 = reapPropertyList(propertyList); - + propertyList = new ArrayList(4); createPropertyList(VariableDeclarationExpression.class, propertyList); addProperty(MODIFIERS2_PROPERTY, propertyList); @@ -107,11 +107,11 @@ public class VariableDeclarationExpression extends Expression { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ @@ -122,21 +122,21 @@ public class VariableDeclarationExpression extends Expression { return PROPERTY_DESCRIPTORS_3_0; } } - + /** - * The extended modifiers (element type: <code>IExtendedModifier</code>). + * The extended modifiers (element type: <code>IExtendedModifier</code>). * Null in JLS2. Added in JLS3; defaults to an empty list * (see constructor). * @since 3.0 */ private ASTNode.NodeList modifiers = null; - + /** * The modifier flags; bit-wise or of Modifier flags. * Defaults to none. Not used in 3.0. */ private int modifierFlags = Modifier.NONE; - + /** * The base type; lazily initialized; defaults to an unspecified, * legal type. @@ -144,10 +144,10 @@ public class VariableDeclarationExpression extends Expression { private Type baseType = null; /** - * The list of variable declaration fragments (element type: + * The list of variable declaration fragments (element type: * {@link VariableDeclarationFragment}). Defaults to an empty list. */ - private ASTNode.NodeList variableDeclarationFragments = + private ASTNode.NodeList variableDeclarationFragments = new ASTNode.NodeList(FRAGMENTS_PROPERTY); /** @@ -158,7 +158,7 @@ public class VariableDeclarationExpression extends Expression { * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ VariableDeclarationExpression(AST ast) { @@ -174,7 +174,7 @@ public class VariableDeclarationExpression extends Expression { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -190,7 +190,7 @@ public class VariableDeclarationExpression extends Expression { // allow default implementation to flag the error return super.internalGetSetIntProperty(property, get, value); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -206,7 +206,7 @@ public class VariableDeclarationExpression extends Expression { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -220,7 +220,7 @@ public class VariableDeclarationExpression extends Expression { // allow default implementation to flag the error return super.internalGetChildListProperty(property); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -232,7 +232,7 @@ public class VariableDeclarationExpression extends Expression { * Method declared on ASTNode. */ ASTNode clone0(AST target) { - VariableDeclarationExpression result = + VariableDeclarationExpression result = new VariableDeclarationExpression(target); result.setSourceRange(getStartPosition(), getLength()); if (this.ast.apiLevel == AST.JLS2_INTERNAL) { @@ -247,7 +247,7 @@ public class VariableDeclarationExpression extends Expression { return result; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -271,7 +271,7 @@ public class VariableDeclarationExpression extends Expression { } visitor.endVisit(this); } - + /** * Returns the live ordered list of modifiers and annotations * of this declaration (added in JLS3 API). @@ -279,13 +279,13 @@ public class VariableDeclarationExpression extends Expression { * Note that the final modifier is the only meaningful modifier for local * variable declarations. * </p> - * + * * @return the live list of modifiers and annotations * (element type: <code>IExtendedModifier</code>) * @exception UnsupportedOperationException if this operation is used in * a JLS2 AST * @since 3.1 - */ + */ public List modifiers() { // more efficient than just calling unsupportedIn2() to check if (this.modifiers == null) { @@ -293,17 +293,17 @@ public class VariableDeclarationExpression extends Expression { } return this.modifiers; } - + /** * Returns the modifiers explicitly specified on this declaration. * <p> * In the JLS3 API, this method is a convenience method that * computes these flags from <code>modifiers()</code>. * </p> - * + * * @return the bit-wise or of <code>Modifier</code> constants * @see Modifier - */ + */ public int getModifiers() { // more efficient than checking getAST().API_LEVEL if (this.modifiers == null) { @@ -330,18 +330,18 @@ public class VariableDeclarationExpression extends Expression { * Note that the final modifier is the only meaningful modifier for local * variable declarations. * </p> - * + * * @param modifiers the given modifiers (bit-wise or of <code>Modifier</code> constants) * @exception UnsupportedOperationException if this operation is used in * an AST later than JLS2 * @see Modifier - * @deprecated In the JLS3 API, this method is replaced by + * @deprecated In the JLS3 API, this method is replaced by * {@link #modifiers()} which contains a list of a <code>Modifier</code> nodes. - */ + */ public void setModifiers(int modifiers) { internalSetModifiers(modifiers); } - + /** * Internal synonym for deprecated method. Used to avoid * deprecation warnings. @@ -357,13 +357,13 @@ public class VariableDeclarationExpression extends Expression { /** * Returns the base type declared in this variable declaration. * <p> - * N.B. The individual child variable declaration fragments may specify - * additional array dimensions. So the type of the variable are not + * N.B. The individual child variable declaration fragments may specify + * additional array dimensions. So the type of the variable are not * necessarily exactly this type. * </p> - * + * * @return the base type - */ + */ public Type getType() { if (this.baseType == null) { // lazy init must be thread-safe for readers @@ -381,14 +381,14 @@ public class VariableDeclarationExpression extends Expression { /** * Sets the base type declared in this variable declaration to the given * type. - * + * * @param type the new base type * @exception IllegalArgumentException if: * <ul> * <li>the node belongs to a different AST</li> * <li>the node already has a parent</li> * </ul> - */ + */ public void setType(Type type) { if (type == null) { throw new IllegalArgumentException(); @@ -400,15 +400,15 @@ public class VariableDeclarationExpression extends Expression { } /** - * Returns the live list of variable declaration fragments in this + * Returns the live list of variable declaration fragments in this * expression. Adding and removing nodes from this list affects this node - * dynamically. All nodes in this list must be + * dynamically. All nodes in this list must be * <code>VariableDeclarationFragment</code>s; attempts to add any other * type of node will trigger an exception. - * - * @return the live list of variable declaration fragments in this + * + * @return the live list of variable declaration fragments in this * expression (element type: <code>VariableDeclarationFragment</code>) - */ + */ public List fragments() { return this.variableDeclarationFragments; } @@ -420,12 +420,12 @@ public class VariableDeclarationExpression extends Expression { // treat Operator as free return BASE_NODE_SIZE + 4 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int treeSize() { - return + return memSize() + (this.modifiers == null ? 0 : this.modifiers.listSize()) + (this.baseType == null ? 0 : getType().treeSize()) diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/VariableDeclarationFragment.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/VariableDeclarationFragment.java index efacf8ebc..559e5adec 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/VariableDeclarationFragment.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/VariableDeclarationFragment.java @@ -15,7 +15,7 @@ import java.util.ArrayList; import java.util.List; /** - * Variable declaration fragment AST node type, used in field declarations, + * Variable declaration fragment AST node type, used in field declarations, * local variable declarations, and <code>ForStatement</code> initializers. * It contrast to <code>SingleVariableDeclaration</code>, fragments are * missing the modifiers and the type; these are located in the fragment's @@ -25,41 +25,41 @@ import java.util.List; * VariableDeclarationFragment: * Identifier { <b>[</b><b>]</b> } [ <b>=</b> Expression ] * </pre> - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ public class VariableDeclarationFragment extends VariableDeclaration { - + /** * The "name" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor NAME_PROPERTY = + public static final ChildPropertyDescriptor NAME_PROPERTY = new ChildPropertyDescriptor(VariableDeclarationFragment.class, "name", SimpleName.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ /** * The "extraDimensions" structural property of this node type. * @since 3.0 */ - public static final SimplePropertyDescriptor EXTRA_DIMENSIONS_PROPERTY = + public static final SimplePropertyDescriptor EXTRA_DIMENSIONS_PROPERTY = new SimplePropertyDescriptor(VariableDeclarationFragment.class, "extraDimensions", int.class, MANDATORY); //$NON-NLS-1$ - + /** * The "initializer" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor INITIALIZER_PROPERTY = + public static final ChildPropertyDescriptor INITIALIZER_PROPERTY = new ChildPropertyDescriptor(VariableDeclarationFragment.class, "initializer", Expression.class, OPTIONAL, CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. * @since 3.0 */ private static final List PROPERTY_DESCRIPTORS; - + static { List propertyList = new ArrayList(4); createPropertyList(VariableDeclarationFragment.class, propertyList); @@ -72,17 +72,17 @@ public class VariableDeclarationFragment extends VariableDeclaration { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** * The variable name; lazily initialized; defaults to an unspecified, * legal Java identifier. @@ -100,15 +100,15 @@ public class VariableDeclarationFragment extends VariableDeclaration { * defaults to none. */ private Expression optionalInitializer = null; - + /** - * Creates a new AST node for a variable declaration fragment owned by the - * given AST. By default, the variable declaration has: an unspecified + * Creates a new AST node for a variable declaration fragment owned by the + * given AST. By default, the variable declaration has: an unspecified * (but legal) variable name, no initializer, and no extra array dimensions. * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ VariableDeclarationFragment(AST ast) { @@ -145,7 +145,7 @@ public class VariableDeclarationFragment extends VariableDeclaration { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -161,7 +161,7 @@ public class VariableDeclarationFragment extends VariableDeclaration { // allow default implementation to flag the error return super.internalGetSetIntProperty(property, get, value); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -185,7 +185,7 @@ public class VariableDeclarationFragment extends VariableDeclaration { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -226,10 +226,10 @@ public class VariableDeclarationFragment extends VariableDeclaration { } visitor.endVisit(this); } - + /* (omit javadoc for this method) * Method declared on VariableDeclaration. - */ + */ public SimpleName getName() { if (this.variableName == null) { // lazy init must be thread-safe for readers @@ -243,10 +243,10 @@ public class VariableDeclarationFragment extends VariableDeclaration { } return this.variableName; } - + /* (omit javadoc for this method) * Method declared on VariableDeclaration. - */ + */ public void setName(SimpleName variableName) { if (variableName == null) { throw new IllegalArgumentException(); @@ -261,16 +261,16 @@ public class VariableDeclarationFragment extends VariableDeclaration { * Returns the number of extra array dimensions this variable has over * and above the type specified in the enclosing declaration. * <p> - * For example, in the AST for <code>int[] i, j[], k[][]</code> the + * For example, in the AST for <code>int[] i, j[], k[][]</code> the * variable declaration fragments for the variables <code>i</code>, * <code>j</code>, and <code>k</code>, have 0, 1, and 2 extra array * dimensions, respectively. * </p> - * + * * @return the number of extra array dimensions this variable has over * and above the type specified in the enclosing declaration * @since 2.0 - */ + */ public int getExtraDimensions() { return this.extraArrayDimensions; } @@ -279,15 +279,15 @@ public class VariableDeclarationFragment extends VariableDeclaration { * Sets the number of extra array dimensions this variable has over * and above the type specified in the enclosing declaration. * <p> - * For example, in the AST for <code>int[] i, j[], k[][]</code> the + * For example, in the AST for <code>int[] i, j[], k[][]</code> the * variable declaration fragments for the variables <code>i</code>, * <code>j</code>, and <code>k</code>, have 0, 1, and 2 extra array * dimensions, respectively. * </p> - * + * * @param dimensions the given dimensions * @since 2.0 - */ + */ public void setExtraDimensions(int dimensions) { if (dimensions < 0) { throw new IllegalArgumentException(); @@ -299,14 +299,14 @@ public class VariableDeclarationFragment extends VariableDeclaration { /* (omit javadoc for this method) * Method declared on VariableDeclaration. - */ + */ public Expression getInitializer() { return this.optionalInitializer; } - + /* (omit javadoc for this method) * Method declared on VariableDeclaration. - */ + */ public void setInitializer(Expression initializer) { ASTNode oldChild = this.optionalInitializer; preReplaceChild(oldChild, initializer, INITIALIZER_PROPERTY); @@ -321,12 +321,12 @@ public class VariableDeclarationFragment extends VariableDeclaration { // treat Operator as free return BASE_NODE_SIZE + 3 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int treeSize() { - return + return memSize() + (this.variableName == null ? 0 : getName().treeSize()) + (this.optionalInitializer == null ? 0 : getInitializer().treeSize()); diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/VariableDeclarationStatement.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/VariableDeclarationStatement.java index fd7d71753..21336c042 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/VariableDeclarationStatement.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/VariableDeclarationStatement.java @@ -19,78 +19,78 @@ import java.util.List; * Local variable declaration statement AST node type. * <p> * This kind of node collects several variable declaration fragments - * (<code>VariableDeclarationFragment</code>) into a statement + * (<code>VariableDeclarationFragment</code>) into a statement * (<code>Statement</code>), all sharing the same modifiers and base type. * </p> * For JLS2: * <pre> * VariableDeclarationStatement: - * { Modifier } Type VariableDeclarationFragment + * { Modifier } Type VariableDeclarationFragment * { <b>,</b> VariableDeclarationFragment } <b>;</b> * </pre> * For JLS3, the modifier flags were replaced by * a list of modifier nodes (intermixed with annotations): * <pre> * VariableDeclarationStatement: - * { ExtendedModifier } Type VariableDeclarationFragment + * { ExtendedModifier } Type VariableDeclarationFragment * { <b>,</b> VariableDeclarationFragment } <b>;</b> * </pre> * <p> - * Note: This type of node is a convenience of sorts. + * Note: This type of node is a convenience of sorts. * An equivalent way to represent the same statement is to use * a <code>VariableDeclarationExpression</code> * wrapped in an <code>ExpressionStatement</code>. * </p> - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ public class VariableDeclarationStatement extends Statement { - + /** * The "modifiers" structural property of this node type (JLS2 API only). * @since 3.0 */ - public static final SimplePropertyDescriptor MODIFIERS_PROPERTY = + public static final SimplePropertyDescriptor MODIFIERS_PROPERTY = new SimplePropertyDescriptor(VariableDeclarationStatement.class, "modifiers", int.class, MANDATORY); //$NON-NLS-1$ - + /** * The "modifiers" structural property of this node type (added in JLS3 API). * @since 3.1 */ - public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = + public static final ChildListPropertyDescriptor MODIFIERS2_PROPERTY = new ChildListPropertyDescriptor(VariableDeclarationStatement.class, "modifiers", IExtendedModifier.class, CYCLE_RISK); //$NON-NLS-1$ - + /** * The "type" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor TYPE_PROPERTY = + public static final ChildPropertyDescriptor TYPE_PROPERTY = new ChildPropertyDescriptor(VariableDeclarationStatement.class, "type", Type.class, MANDATORY, NO_CYCLE_RISK); //$NON-NLS-1$ /** * The "fragments" structural property of this node type). * @since 3.0 */ - public static final ChildListPropertyDescriptor FRAGMENTS_PROPERTY = + public static final ChildListPropertyDescriptor FRAGMENTS_PROPERTY = new ChildListPropertyDescriptor(VariableDeclarationStatement.class, "fragments", VariableDeclarationFragment.class, CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. * @since 3.0 */ private static final List PROPERTY_DESCRIPTORS_2_0; - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. * @since 3.1 */ private static final List PROPERTY_DESCRIPTORS_3_0; - + static { List propertyList = new ArrayList(4); createPropertyList(VariableDeclarationStatement.class, propertyList); @@ -98,7 +98,7 @@ public class VariableDeclarationStatement extends Statement { addProperty(TYPE_PROPERTY, propertyList); addProperty(FRAGMENTS_PROPERTY, propertyList); PROPERTY_DESCRIPTORS_2_0 = reapPropertyList(propertyList); - + propertyList = new ArrayList(4); createPropertyList(VariableDeclarationStatement.class, propertyList); addProperty(MODIFIERS2_PROPERTY, propertyList); @@ -110,11 +110,11 @@ public class VariableDeclarationStatement extends Statement { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ @@ -125,21 +125,21 @@ public class VariableDeclarationStatement extends Statement { return PROPERTY_DESCRIPTORS_3_0; } } - + /** - * The extended modifiers (element type: <code>IExtendedModifier</code>). + * The extended modifiers (element type: <code>IExtendedModifier</code>). * Null in JLS2. Added in JLS3; defaults to an empty list * (see constructor). * @since 3.1 */ private ASTNode.NodeList modifiers = null; - + /** * The modifier flagss; bit-wise or of Modifier flags. * Defaults to none. Not used in JLS3. */ private int modifierFlags = Modifier.NONE; - + /** * The base type; lazily initialized; defaults to an unspecified, * legal type. @@ -147,21 +147,21 @@ public class VariableDeclarationStatement extends Statement { private Type baseType = null; /** - * The list of variable variable declaration fragments (element type: + * The list of variable variable declaration fragments (element type: * {@link VariableDeclarationFragment}). Defaults to an empty list. */ - private ASTNode.NodeList variableDeclarationFragments = + private ASTNode.NodeList variableDeclarationFragments = new ASTNode.NodeList(FRAGMENTS_PROPERTY); /** - * Creates a new unparented local variable declaration statement node owned + * Creates a new unparented local variable declaration statement node owned * by the given AST. By default, the variable declaration has: no modifiers, - * an unspecified (but legal) type, and an empty list of variable + * an unspecified (but legal) type, and an empty list of variable * declaration fragments (which is syntactically illegal). * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ VariableDeclarationStatement(AST ast) { @@ -177,7 +177,7 @@ public class VariableDeclarationStatement extends Statement { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -193,7 +193,7 @@ public class VariableDeclarationStatement extends Statement { // allow default implementation to flag the error return super.internalGetSetIntProperty(property, get, value); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -209,7 +209,7 @@ public class VariableDeclarationStatement extends Statement { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -223,7 +223,7 @@ public class VariableDeclarationStatement extends Statement { // allow default implementation to flag the error return super.internalGetChildListProperty(property); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -235,7 +235,7 @@ public class VariableDeclarationStatement extends Statement { * Method declared on ASTNode. */ ASTNode clone0(AST target) { - VariableDeclarationStatement result = + VariableDeclarationStatement result = new VariableDeclarationStatement(target); result.setSourceRange(getStartPosition(), getLength()); result.copyLeadingComment(this); @@ -250,7 +250,7 @@ public class VariableDeclarationStatement extends Statement { ASTNode.copySubtrees(target, fragments())); return result; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -274,7 +274,7 @@ public class VariableDeclarationStatement extends Statement { } visitor.endVisit(this); } - + /** * Returns the live ordered list of modifiers and annotations * of this declaration (added in JLS3 API). @@ -282,13 +282,13 @@ public class VariableDeclarationStatement extends Statement { * Note that the final modifier is the only meaningful modifier for local * variable declarations. * </p> - * + * * @return the live list of modifiers and annotations * (element type: <code>IExtendedModifier</code>) * @exception UnsupportedOperationException if this operation is used in * a JLS2 AST * @since 3.1 - */ + */ public List modifiers() { // more efficient than just calling unsupportedIn2() to check if (this.modifiers == null) { @@ -296,17 +296,17 @@ public class VariableDeclarationStatement extends Statement { } return this.modifiers; } - + /** * Returns the modifiers explicitly specified on this declaration. * <p> * In the JLS3 API, this method is a convenience method that * computes these flags from <code>modifiers()</code>. * </p> - * + * * @return the bit-wise or of <code>Modifier</code> constants * @see Modifier - */ + */ public int getModifiers() { // more efficient than checking getAST().API_LEVEL if (this.modifiers == null) { @@ -333,18 +333,18 @@ public class VariableDeclarationStatement extends Statement { * Note that the final modifier is the only meaningful modifier for local * variable declarations. * </p> - * + * * @param modifiers the given modifiers (bit-wise or of <code>Modifier</code> constants) * @exception UnsupportedOperationException if this operation is used in * an AST later than JLS2 * @see Modifier - * @deprecated In the JLS3 API, this method is replaced by + * @deprecated In the JLS3 API, this method is replaced by * {@link #modifiers()} which contains a list of a <code>Modifier</code> nodes. - */ + */ public void setModifiers(int modifiers) { internalSetModifiers(modifiers); } - + /** * Internal synonym for deprecated method. Used to avoid * deprecation warnings. @@ -361,12 +361,12 @@ public class VariableDeclarationStatement extends Statement { * Returns the base type declared in this variable declaration statement. * <p> * N.B. The individual child variable declaration fragments may specify - * additional array dimensions. So the type of the variable are not + * additional array dimensions. So the type of the variable are not * necessarily exactly this type. * </p> - * + * * @return the base type - */ + */ public Type getType() { if (this.baseType == null) { // lazy init must be thread-safe for readers @@ -382,16 +382,16 @@ public class VariableDeclarationStatement extends Statement { } /** - * Sets the base type declared in this variable declaration statement to + * Sets the base type declared in this variable declaration statement to * the given type. - * + * * @param type the new base type * @exception IllegalArgumentException if: * <ul> * <li>the node belongs to a different AST</li> * <li>the node already has a parent</li> * </ul> - */ + */ public void setType(Type type) { if (type == null) { throw new IllegalArgumentException(); @@ -408,21 +408,21 @@ public class VariableDeclarationStatement extends Statement { * All nodes in this list must be <code>VariableDeclarationFragment</code>s; * attempts to add any other type of node will trigger an * exception. - * - * @return the live list of variable declaration fragments in this + * + * @return the live list of variable declaration fragments in this * statement (element type: <code>VariableDeclarationFragment</code>) - */ + */ public List fragments() { return this.variableDeclarationFragments; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int memSize() { return super.memSize() + 4 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/WhileStatement.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/WhileStatement.java index 272937062..4fa9e3d2a 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/WhileStatement.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/WhileStatement.java @@ -21,7 +21,7 @@ import java.util.List; * WhileStatement: * <b>while</b> <b>(</b> Expression <b>)</b> Statement * </pre> - * + * * @since 2.0 * @noinstantiate This class is not intended to be instantiated by clients. */ @@ -31,23 +31,23 @@ public class WhileStatement extends Statement { * The "expression" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor EXPRESSION_PROPERTY = + public static final ChildPropertyDescriptor EXPRESSION_PROPERTY = new ChildPropertyDescriptor(WhileStatement.class, "expression", Expression.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ /** * The "body" structural property of this node type. * @since 3.0 */ - public static final ChildPropertyDescriptor BODY_PROPERTY = + public static final ChildPropertyDescriptor BODY_PROPERTY = new ChildPropertyDescriptor(WhileStatement.class, "body", Statement.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List propertyList = new ArrayList(3); createPropertyList(WhileStatement.class, propertyList); @@ -59,38 +59,38 @@ public class WhileStatement extends Statement { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) * @since 3.0 */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - + /** - * The expression; lazily initialized; defaults to an unspecified, but + * The expression; lazily initialized; defaults to an unspecified, but * legal, expression. */ private Expression expression = null; /** - * The body statement; lazily initialized; defaults to an empty block + * The body statement; lazily initialized; defaults to an empty block * statement. */ private Statement body = null; /** - * Creates a new unparented while statement node owned by the given + * Creates a new unparented while statement node owned by the given * AST. By default, the expresssion is unspecified, but legal, and * the body statement is an empty block. * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ WhileStatement(AST ast) { @@ -103,7 +103,7 @@ public class WhileStatement extends Statement { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -127,7 +127,7 @@ public class WhileStatement extends Statement { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -167,12 +167,12 @@ public class WhileStatement extends Statement { } visitor.endVisit(this); } - + /** * Returns the expression of this while statement. - * + * * @return the expression node - */ + */ public Expression getExpression() { if (this.expression == null) { // lazy init must be thread-safe for readers @@ -186,10 +186,10 @@ public class WhileStatement extends Statement { } return this.expression; } - + /** * Sets the expression of this while statement. - * + * * @param expression the expression node * @exception IllegalArgumentException if: * <ul> @@ -197,7 +197,7 @@ public class WhileStatement extends Statement { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setExpression(Expression expression) { if (expression == null) { throw new IllegalArgumentException(); @@ -210,9 +210,9 @@ public class WhileStatement extends Statement { /** * Returns the body of this while statement. - * + * * @return the body statement node - */ + */ public Statement getBody() { if (this.body == null) { // lazy init must be thread-safe for readers @@ -226,7 +226,7 @@ public class WhileStatement extends Statement { } return this.body; } - + /** * Sets the body of this while statement. * <p> @@ -237,7 +237,7 @@ public class WhileStatement extends Statement { * compile, be sure to embed the <code>VariableDeclarationStatement</code> * inside a <code>Block</code>. * </p> - * + * * @param statement the body statement node * @exception IllegalArgumentException if: * <ul> @@ -245,7 +245,7 @@ public class WhileStatement extends Statement { * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setBody(Statement statement) { if (statement == null) { throw new IllegalArgumentException(); @@ -255,14 +255,14 @@ public class WhileStatement extends Statement { this.body = statement; postReplaceChild(oldChild, statement, BODY_PROPERTY); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int memSize() { return super.memSize() + 2 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/WildcardType.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/WildcardType.java index ed415af22..6d50ff36b 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/WildcardType.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/WildcardType.java @@ -18,38 +18,38 @@ import java.util.List; * Type node for a wildcard type (added in JLS3 API). * <pre> * WildcardType: - * <b>?</b> [ ( <b>extends</b> | <b>super</b>) Type ] + * <b>?</b> [ ( <b>extends</b> | <b>super</b>) Type ] * </pre> * <p> * Not all node arrangements will represent legal Java constructs. In particular, * it is nonsense if a wildcard type node appears anywhere other than as an * argument of a <code>ParameterizedType</code> node. * </p> - * + * * @since 3.1 * @noinstantiate This class is not intended to be instantiated by clients. */ public class WildcardType extends Type { - + /** * The "bound" structural property of this node type. */ - public static final ChildPropertyDescriptor BOUND_PROPERTY = + public static final ChildPropertyDescriptor BOUND_PROPERTY = new ChildPropertyDescriptor(WildcardType.class, "bound", Type.class, OPTIONAL, CYCLE_RISK); //$NON-NLS-1$ /** * The "upperBound" structural property of this node type. */ - public static final SimplePropertyDescriptor UPPER_BOUND_PROPERTY = + public static final SimplePropertyDescriptor UPPER_BOUND_PROPERTY = new SimplePropertyDescriptor(WildcardType.class, "upperBound", boolean.class, MANDATORY); //$NON-NLS-1$ /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ private static final List PROPERTY_DESCRIPTORS; - + static { List propertyList = new ArrayList(3); createPropertyList(WildcardType.class, propertyList); @@ -61,26 +61,26 @@ public class WildcardType extends Type { /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) */ public static List propertyDescriptors(int apiLevel) { return PROPERTY_DESCRIPTORS; } - - /** + + /** * The optional type bound node; <code>null</code> if none; * defaults to none. */ private Type optionalBound = null; - + /** * Indicates whether the wildcard bound is an upper bound - * ("extends") as opposed to a lower bound ("super"). + * ("extends") as opposed to a lower bound ("super"). * Defaults to <code>true</code> initially. */ private boolean isUpperBound = true; @@ -91,7 +91,7 @@ public class WildcardType extends Type { * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ WildcardType(AST ast) { @@ -105,7 +105,7 @@ public class WildcardType extends Type { final List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -121,7 +121,7 @@ public class WildcardType extends Type { // allow default implementation to flag the error return super.internalGetSetBooleanProperty(property, get, value); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -137,7 +137,7 @@ public class WildcardType extends Type { // allow default implementation to flag the error return super.internalGetSetChildProperty(property, get, child); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -174,7 +174,7 @@ public class WildcardType extends Type { } visitor.endVisit(this); } - + /** * Returns whether this wildcard type is an upper bound * ("extends") as opposed to a lower bound ("super"). @@ -182,34 +182,34 @@ public class WildcardType extends Type { * Note that this property is irrelevant for wildcards * that do not have a bound. * </p> - * + * * @return <code>true</code> if an upper bound, * and <code>false</code> if a lower bound * @see #setBound(Type) - */ + */ public boolean isUpperBound() { return this.isUpperBound; } - + /** * Returns the bound of this wildcard type if it has one. * If {@link #isUpperBound isUpperBound} returns true, this * is an upper bound ("? extends B"); if it returns false, this * is a lower bound ("? super B"). - * + * * @return the bound of this wildcard type, or <code>null</code> * if none * @see #setBound(Type) - */ + */ public Type getBound() { return this.optionalBound; } - + /** * Sets the bound of this wildcard type to the given type and * marks it as an upper or a lower bound. The method is * equivalent to calling <code>setBound(type); setUpperBound(isUpperBound)</code>. - * + * * @param type the new bound of this wildcard type, or <code>null</code> * if none * @param isUpperBound <code>true</code> for an upper bound ("? extends B"), @@ -221,7 +221,7 @@ public class WildcardType extends Type { * </ul> * @see #getBound() * @see #isUpperBound() - */ + */ public void setBound(Type type, boolean isUpperBound) { setBound(type); setUpperBound(isUpperBound); @@ -229,7 +229,7 @@ public class WildcardType extends Type { /** * Sets the bound of this wildcard type to the given type. - * + * * @param type the new bound of this wildcard type, or <code>null</code> * if none * @exception IllegalArgumentException if: @@ -238,7 +238,7 @@ public class WildcardType extends Type { * <li>the node already has a parent</li> * </ul> * @see #getBound() - */ + */ public void setBound(Type type) { ASTNode oldChild = this.optionalBound; preReplaceChild(oldChild, type, BOUND_PROPERTY); @@ -249,29 +249,29 @@ public class WildcardType extends Type { /** * Sets whether this wildcard type is an upper bound * ("extends") as opposed to a lower bound ("super"). - * + * * @param isUpperBound <code>true</code> if an upper bound, * and <code>false</code> if a lower bound * @see #isUpperBound() - */ + */ public void setUpperBound(boolean isUpperBound) { preValueChange(UPPER_BOUND_PROPERTY); this.isUpperBound = isUpperBound; postValueChange(UPPER_BOUND_PROPERTY); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int memSize() { return BASE_NODE_SIZE + 2 * 4; } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ int treeSize() { - return + return memSize() + (this.optionalBound == null ? 0 : getBound().treeSize()); } diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/WithinStatement.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/WithinStatement.java index ebee09b14..7a02188e7 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/WithinStatement.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/WithinStatement.java @@ -5,7 +5,7 @@ * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * $Id$ - * + * * Please visit http://www.eclipse.org/objectteams for updates and contact. * * Contributors: @@ -36,38 +36,38 @@ import java.util.List; * } * </code> * - * + * * Within Statements consist of a team expression and * a body element (org.eclipse.jdtd.core.dom.Block). - * + * * Within statements can be used in the following AST-nodes: * Block - * + * * @author mkr */ -public class WithinStatement extends Statement +public class WithinStatement extends Statement { /** * The "team expression" structural property of this node type. */ - public static final ChildPropertyDescriptor TEAM_EXPRESSION_PROPERTY = + public static final ChildPropertyDescriptor TEAM_EXPRESSION_PROPERTY = new ChildPropertyDescriptor(WithinStatement.class, "team expression", Expression.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ - + /** * The "body" structural property of this node type. */ - public static final ChildPropertyDescriptor BODY_PROPERTY = + public static final ChildPropertyDescriptor BODY_PROPERTY = new ChildPropertyDescriptor(WithinStatement.class, "body", Statement.class, MANDATORY, CYCLE_RISK); //$NON-NLS-1$ - + /** - * A list of property descriptors (element type: + * A list of property descriptors (element type: * {@link StructuralPropertyDescriptor}), * or null if uninitialized. */ @SuppressWarnings("rawtypes") private static final List PROPERTY_DESCRIPTORS; - + static { List<StructuralPropertyDescriptor> propertyList = new ArrayList<StructuralPropertyDescriptor>(3); @@ -80,10 +80,10 @@ public class WithinStatement extends Statement /** * Returns a list of structural property descriptors for this node type. * Clients must not modify the result. - * + * * @param apiLevel the API level; one of the * <code>AST.JLS*</code> constants - * @return a list of property descriptors (element type: + * @return a list of property descriptors (element type: * {@link StructuralPropertyDescriptor}) */ @SuppressWarnings("rawtypes") @@ -92,35 +92,35 @@ public class WithinStatement extends Statement return PROPERTY_DESCRIPTORS; } - + private Expression teamExpression = null; - + /** - * The body statement; lazily initialized; defaults to an empty block + * The body statement; lazily initialized; defaults to an empty block * statement. This is an addition to the statements List. */ private Statement body = null; - + /** * Creates a new withinStatement node owned by the given AST. * By default, the withinStatement is empty. * <p> * N.B. This constructor is package-private. * </p> - * + * * @param ast the AST that is to own this node */ WithinStatement(AST ast) { super(ast); } - + @SuppressWarnings("rawtypes") List internalStructuralPropertiesForType(int apiLevel) { return propertyDescriptors(apiLevel); } - + /* (omit javadoc for this method) * Method declared on ASTNode. */ @@ -149,17 +149,17 @@ public class WithinStatement extends Statement setTeamExpression((Expression) child); return null; } - + } // allow default implementation to flag the error return super.internalGetSetChildProperty(property, isGet, child); } - + int getNodeType0() { return WITHIN_STATEMENT; } - + boolean subtreeMatch0(ASTMatcher matcher, Object other) { // dispatch to correct overloaded match method @@ -173,7 +173,7 @@ public class WithinStatement extends Statement result.copyLeadingComment(this); result.setTeamExpression((Expression) getTeamExpression().clone(target)); result.setBody((Statement) getBody().clone(target)); - + return result; } @@ -198,7 +198,7 @@ public class WithinStatement extends Statement { return memSize() + this.body.treeSize(); } - + /** * Returns the team exception of this within statement. * @return team exception @@ -208,9 +208,9 @@ public class WithinStatement extends Statement if (this.teamExpression == null) { // lazy init must be thread-safe for readers - synchronized (this) + synchronized (this) { - if (this.teamExpression == null) + if (this.teamExpression == null) { preLazyInit(); this.teamExpression = new SimpleName(this.ast); @@ -219,12 +219,12 @@ public class WithinStatement extends Statement } } return this.teamExpression; - + } - + /** * Sets the expression of this while statement. - * + * * @param expression the expression node * @exception IllegalArgumentException if: * <ul> @@ -232,7 +232,7 @@ public class WithinStatement extends Statement * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ + */ public void setTeamExpression(Expression expression) { if (expression == null) @@ -247,9 +247,9 @@ public class WithinStatement extends Statement /** * Returns the body of this within statement. - * + * * @return the body statement node - */ + */ public Statement getBody() { if (this.body == null) @@ -267,7 +267,7 @@ public class WithinStatement extends Statement } return this.body; } - + /** * Sets the body of this within statement. * <p> @@ -279,7 +279,7 @@ public class WithinStatement extends Statement * compile, be sure to embed the <code>VariableDeclarationStatement</code> * inside a <code>Block</code>. * </p> - * + * * @param statement the body statement node * @exception IllegalArgumentException if: * <ul> @@ -287,10 +287,10 @@ public class WithinStatement extends Statement * <li>the node already has a parent</li> * <li>a cycle in would be created</li> * </ul> - */ - public void setBody(Statement statement) + */ + public void setBody(Statement statement) { - if (statement == null) + if (statement == null) { throw new IllegalArgumentException(); } diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/rewrite/ASTNodeCreator.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/rewrite/ASTNodeCreator.java index 3c1088293..b1333f443 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/rewrite/ASTNodeCreator.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/rewrite/ASTNodeCreator.java @@ -39,47 +39,47 @@ import org.eclipse.jdt.core.dom.Modifier.ModifierKeyword; /** * New for OTDT. - * + * * @author ikeman * - * This class provides helperMethods for the creation of DOMAST-Nodes. + * This class provides helperMethods for the creation of DOMAST-Nodes. * * @version $Id: ASTNodeCreator.java 22581 2009-09-24 10:26:48Z stephan $ */ @SuppressWarnings("unchecked") // assigning from parameterless lists :( public class ASTNodeCreator { - + public static CompilationUnit createCU(AST ast, PackageDeclaration pack, List importList, List typeList) { CompilationUnit newCU = ast.newCompilationUnit(); - + if (pack != null) newCU.setPackage(pack); - + if (importList != null && importList.size()!= 0) { List<ImportDeclaration> cuImportList = newCU.imports(); for (int idx = 0; idx < importList.size(); idx++) { ImportDeclaration tmp = (ImportDeclaration)importList.get(idx); - cuImportList.add(tmp); + cuImportList.add(tmp); } } - + if (typeList != null && typeList.size()!= 0) { List<TypeDeclaration> cuTypeList = newCU.types(); for (int idx = 0; idx < typeList.size(); idx++) { TypeDeclaration tmp = (TypeDeclaration)typeList.get(idx); - cuTypeList.add(tmp); + cuTypeList.add(tmp); } } return newCU; } - - /* km: not needed anymore? + + /* km: not needed anymore? public static TypeDeclaration createTeam(AST ast, Javadoc javadoc, int modifiers, boolean isInterface, boolean isRole, String teamClassName, String superClassName, List superInterfaces, List bodyDeclarations) { @@ -88,9 +88,9 @@ public class ASTNodeCreator newTypeDecl.setTeam(true); if(ast.apiLevel() == AST.JLS2) newTypeDecl.setModifiers(modifiers); - else + else newTypeDecl.modifiers().addAll(ast.newModifiers(modifiers)); - + newTypeDecl.setRole(isRole); newTypeDecl.setInterface(isInterface); @@ -98,21 +98,21 @@ public class ASTNodeCreator newTypeDecl.setJavadoc(javadoc); if(ast.apiLevel() == AST.JLS2) { - if (superClassName != null) + if (superClassName != null) newTypeDecl.setSuperclass(ast.newName(superClassName)); - + if (superInterfaces != null && superInterfaces.size()!= 0) { List superInterfacesList = newTypeDecl.superInterfaces(); for (int idx = 0; idx < superInterfaces.size(); idx++) { SimpleName tmp = (SimpleName)superInterfaces.get(idx); - superInterfacesList.add(tmp); + superInterfacesList.add(tmp); } } } else { - + } if (bodyDeclarations != null && bodyDeclarations.size()!= 0) @@ -121,45 +121,45 @@ public class ASTNodeCreator for (int idx = 0; idx < bodyDeclarations.size(); idx++) { Object tmp = bodyDeclarations.get(idx); - bodyDeclarationList.add(tmp); + bodyDeclarationList.add(tmp); } } return newTypeDecl; } - - - public static RoleTypeDeclaration createRole(AST ast, Javadoc javadoc, int modifier, String roleName, String baseClassName, + + + public static RoleTypeDeclaration createRole(AST ast, Javadoc javadoc, int modifier, String roleName, String baseClassName, String teamClassName, String superClassName, List superInterfaces, boolean isTeam, List bodyDeclarations) { RoleTypeDeclaration role = ast.newRoleTypeDeclaration(); - + if(ast.apiLevel() == AST.JLS2) role.setModifiers(modifier); - else + else role.modifiers().addAll(ast.newModifiers(modifier)); - + role.setName(ast.newName(roleName)); role.setTeamClass(ast.newName(teamClassName)); role.setTeam(isTeam); - role.setRole(true); + role.setRole(true); if (javadoc != null) role.setJavadoc(javadoc); - - if (baseClassName != null) + + if (baseClassName != null) role.setBaseClass(ast.newName(baseClassName)); - - if (superClassName != null) + + if (superClassName != null) role.setSuperclass(ast.newName(superClassName)); - + if (superInterfaces != null && superInterfaces.size()!= 0) { List superInterfacesList = role.superInterfaces(); for (int idx = 0; idx < superInterfaces.size(); idx++) { SimpleName tmp = (SimpleName)superInterfaces.get(idx); - superInterfacesList.add(tmp); + superInterfacesList.add(tmp); } } @@ -169,7 +169,7 @@ public class ASTNodeCreator for (int idx = 0; idx < bodyDeclarations.size(); idx++) { Object tmp = bodyDeclarations.get(idx); - bodyDeclarationList.add(tmp); + bodyDeclarationList.add(tmp); } } return role; @@ -180,12 +180,12 @@ public class ASTNodeCreator { CallinMappingDeclaration newCallinMapping = ast.newCallinMappingDeclaration(); newCallinMapping.setCallinModifier(modifier); - + newCallinMapping.setRoleMappingElement(roleMethod); - + if (javadoc != null) newCallinMapping.setJavadoc(javadoc); - + if (baseMethods != null && baseMethods.size()!= 0) { List<MethodSpec> baseMappingList = newCallinMapping.getBaseMappingElements(); @@ -201,39 +201,39 @@ public class ASTNodeCreator while(!paramMappings.isEmpty()) { ParameterMapping tmp = (ParameterMapping)paramMappings.remove(0); - parameterMappingList.add(tmp); + parameterMappingList.add(tmp); } } return newCallinMapping; } - + @SuppressWarnings("deprecation") public static CalloutMappingDeclaration createCalloutMappingDeclaration( - AST ast, - Javadoc javadoc, - int modifier, + AST ast, + Javadoc javadoc, + int modifier, MethodMappingElement roleMethod, MethodMappingElement baseMethod, int bindingModifier, - List paramMappings, - boolean calloutOverride, + List paramMappings, + boolean calloutOverride, boolean signatureFlag) { CalloutMappingDeclaration newCalloutMapping = ast.newCalloutMappingDeclaration(); - + if (javadoc != null) newCalloutMapping.setJavadoc(javadoc); - + if(ast.apiLevel() == AST.JLS2) newCalloutMapping.setModifiers(modifier); - else + else newCalloutMapping.modifiers().addAll(ast.newModifiers(modifier)); - + newCalloutMapping.setSignatureFlag(signatureFlag); newCalloutMapping.setRoleMappingElement(roleMethod); newCalloutMapping.setBaseMappingElement(baseMethod); - + ModifierKeyword keyword = null; switch (bindingModifier) { case Modifier.OT_SET_CALLOUT: keyword = ModifierKeyword.SET_KEYWORD; break; @@ -241,26 +241,26 @@ public class ASTNodeCreator } int calloutKind = calloutOverride ? MethodBindingOperator.KIND_CALLOUT_OVERRIDE : MethodBindingOperator.KIND_CALLOUT; newCalloutMapping.setBindingOperator(ast.newMethodBindingOperator(keyword, calloutKind)); - + if (paramMappings != null && paramMappings.size()!= 0) { List<ParameterMapping> parameterMapping = newCalloutMapping.getParameterMappings(); while(!paramMappings.isEmpty()) { ParameterMapping tmp = (ParameterMapping)paramMappings.remove(0); - parameterMapping.add(tmp); + parameterMapping.add(tmp); } } return newCalloutMapping; } - + public static FieldAccessSpec createFieldAccSpec(AST ast, boolean isSetter, String fieldName, String fieldType, boolean hasSignature) { FieldAccessSpec newFieldAcc = ast.newFieldAccessSpec(); newFieldAcc.setName(ast.newSimpleName(fieldName)); - + newFieldAcc.setFieldType(createType(ast, fieldType)); - + newFieldAcc.setSignatureFlag(hasSignature); return newFieldAcc; } @@ -277,7 +277,7 @@ public class ASTNodeCreator methodSpec.setName(ast.newSimpleName(methodName)); methodSpec.setReturnType2(createType(ast, returnType)); methodSpec.setSignatureFlag(signatureFlag); - + if (argumentTypes !=null && argumentTypes.size()!=0) { List<VariableDeclaration> methodParameters = methodSpec.parameters(); @@ -287,7 +287,7 @@ public class ASTNodeCreator ? argumentNames.get(idx) : "arg"+idx; //$NON-NLS-1$ VariableDeclaration tmp = createArgument(ast, 0, createType(ast, argumentTypes.get(idx)), argumentName, dimensions.get(idx), null); - methodParameters.add(tmp); + methodParameters.add(tmp); } } return methodSpec; @@ -297,16 +297,16 @@ public class ASTNodeCreator { MethodSpec methodSpec = ast.newMethodSpec(); methodSpec.setName(ast.newSimpleName(methodName)); - methodSpec.setSignatureFlag(signatureFlag); + methodSpec.setSignatureFlag(signatureFlag); methodSpec.setReturnType2(returnType); - + if (parameters!=null && parameters.size()!=0) { List<VariableDeclaration> methodParameters = methodSpec.parameters(); for (int idx = 0; idx < parameters.size(); idx++) { VariableDeclaration tmp = (VariableDeclaration)parameters.get(idx); - methodParameters.add(tmp); + methodParameters.add(tmp); } } return methodSpec; @@ -324,7 +324,7 @@ public class ASTNodeCreator Type primType = getPrimitveType(ast, typeName); if (primType != null) return primType; - + if (typeName.endsWith("[]")) //$NON-NLS-1$ { String [] name = typeName.split("\\[\\]"); //$NON-NLS-1$ @@ -341,45 +341,45 @@ public class ASTNodeCreator } } } - + Name name = ast.newName(typeName); Type simpleType = ast.newSimpleType(name); - + return simpleType; } - + private static Type getPrimitveType(AST ast, String typeName) { if (typeName.equals(PrimitiveType.BOOLEAN.toString())) - return ast.newPrimitiveType(PrimitiveType.BOOLEAN); + return ast.newPrimitiveType(PrimitiveType.BOOLEAN); if (typeName.equals(PrimitiveType.BYTE.toString())) - return ast.newPrimitiveType(PrimitiveType.BYTE); - + return ast.newPrimitiveType(PrimitiveType.BYTE); + if (typeName.equals(PrimitiveType.CHAR.toString())) - return ast.newPrimitiveType(PrimitiveType.CHAR); + return ast.newPrimitiveType(PrimitiveType.CHAR); if (typeName.equals(PrimitiveType.DOUBLE.toString())) - return ast.newPrimitiveType(PrimitiveType.DOUBLE); + return ast.newPrimitiveType(PrimitiveType.DOUBLE); if (typeName.equals(PrimitiveType.FLOAT.toString())) - return ast.newPrimitiveType(PrimitiveType.FLOAT); + return ast.newPrimitiveType(PrimitiveType.FLOAT); if (typeName.equals(PrimitiveType.INT.toString())) - return ast.newPrimitiveType(PrimitiveType.INT); + return ast.newPrimitiveType(PrimitiveType.INT); if (typeName.equals(PrimitiveType.LONG.toString())) - return ast.newPrimitiveType(PrimitiveType.LONG); + return ast.newPrimitiveType(PrimitiveType.LONG); if (typeName.equals(PrimitiveType.SHORT.toString())) - return ast.newPrimitiveType(PrimitiveType.SHORT); + return ast.newPrimitiveType(PrimitiveType.SHORT); if (typeName.equals(PrimitiveType.VOID.toString())) return ast.newPrimitiveType(PrimitiveType.VOID); - + return null; } - + @SuppressWarnings("deprecation") public static SingleVariableDeclaration createArgument(AST ast, int modifier, Type parameterType, String parameterName, int dimension, Expression initializer) @@ -387,16 +387,16 @@ public class ASTNodeCreator SingleVariableDeclaration methodSpecParameter = ast.newSingleVariableDeclaration(); if(ast.apiLevel() == AST.JLS2) methodSpecParameter.setModifiers(modifier); - else + else methodSpecParameter.modifiers().addAll(ast.newModifiers(modifier)); - + methodSpecParameter.setType(parameterType); methodSpecParameter.setName(ast.newSimpleName(parameterName)); methodSpecParameter.setExtraDimensions(dimension); methodSpecParameter.setInitializer(initializer); return methodSpecParameter; } - + public static ParameterMapping createParameterMapping(AST ast, Expression expression, SimpleName identName, String direction, boolean resultFlag) { @@ -407,7 +407,7 @@ public class ASTNodeCreator newParameterMapping.setResultFlag(resultFlag); return newParameterMapping; } - + public static Expression createExpression(AST ast, String expressionName, String methodName) { MethodInvocation expression = ast.newMethodInvocation(); @@ -415,8 +415,8 @@ public class ASTNodeCreator expression.setName(ast.newSimpleName(methodName)); return expression; } - - + + /** * Parses the source string of an expression and returns a dom ast expression, * that belongs to the given ast, or <code>null</code> if something goes wrong. @@ -455,7 +455,7 @@ public class ASTNodeCreator for (int idx = 0; idx < arguments.size(); idx++) { Expression tmp = (Expression)arguments.get(idx); - classArguments.add(tmp); + classArguments.add(tmp); } } return expression; diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/rewrite/ASTRewrite.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/rewrite/ASTRewrite.java index 1dcca66e6..ecf7e1c50 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/rewrite/ASTRewrite.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/rewrite/ASTRewrite.java @@ -493,7 +493,7 @@ public class ASTRewrite { if (node == null || property == null) { throw new IllegalArgumentException(); } - + validateIsCorrectAST(node); validateIsListProperty(property); validateIsPropertyOfNode(property, node); @@ -544,7 +544,7 @@ public class ASTRewrite { throw new IllegalArgumentException(message); } } - + private void validateIsPropertyOfNode(StructuralPropertyDescriptor property, ASTNode node) { if (!property.getNodeClass().isInstance(node)) { String message= property.getId() + " is not a property of type " + node.getClass().getName(); //$NON-NLS-1$ @@ -713,7 +713,7 @@ public class ASTRewrite { //{ObjectTeams: boolean isOTJsource= false; public void setToOTJ() { - this.isOTJsource= true; + this.isOTJsource= true; } // SH} } diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/rewrite/ITrackedNodePosition.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/rewrite/ITrackedNodePosition.java index ddd62d5a1..782e1d4fb 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/rewrite/ITrackedNodePosition.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/rewrite/ITrackedNodePosition.java @@ -16,28 +16,28 @@ package org.eclipse.jdt.core.dom.rewrite; * <p> * This interface is not intended to be implemented by clients. * </p> - * + * * @see ASTRewrite#track(org.eclipse.jdt.core.dom.ASTNode) * @since 3.0 * @noimplement This interface is not intended to be implemented by clients. */ public interface ITrackedNodePosition { - + /** * Returns the original or modified start position of the tracked node depending if called before * or after the rewrite is applied. <code>-1</code> is returned for removed nodes. - * + * * @return the original or modified start position of the tracked node */ public int getStartPosition(); - + /** * Returns the original or modified length of the tracked node depending if called before * or after the rewrite is applied. <code>-1</code> is returned for removed nodes. - * + * * @return the original or modified length of the tracked node */ public int getLength(); - - + + } diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/rewrite/ImportRewrite.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/rewrite/ImportRewrite.java index ed9f2ef60..cda1d94c3 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/rewrite/ImportRewrite.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/rewrite/ImportRewrite.java @@ -61,53 +61,53 @@ import org.eclipse.text.edits.TextEdit; */ @SuppressWarnings("unchecked") public final class ImportRewrite { - + /** * A {@link ImportRewrite.ImportRewriteContext} can optionally be used in e.g. {@link ImportRewrite#addImport(String, ImportRewrite.ImportRewriteContext)} to * give more information about the types visible in the scope. These types can be for example inherited inner types where it is - * unnecessary to add import statements for. - * + * unnecessary to add import statements for. + * * </p> * <p> * This class can be implemented by clients. * </p> */ public static abstract class ImportRewriteContext { - + /** - * Result constant signaling that the given element is know in the context. + * Result constant signaling that the given element is know in the context. */ public final static int RES_NAME_FOUND= 1; - + /** - * Result constant signaling that the given element is not know in the context. + * Result constant signaling that the given element is not know in the context. */ public final static int RES_NAME_UNKNOWN= 2; - + /** - * Result constant signaling that the given element is conflicting with an other element in the context. + * Result constant signaling that the given element is conflicting with an other element in the context. */ public final static int RES_NAME_CONFLICT= 3; - + /** * Kind constant specifying that the element is a type import. */ public final static int KIND_TYPE= 1; - + /** * Kind constant specifying that the element is a static field import. */ public final static int KIND_STATIC_FIELD= 2; - + /** * Kind constant specifying that the element is a static method import. */ public final static int KIND_STATIC_METHOD= 3; - + /** * Searches for the given element in the context and reports if the element is known ({@link #RES_NAME_FOUND}), * unknown ({@link #RES_NAME_UNKNOWN}) or if its name conflicts ({@link #RES_NAME_CONFLICT}) with an other element. - * @param qualifier The qualifier of the element, can be package or the qualified name of a type + * @param qualifier The qualifier of the element, can be package or the qualified name of a type * @param name The simple name of the element; either a type, method or field name or * for on-demand imports. * @param kind The kind of the element. Can be either {@link #KIND_TYPE}, {@link #KIND_STATIC_FIELD} or * {@link #KIND_STATIC_METHOD}. Implementors should be prepared for new, currently unspecified kinds and return @@ -117,39 +117,39 @@ public final class ImportRewrite { */ public abstract int findInContext(String qualifier, String name, int kind); } - + private static final char STATIC_PREFIX= 's'; private static final char NORMAL_PREFIX= 'n'; //{ObjectTeams: private static final char BASE_PREFIX= 'b'; // SH} - + private final ImportRewriteContext defaultContext; private final ICompilationUnit compilationUnit; private final CompilationUnit astRoot; - + private final boolean restoreExistingImports; private final List existingImports; private final Map importsKindMap; - + private String[] importOrder; private int importOnDemandThreshold; private int staticImportOnDemandThreshold; - + private List addedImports; private List removedImports; private String[] createdImports; private String[] createdStaticImports; - + //{ObjectTeams: import base: private List<String> importsToMarkAsBase; // SH} - + private boolean filterImplicitImports; private boolean useContextToFilterImplicitImports; - + /** * Creates a {@link ImportRewrite} from a {@link ICompilationUnit}. If <code>restoreExistingImports</code> * is <code>true</code>, all existing imports are kept, and new imports will be inserted at best matching locations. If @@ -174,13 +174,13 @@ public final class ImportRewrite { IImportDeclaration[] imports= cu.getImports(); for (int i= 0; i < imports.length; i++) { IImportDeclaration curr= imports[i]; - char prefix= Flags.isStatic(curr.getFlags()) ? STATIC_PREFIX : NORMAL_PREFIX; + char prefix= Flags.isStatic(curr.getFlags()) ? STATIC_PREFIX : NORMAL_PREFIX; existingImport.add(prefix + curr.getElementName()); } } return new ImportRewrite(cu, null, existingImport); } - + /** * Creates a {@link ImportRewrite} from a an AST ({@link CompilationUnit}). The AST has to be created from a * {@link ICompilationUnit}, that means {@link ASTParser#setSource(ICompilationUnit)} has been used when creating the @@ -221,7 +221,7 @@ public final class ImportRewrite { } return new ImportRewrite((ICompilationUnit) typeRoot, astRoot, existingImport); } - + private ImportRewrite(ICompilationUnit cu, CompilationUnit astRoot, List existingImports) { this.compilationUnit= cu; this.astRoot= astRoot; // might be null @@ -248,33 +248,33 @@ public final class ImportRewrite { //{ObjectTeams: this.importsToMarkAsBase = null; // SH} - + this.importOrder= CharOperation.NO_STRINGS; this.importOnDemandThreshold= 99; this.staticImportOnDemandThreshold= 99; - + this.importsKindMap = new HashMap(); } - - + + /** * Defines the import groups and order to be used by the {@link ImportRewrite}. * Imports are added to the group matching their qualified name most. The empty group name groups all imports not matching * any other group. Static imports are managed in separate groups. Static import group names are prefixed with a '#' character. * @param order A list of strings defining the import groups. A group name must be a valid package name or empty. If can be - * prefixed by the '#' character for static import groups + * prefixed by the '#' character for static import groups */ public void setImportOrder(String[] order) { if (order == null) throw new IllegalArgumentException("Order must not be null"); //$NON-NLS-1$ this.importOrder= order; } - + /** * Sets the on-demand import threshold for normal (non-static) imports. * This threshold defines the number of imports that need to be in a group to use * a on-demand (star) import declaration instead. - * + * * @param threshold a positive number defining the on-demand import threshold * for normal (non-static) imports. * @throws IllegalArgumentException a {@link IllegalArgumentException} is thrown @@ -285,12 +285,12 @@ public final class ImportRewrite { throw new IllegalArgumentException("Threshold must be positive."); //$NON-NLS-1$ this.importOnDemandThreshold= threshold; } - + /** * Sets the on-demand import threshold for static imports. * This threshold defines the number of imports that need to be in a group to use * a on-demand (star) import declaration instead. - * + * * @param threshold a positive number defining the on-demand import threshold * for normal (non-static) imports. * @throws IllegalArgumentException a {@link IllegalArgumentException} is thrown @@ -301,7 +301,7 @@ public final class ImportRewrite { throw new IllegalArgumentException("Threshold must be positive."); //$NON-NLS-1$ this.staticImportOnDemandThreshold= threshold; } - + /** * The compilation unit for which this import rewrite was created for. * @return the compilation unit for which this import rewrite was created for. @@ -318,7 +318,7 @@ public final class ImportRewrite { public ImportRewriteContext getDefaultImportRewriteContext() { return this.defaultContext; } - + /** * Specifies that implicit imports (for types in <code>java.lang</code>, types in the same package as the rewrite * compilation unit, and types in the compilation unit's main type) should not be created, except if necessary to @@ -330,10 +330,10 @@ public final class ImportRewrite { * Note: {@link #setUseContextToFilterImplicitImports(boolean)} can be used to filter implicit imports * when a context is used. * </p> - * + * * @param filterImplicitImports * if <code>true</code>, implicit imports will be filtered - * + * * @see #setUseContextToFilterImplicitImports(boolean) */ public void setFilterImplicitImports(boolean filterImplicitImports) { @@ -350,41 +350,41 @@ public final class ImportRewrite { * whether an import can be filtered because the type is implicitly visible. Note that too many imports * may be kept if this option is set and <code>addImport*(...)</code> methods are called without a context. * </p> - * + * * @param useContextToFilterImplicitImports the given setting - * + * * @see #setFilterImplicitImports(boolean) * @since 3.6 */ public void setUseContextToFilterImplicitImports(boolean useContextToFilterImplicitImports) { this.useContextToFilterImplicitImports = useContextToFilterImplicitImports; } - + private static int compareImport(char prefix, String qualifier, String name, String curr) { if (curr.charAt(0) != prefix || !curr.endsWith(name)) { return ImportRewriteContext.RES_NAME_UNKNOWN; } - + curr= curr.substring(1); // remove the prefix - + if (curr.length() == name.length()) { if (qualifier.length() == 0) { return ImportRewriteContext.RES_NAME_FOUND; } - return ImportRewriteContext.RES_NAME_CONFLICT; + return ImportRewriteContext.RES_NAME_CONFLICT; } // at this place: curr.length > name.length - + int dotPos= curr.length() - name.length() - 1; if (curr.charAt(dotPos) != '.') { return ImportRewriteContext.RES_NAME_UNKNOWN; } if (qualifier.length() != dotPos || !curr.startsWith(qualifier)) { - return ImportRewriteContext.RES_NAME_CONFLICT; + return ImportRewriteContext.RES_NAME_CONFLICT; } - return ImportRewriteContext.RES_NAME_FOUND; + return ImportRewriteContext.RES_NAME_FOUND; } - + /** * Not API, package visibility as accessed from an anonymous type */ @@ -392,7 +392,7 @@ public final class ImportRewrite { boolean allowAmbiguity= (kind == ImportRewriteContext.KIND_STATIC_METHOD) || (name.length() == 1 && name.charAt(0) == '*'); List imports= this.existingImports; char prefix= (kind == ImportRewriteContext.KIND_TYPE) ? NORMAL_PREFIX : STATIC_PREFIX; - + for (int i= imports.size() - 1; i >= 0 ; i--) { String curr= (String) imports.get(i); int res= compareImport(prefix, qualifier, name, curr); @@ -440,7 +440,7 @@ public final class ImportRewrite { public Type addImportFromSignature(String typeSig, AST ast) { return addImportFromSignature(typeSig, ast, this.defaultContext); } - + /** * Adds a new import to the rewriter's record and returns a {@link Type} node that can be used * in the code as a reference to the type. The type binding can be an array binding, type variable or wildcard. @@ -461,7 +461,7 @@ public final class ImportRewrite { * @return returns a type to which the type binding can be assigned to. The returned type contains is unqualified * when an import could be added or was already known. It is fully qualified, if an import conflict prevented the import. */ - public Type addImportFromSignature(String typeSig, AST ast, ImportRewriteContext context) { + public Type addImportFromSignature(String typeSig, AST ast, ImportRewriteContext context) { if (typeSig == null || typeSig.length() == 0) { throw new IllegalArgumentException("Invalid type signature: empty or null"); //$NON-NLS-1$ } @@ -511,7 +511,7 @@ public final class ImportRewrite { throw new IllegalArgumentException("Unknown type signature kind: " + typeSig); //$NON-NLS-1$ } } - + /** @@ -519,7 +519,7 @@ public final class ImportRewrite { * in the code. The type binding can be an array binding, type variable or wildcard. * If the binding is a generic type, the type parameters are ignored. For parameterized types, also the type * arguments are processed and imports added if necessary. Anonymous types inside type arguments are normalized to their base type, wildcard - * of wildcards are ignored. + * of wildcards are ignored. * <p> * No imports are added for types that are already known. If a import for a type is recorded to be removed, this record is discarded instead. * </p> @@ -534,7 +534,7 @@ public final class ImportRewrite { public String addImport(ITypeBinding binding) { return addImport(binding, this.defaultContext); } - + /** * Adds a new import to the rewriter's record and returns a type reference that can be used * in the code. The type binding can be an array binding, type variable or wildcard. @@ -558,7 +558,7 @@ public final class ImportRewrite { if (binding.isPrimitive() || binding.isTypeVariable() || binding.isRecovered()) { return binding.getName(); } - + ITypeBinding normalizedBinding= normalizeTypeBinding(binding); if (normalizedBinding == null) { return "invalid"; //$NON-NLS-1$ @@ -576,7 +576,7 @@ public final class ImportRewrite { } return res.toString(); } - + if (normalizedBinding.isArray()) { StringBuffer res= new StringBuffer(addImport(normalizedBinding.getElementType(), context)); for (int i= normalizedBinding.getDimensions(); i > 0; i--) { @@ -584,13 +584,13 @@ public final class ImportRewrite { } return res.toString(); } - + String qualifiedName= getRawQualifiedName(normalizedBinding); if (qualifiedName.length() > 0) { //{ObjectTeams: silently refuse to import a role type: -/* orig: +/* orig: String str= internalAddImport(qualifiedName, context); - :giro */ + :giro */ String str= importRefusingRole(binding, qualifiedName, context); // SH} @@ -600,7 +600,7 @@ public final class ImportRewrite { res.append('<'); for (int i= 0; i < typeArguments.length; i++) { if (i > 0) { - res.append(','); + res.append(','); } ITypeBinding curr= typeArguments[i]; if (containsNestedCapture(curr, false)) { // see bug 103044 @@ -616,7 +616,7 @@ public final class ImportRewrite { } return getRawName(normalizedBinding); } - + private boolean containsNestedCapture(ITypeBinding binding, boolean isNested) { if (binding == null || binding.isPrimitive() || binding.isTypeVariable()) { return false; @@ -625,7 +625,7 @@ public final class ImportRewrite { if (isNested) { return true; } - return containsNestedCapture(binding.getWildcard(), true); + return containsNestedCapture(binding.getWildcard(), true); } if (binding.isWildcardType()) { return containsNestedCapture(binding.getBound(), true); @@ -641,7 +641,7 @@ public final class ImportRewrite { } return false; } - + private boolean containsNestedCapture(String signature) { return signature.length() > 1 && signature.indexOf(Signature.C_CAPTURE, 1) != -1; } @@ -662,7 +662,7 @@ public final class ImportRewrite { } return null; } - + /** * Adds a new import to the rewriter's record and returns a {@link Type} that can be used * in the code. The type binding can be an array binding, type variable or wildcard. @@ -684,13 +684,13 @@ public final class ImportRewrite { public Type addImport(ITypeBinding binding, AST ast) { return addImport(binding, ast, this.defaultContext); } - + /** * Adds a new import to the rewriter's record and returns a {@link Type} that can be used * in the code. The type binding can be an array binding, type variable or wildcard. * If the binding is a generic type, the type parameters are ignored. For parameterized types, also the type * arguments are processed and imports added if necessary. Anonymous types inside type arguments are normalized to their base type, wildcard - * of wildcards are ignored. + * of wildcards are ignored. * <p> * No imports are added for types that are already known. If a import for a type is recorded to be removed, this record is discarded instead. * </p> @@ -709,12 +709,12 @@ public final class ImportRewrite { if (binding.isPrimitive()) { return ast.newPrimitiveType(PrimitiveType.toCode(binding.getName())); } - + ITypeBinding normalizedBinding= normalizeTypeBinding(binding); if (normalizedBinding == null) { return ast.newSimpleType(ast.newSimpleName("invalid")); //$NON-NLS-1$ } - + if (normalizedBinding.isTypeVariable()) { // no import return ast.newSimpleType(ast.newSimpleName(binding.getName())); @@ -728,21 +728,21 @@ public final class ImportRewrite { } return wcType; } - + if (normalizedBinding.isArray()) { Type elementType= addImport(normalizedBinding.getElementType(), ast, context); return ast.newArrayType(elementType, normalizedBinding.getDimensions()); } - + String qualifiedName= getRawQualifiedName(normalizedBinding); if (qualifiedName.length() > 0) { //{ObjectTeams: silently refuse to import a role type: -/* orig: +/* orig: String res= internalAddImport(qualifiedName, context); - :giro */ + :giro */ String res= importRefusingRole(binding, qualifiedName, context); // SH} - + ITypeBinding[] typeArguments= normalizedBinding.getTypeArguments(); if (typeArguments.length > 0) { Type erasureType= ast.newSimpleType(ast.newName(res)); @@ -759,7 +759,7 @@ public final class ImportRewrite { return paramType; } //{ObjectTeams: -/* orig: +/* orig: return ast.newSimpleType(ast.newName(res)); :giro */ Type type = ast.newSimpleType(ast.newName(res)); @@ -790,7 +790,7 @@ public final class ImportRewrite { return res; } // SH} - + /** * Adds a new import to the rewriter's record and returns a type reference that can be used * in the code. The type binding can only be an array or non-generic type. @@ -818,7 +818,7 @@ public final class ImportRewrite { } return internalAddImport(qualifiedTypeName, context); } - + /** * Adds a new import to the rewriter's record and returns a type reference that can be used * in the code. The type binding can only be an array or non-generic type. @@ -836,7 +836,7 @@ public final class ImportRewrite { public String addImport(String qualifiedTypeName) { return addImport(qualifiedTypeName, this.defaultContext); } - + /** * Adds a new static import to the rewriter's record and returns a reference that can be used in the code. The reference will * be fully qualified if an import conflict prevented the import or unqualified if the import succeeded or was already @@ -857,7 +857,7 @@ public final class ImportRewrite { public String addStaticImport(IBinding binding) { return addStaticImport(binding, this.defaultContext); } - + /** * Adds a new static import to the rewriter's record and returns a reference that can be used in the code. The reference will * be fully qualified if an import conflict prevented the import or unqualified if the import succeeded or was already @@ -877,7 +877,7 @@ public final class ImportRewrite { * @throws IllegalArgumentException an {@link IllegalArgumentException} is thrown if the binding is not a static field * or method. */ - public String addStaticImport(IBinding binding, ImportRewriteContext context) { + public String addStaticImport(IBinding binding, ImportRewriteContext context) { if (Modifier.isStatic(binding.getModifiers())) { if (binding instanceof IVariableBinding) { IVariableBinding variableBinding= (IVariableBinding) binding; @@ -897,7 +897,7 @@ public final class ImportRewrite { } throw new IllegalArgumentException("Binding must be a static field or method."); //$NON-NLS-1$ } - + /** * Adds a new static import to the rewriter's record and returns a reference that can be used in the code. The reference will * be fully qualified if an import conflict prevented the import or unqualified if the import succeeded or was already @@ -919,7 +919,7 @@ public final class ImportRewrite { public String addStaticImport(String declaringTypeName, String simpleName, boolean isField) { return addStaticImport(declaringTypeName, simpleName, isField, this.defaultContext); } - + /** * Adds a new static import to the rewriter's record and returns a reference that can be used in the code. The reference will * be fully qualified if an import conflict prevented the import or unqualified if the import succeeded or was already @@ -940,7 +940,7 @@ public final class ImportRewrite { * @return returns either the simple member name if the import was successful or else the qualified name if * an import conflict prevented the import. */ - public String addStaticImport(String declaringTypeName, String simpleName, boolean isField, ImportRewriteContext context) { + public String addStaticImport(String declaringTypeName, String simpleName, boolean isField, ImportRewriteContext context) { String key = declaringTypeName + '.' + simpleName; if (declaringTypeName.indexOf('.') == -1) { return key; @@ -959,9 +959,9 @@ public final class ImportRewrite { } return simpleName; } - + private String internalAddImport(String fullTypeName, ImportRewriteContext context) { - int idx= fullTypeName.lastIndexOf('.'); + int idx= fullTypeName.lastIndexOf('.'); String typeContainerName, typeName; if (idx != -1) { typeContainerName= fullTypeName.substring(0, idx); @@ -970,14 +970,14 @@ public final class ImportRewrite { typeContainerName= ""; //$NON-NLS-1$ typeName= fullTypeName; } - + if (typeContainerName.length() == 0 && PrimitiveType.toCode(typeName) != null) { return fullTypeName; } - + if (context == null) context= this.defaultContext; - + int res= context.findInContext(typeContainerName, typeName, ImportRewriteContext.KIND_TYPE); if (res == ImportRewriteContext.RES_NAME_CONFLICT) { return fullTypeName; @@ -987,22 +987,22 @@ public final class ImportRewrite { } return typeName; } - + private void addEntry(String entry) { this.existingImports.add(entry); - + if (this.removedImports != null) { if (this.removedImports.remove(entry)) { return; } } - + if (this.addedImports == null) { this.addedImports= new ArrayList(); } this.addedImports.add(entry); } - + private boolean removeEntry(String entry) { if (this.existingImports.remove(entry)) { if (this.addedImports != null) { @@ -1018,7 +1018,7 @@ public final class ImportRewrite { } return false; } - + /** * Records to remove a import. No remove is recorded if no such import exists or if such an import is recorded * to be added. In that case the record of the addition is discarded. @@ -1032,7 +1032,7 @@ public final class ImportRewrite { public boolean removeImport(String qualifiedName) { return removeEntry(NORMAL_PREFIX + qualifiedName); } - + /** * Records to remove a static import. No remove is recorded if no such import exists or if such an import is recorded * to be added. In that case the record of the addition is discarded. @@ -1045,8 +1045,8 @@ public final class ImportRewrite { */ public boolean removeStaticImport(String qualifiedName) { return removeEntry(STATIC_PREFIX + qualifiedName); - } - + } + private static String getRawName(ITypeBinding normalizedBinding) { return normalizedBinding.getTypeDeclaration().getName(); } @@ -1054,7 +1054,7 @@ public final class ImportRewrite { private static String getRawQualifiedName(ITypeBinding normalizedBinding) { return normalizedBinding.getTypeDeclaration().getQualifiedName(); } - + /** * Converts all modifications recorded by this rewriter into an object representing the corresponding text @@ -1073,7 +1073,7 @@ public final class ImportRewrite { if (monitor == null) { monitor= new NullProgressMonitor(); } - + try { monitor.beginTask(Messages.bind(Messages.importRewrite_processDescription), 2); if (!hasRecordedChanges()) { @@ -1081,7 +1081,7 @@ public final class ImportRewrite { this.createdStaticImports= CharOperation.NO_STRINGS; return new MultiTextEdit(); } - + CompilationUnit usedAstRoot= this.astRoot; if (usedAstRoot == null) { ASTParser parser= ASTParser.newParser(AST.JLS3); @@ -1090,7 +1090,7 @@ public final class ImportRewrite { parser.setResolveBindings(false); usedAstRoot= (CompilationUnit) parser.createAST(new SubProgressMonitor(monitor, 1)); } - + ImportRewriteAnalyzer computer= new ImportRewriteAnalyzer( this.compilationUnit, @@ -1101,7 +1101,7 @@ public final class ImportRewrite { this.restoreExistingImports, this.useContextToFilterImplicitImports); computer.setFilterImplicitImports(this.filterImplicitImports); - + if (this.addedImports != null) { for (int i= 0; i < this.addedImports.size(); i++) { String curr= (String) this.addedImports.get(i); @@ -1116,7 +1116,7 @@ public final class ImportRewrite { // SH} } } - + if (this.removedImports != null) { for (int i= 0; i < this.removedImports.size(); i++) { String curr= (String) this.removedImports.get(i); @@ -1133,10 +1133,10 @@ public final class ImportRewrite { for (int i= 0; i < this.importsToMarkAsBase.size(); i++) { String curr = this.importsToMarkAsBase.get(i); computer.setBase(curr); - } + } } // SH} - + TextEdit result= computer.getResultingEdits(new SubProgressMonitor(monitor, 1)); this.createdImports= computer.getCreatedImports(); this.createdStaticImports= computer.getCreatedStaticImports(); @@ -1145,7 +1145,7 @@ public final class ImportRewrite { monitor.done(); } } - + /** * Returns all new non-static imports created by the last invocation of {@link #rewriteImports(IProgressMonitor)} * or <code>null</code> if these methods have not been called yet. @@ -1158,7 +1158,7 @@ public final class ImportRewrite { public String[] getCreatedImports() { return this.createdImports; } - + /** * Returns all new static imports created by the last invocation of {@link #rewriteImports(IProgressMonitor)} * or <code>null</code> if these methods have not been called yet. @@ -1171,43 +1171,43 @@ public final class ImportRewrite { public String[] getCreatedStaticImports() { return this.createdStaticImports; } - + /** * Returns all non-static imports that are recorded to be added. - * + * * @return the imports recorded to be added. */ public String[] getAddedImports() { return filterFromList(this.addedImports, NORMAL_PREFIX); } - + /** * Returns all static imports that are recorded to be added. - * + * * @return the static imports recorded to be added. */ public String[] getAddedStaticImports() { return filterFromList(this.addedImports, STATIC_PREFIX); } - + /** * Returns all non-static imports that are recorded to be removed. - * + * * @return the imports recorded to be removed. */ public String[] getRemovedImports() { return filterFromList(this.removedImports, NORMAL_PREFIX); } - + /** * Returns all static imports that are recorded to be removed. - * + * * @return the static imports recorded to be removed. */ public String[] getRemovedStaticImports() { return filterFromList(this.removedImports, STATIC_PREFIX); } - + /** * Returns <code>true</code> if imports have been recorded to be added or removed. * @return boolean returns if any changes to imports have been recorded. @@ -1220,18 +1220,18 @@ public final class ImportRewrite { // SH} (this.removedImports != null && !this.removedImports.isEmpty()); } - + //{ObjectTeams: my version of above in anticipation of https://bugs.eclipse.org/bugs/show_bug.cgi?id=271812 public boolean myHasRecordedChanges() { - return + return (this.addedImports != null && !this.addedImports.isEmpty()) || //{ObjectTeams: (this.importsToMarkAsBase != null && !this.importsToMarkAsBase.isEmpty()) || // SH} - (this.removedImports != null && !this.removedImports.isEmpty()); + (this.removedImports != null && !this.removedImports.isEmpty()); } // SH} - + private static String[] filterFromList(List imports, char prefix) { if (imports == null) { return CharOperation.NO_STRINGS; @@ -1245,7 +1245,7 @@ public final class ImportRewrite { } return (String[]) res.toArray(new String[res.size()]); } - + //{ObjectTeams: import base (not like the others, since this only changes an existing import). public boolean setImportBase(IBinding binding) { if (!(binding instanceof ITypeBinding)) @@ -1269,11 +1269,11 @@ public final class ImportRewrite { return false; } if (res == ImportRewriteContext.RES_NAME_FOUND) { - if (this.importsToMarkAsBase == null) + if (this.importsToMarkAsBase == null) this.importsToMarkAsBase = new ArrayList(1); this.importsToMarkAsBase.add(qualifiedTypeName); } - return true; + return true; } // Note: the "base" modifier will be provided by role org.eclipse.objectteams.otdt.ui.assist.BaseImportRewriting.ImportRewriteAdaptor public String addImportBase(String baseName) { @@ -1281,5 +1281,5 @@ public final class ImportRewrite { } // SH} - + } diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/rewrite/ListRewrite.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/rewrite/ListRewrite.java index 133a3be1a..e74b3b048 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/rewrite/ListRewrite.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/rewrite/ListRewrite.java @@ -38,7 +38,7 @@ import org.eclipse.text.edits.TextEditGroup; * @since 3.0 */ public final class ListRewrite { - + private ASTNode parent; private StructuralPropertyDescriptor childProperty; private ASTRewrite rewriter; @@ -51,9 +51,9 @@ public final class ListRewrite { // note: clients like ModifierCorrectionSubProcessor might need to handle // RoleTypeDeclarations without explict knowledge. if ( parent.getNodeType() == ASTNode.ROLE_TYPE_DECLARATION - && childProperty.getNodeClass() == TypeDeclaration.class) + && childProperty.getNodeClass() == TypeDeclaration.class) { - if (childProperty == TypeDeclaration.MODIFIERS2_PROPERTY) + if (childProperty == TypeDeclaration.MODIFIERS2_PROPERTY) childProperty = RoleTypeDeclaration.MODIFIERS2_PROPERTY; else if (childProperty == TypeDeclaration.SUPER_INTERFACE_TYPES_PROPERTY) childProperty = RoleTypeDeclaration.SUPER_INTERFACE_TYPES_PROPERTY; @@ -65,15 +65,15 @@ public final class ListRewrite { // SH} this.childProperty= childProperty; } - + private RewriteEventStore getRewriteStore() { return this.rewriter.getRewriteEventStore(); } - + private ListRewriteEvent getEvent() { return getRewriteStore().getListEvent(this.parent, this.childProperty, true); } - + /** * Returns the parent of the list for which this list rewriter was created. @@ -84,10 +84,10 @@ public final class ListRewrite { public ASTNode getParent() { return this.parent; } - + /** - * Returns the property of the parent node for which this list rewriter was created. - * + * Returns the property of the parent node for which this list rewriter was created. + * * @return the property of the parent node for which this list rewriter was created * @see #getParent() * @since 3.1 @@ -95,13 +95,13 @@ public final class ListRewrite { public StructuralPropertyDescriptor getLocationInParent() { return this.childProperty; } - + /** * Removes the given node from its parent's list property in the rewriter. * The node must be contained in the list. * The AST itself is not actually modified in any way; rather, the rewriter * just records a note that this node has been removed from this list. - * + * * @param node the node being removed. The node can either be an original node in this list * or (since 3.4) a new node already inserted or used as replacement in this AST rewriter. * @param editGroup the edit group in which to collect the corresponding @@ -119,7 +119,7 @@ public final class ListRewrite { getRewriteStore().setEventEditGroup(event, editGroup); } } - + /** * Returns the ASTRewrite instance from which this ListRewriter has been created from. * @return the parent AST Rewriter instance. @@ -128,7 +128,7 @@ public final class ListRewrite { public ASTRewrite getASTRewrite() { return this.rewriter; } - + /** * Replaces the given node from its parent's list property in the rewriter. @@ -136,11 +136,11 @@ public final class ListRewrite { * The replacement node must either be brand new (not part of the original AST) * or a placeholder node (for example, one created by * {@link ASTRewrite#createCopyTarget(ASTNode)}, - * {@link ASTRewrite#createMoveTarget(ASTNode)}, + * {@link ASTRewrite#createMoveTarget(ASTNode)}, * or {@link ASTRewrite#createStringPlaceholder(String, int)}). The AST itself * is not actually modified in any way; rather, the rewriter just records * a note that this node has been replaced in this list. - * + * * @param node the node being removed. The node can either be an original node in this list * or (since 3.4) a new node already inserted or used as replacement in this AST rewriter. * @param replacement the replacement node, or <code>null</code> if no @@ -153,7 +153,7 @@ public final class ListRewrite { * (not a member of this node's original list) */ public void replace(ASTNode node, ASTNode replacement, TextEditGroup editGroup) { - if (node == null) { + if (node == null) { throw new IllegalArgumentException(); } RewriteEvent event= getEvent().replaceEntry(node, replacement); @@ -163,29 +163,29 @@ public final class ListRewrite { } /** - * Inserts the given node into the list after the given element. + * Inserts the given node into the list after the given element. * The existing node must be in the list, either as an original or as a new * node that has been inserted. * The inserted node must either be brand new (not part of the original AST) * or a placeholder node (for example, one created by - * {@link ASTRewrite#createCopyTarget(ASTNode)}, - * {@link ASTRewrite#createMoveTarget(ASTNode)}, + * {@link ASTRewrite#createCopyTarget(ASTNode)}, + * {@link ASTRewrite#createMoveTarget(ASTNode)}, * or {@link ASTRewrite#createStringPlaceholder(String, int)}). The AST itself * is not actually modified in any way; rather, the rewriter just records * a note that this node has been inserted into the list. - * + * * @param node the node to insert * @param element the element after which the given node is to be inserted * @param editGroup the edit group in which to collect the corresponding * text edits, or <code>null</code> if ungrouped - * @throws IllegalArgumentException if the node or element is null, + * @throws IllegalArgumentException if the node or element is null, * or if the node is not part of this rewriter's AST, or if the inserted node * is not a new node (or placeholder), or if <code>element</code> is not a member * of the list (original or new), or if the described modification is * otherwise invalid */ public void insertAfter(ASTNode node, ASTNode element, TextEditGroup editGroup) { - if (node == null || element == null) { + if (node == null || element == null) { throw new IllegalArgumentException(); } int index= getEvent().getIndex(element, ListRewriteEvent.BOTH); @@ -194,31 +194,31 @@ public final class ListRewrite { } internalInsertAt(node, index + 1, true, editGroup); } - + /** - * Inserts the given node into the list before the given element. + * Inserts the given node into the list before the given element. * The existing node must be in the list, either as an original or as a new * node that has been inserted. * The inserted node must either be brand new (not part of the original AST) * or a placeholder node (for example, one created by - * {@link ASTRewrite#createCopyTarget(ASTNode)}, - * {@link ASTRewrite#createMoveTarget(ASTNode)}, + * {@link ASTRewrite#createCopyTarget(ASTNode)}, + * {@link ASTRewrite#createMoveTarget(ASTNode)}, * or {@link ASTRewrite#createStringPlaceholder(String, int)}). The AST itself * is not actually modified in any way; rather, the rewriter just records * a note that this node has been inserted into the list. - * + * * @param node the node to insert * @param element the element before which the given node is to be inserted * @param editGroup the edit group in which to collect the corresponding * text edits, or <code>null</code> if ungrouped - * @throws IllegalArgumentException if the node or element is null, + * @throws IllegalArgumentException if the node or element is null, * or if the node is not part of this rewriter's AST, or if the inserted node * is not a new node (or placeholder), or if <code>element</code> is not a member * of the list (original or new), or if the described modification is * otherwise invalid */ public void insertBefore(ASTNode node, ASTNode element, TextEditGroup editGroup) { - if (node == null || element == null) { + if (node == null || element == null) { throw new IllegalArgumentException(); } int index= getEvent().getIndex(element, ListRewriteEvent.BOTH); @@ -227,11 +227,11 @@ public final class ListRewrite { } internalInsertAt(node, index, false, editGroup); } - + /** * Inserts the given node into the list at the start of the list. - * Equivalent to <code>insertAt(node, 0, editGroup)</code>. - * + * Equivalent to <code>insertAt(node, 0, editGroup)</code>. + * * @param node the node to insert * @param editGroup the edit group in which to collect the corresponding * text edits, or <code>null</code> if ungrouped @@ -242,16 +242,16 @@ public final class ListRewrite { * @see #insertAt(ASTNode, int, TextEditGroup) */ public void insertFirst(ASTNode node, TextEditGroup editGroup) { - if (node == null) { + if (node == null) { throw new IllegalArgumentException(); } internalInsertAt(node, 0, false, editGroup); } - + /** * Inserts the given node into the list at the end of the list. - * Equivalent to <code>insertAt(node, -1, editGroup)</code>. - * + * Equivalent to <code>insertAt(node, -1, editGroup)</code>. + * * @param node the node to insert * @param editGroup the edit group in which to collect the corresponding * text edits, or <code>null</code> if ungrouped @@ -262,24 +262,24 @@ public final class ListRewrite { * @see #insertAt(ASTNode, int, TextEditGroup) */ public void insertLast(ASTNode node, TextEditGroup editGroup) { - if (node == null) { + if (node == null) { throw new IllegalArgumentException(); } internalInsertAt(node, -1, true, editGroup); } /** - * Inserts the given node into the list at the given index. + * Inserts the given node into the list at the given index. * The index corresponds to a combined list of original and new nodes; * removed or replaced nodes are still in the combined list. * The inserted node must either be brand new (not part of the original AST) * or a placeholder node (for example, one created by - * {@link ASTRewrite#createCopyTarget(ASTNode)}, - * {@link ASTRewrite#createMoveTarget(ASTNode)}, + * {@link ASTRewrite#createCopyTarget(ASTNode)}, + * {@link ASTRewrite#createMoveTarget(ASTNode)}, * or {@link ASTRewrite#createStringPlaceholder(String, int)}). The AST itself * is not actually modified in any way; rather, the rewriter just records * a note that this node has been inserted into the list. - * + * * @param node the node to insert * @param index insertion index in the combined list of original and * inserted nodes; <code>-1</code> indicates insertion as the last element @@ -289,16 +289,16 @@ public final class ListRewrite { * of this rewriter's AST, or if the inserted node is not a new node (or * placeholder), or if the described modification is otherwise invalid * (not a member of this node's original list) - * @throws IndexOutOfBoundsException if the index is negative and not -1, + * @throws IndexOutOfBoundsException if the index is negative and not -1, * or if it is larger than the size of the combined list */ public void insertAt(ASTNode node, int index, TextEditGroup editGroup) { - if (node == null) { + if (node == null) { throw new IllegalArgumentException(); } internalInsertAt(node, index, isInsertBoundToPreviousByDefault(node), editGroup); } - + private void internalInsertAt(ASTNode node, int index, boolean boundToPrevious, TextEditGroup editGroup) { RewriteEvent event= getEvent().insert(node, index); if (boundToPrevious) { @@ -306,10 +306,10 @@ public final class ListRewrite { } if (editGroup != null) { getRewriteStore().setEventEditGroup(event, editGroup); - } + } } - - + + private ASTNode createTargetNode(ASTNode first, ASTNode last, boolean isMove, ASTNode replacingNode, TextEditGroup editGroup) { if (first == null || last == null) { throw new IllegalArgumentException(); @@ -320,29 +320,29 @@ public final class ListRewrite { if (placeholder == null) { throw new IllegalArgumentException("Creating a target node is not supported for nodes of type" + first.getClass().getName()); //$NON-NLS-1$ } - + Block internalPlaceHolder= nodeStore.createCollapsePlaceholder(); CopySourceInfo info= getRewriteStore().createRangeCopy(this.parent, this.childProperty, first, last, isMove, internalPlaceHolder, replacingNode, editGroup); nodeStore.markAsCopyTarget(placeholder, info); - - return placeholder; + + return placeholder; } - + /** * Creates and returns a placeholder node for a true copy of a range of nodes of the * current list. * The placeholder node can either be inserted as new or used to replace an - * existing node. When the document is rewritten, a copy of the source code + * existing node. When the document is rewritten, a copy of the source code * for the given node range is inserted into the output document at the position * corresponding to the placeholder (indentation is adjusted). - * + * * @param first the node that starts the range * @param last the node that ends the range * @return the new placeholder node * @throws IllegalArgumentException An exception is thrown if the first or last node * are <code>null</code>, if a node is not a child of the current list or if the first node * is not before the last node. An <code>IllegalArgumentException</code> is - * also thrown if the copied range is overlapping with an other moved or copied range. + * also thrown if the copied range is overlapping with an other moved or copied range. */ public final ASTNode createCopyTarget(ASTNode first, ASTNode last) { if (first == last) { @@ -351,38 +351,38 @@ public final class ListRewrite { return createTargetNode(first, last, false, null, null); } } - + /** * Creates and returns a placeholder node for a move of a range of nodes of the * current list. * The placeholder node can either be inserted as new or used to replace an - * existing node. When the document is rewritten, a copy of the source code + * existing node. When the document is rewritten, a copy of the source code * for the given node range is inserted into the output document at the position * corresponding to the placeholder (indentation is adjusted). - * + * * @param first the node that starts the range * @param last the node that ends the range * @return the new placeholder node * @throws IllegalArgumentException An exception is thrown if the first or last node * are <code>null</code>, if a node is not a child of the current list or if the first node * is not before the last node. An <code>IllegalArgumentException</code> is - * also thrown if the moved range is overlapping with an other moved or copied range. - * + * also thrown if the moved range is overlapping with an other moved or copied range. + * * @since 3.1 */ public final ASTNode createMoveTarget(ASTNode first, ASTNode last) { return createMoveTarget(first, last, null, null); } - + /** * Creates and returns a placeholder node for a move of a range of nodes of the * current list. The moved nodes can optionally be replaced by a specified node. - * + * * The placeholder node can either be inserted as new or used to replace an - * existing node. When the document is rewritten, a copy of the source code + * existing node. When the document is rewritten, a copy of the source code * for the given node range is inserted into the output document at the position * corresponding to the placeholder (indentation is adjusted). - * + * * @param first the node that starts the range * @param last the node that ends the range * @param replacingNode a node that is set at the location of the moved nodes @@ -394,8 +394,8 @@ public final class ListRewrite { * last node are <code>null</code>, if a node is not a child of the current list or * if the first node is not before the last node. An <code>IllegalArgumentException * </code> is also thrown if the moved range is overlapping with an other moved - * or copied range. - * + * or copied range. + * * @since 3.1 */ public final ASTNode createMoveTarget(ASTNode first, ASTNode last, ASTNode replacingNode, TextEditGroup editGroup) { @@ -406,30 +406,30 @@ public final class ListRewrite { return createTargetNode(first, last, true, replacingNode, editGroup); } } - + /* - * Heuristic to decide if a inserted node is bound to previous or the next sibling. + * Heuristic to decide if a inserted node is bound to previous or the next sibling. */ private boolean isInsertBoundToPreviousByDefault(ASTNode node) { return (node instanceof Statement || node instanceof FieldDeclaration); } - + /** * Returns the original nodes in the list property managed by this * rewriter. The returned list is unmodifiable. - * + * * @return a list of all original nodes in the list */ public List getOriginalList() { List list= (List) getEvent().getOriginalValue(); return Collections.unmodifiableList(list); } - + /** * Returns the nodes in the revised list property managed by this * rewriter. The returned list is unmodifiable. - * - * @return a list of all nodes in the list taking into account + * + * @return a list of all nodes in the list taking into account * all the described changes */ public List getRewrittenList() { diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/rewrite/TargetSourceRangeComputer.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/rewrite/TargetSourceRangeComputer.java index 2ed0c9f22..652fcfb11 100644 --- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/rewrite/TargetSourceRangeComputer.java +++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/rewrite/TargetSourceRangeComputer.java @@ -24,7 +24,7 @@ import org.eclipse.jdt.core.dom.CompilationUnit; * comments preceding or following them. * </p> * <p> - * Clients should subclass if they need to influence the + * Clients should subclass if they need to influence the * the source range to be affected when replacing or deleting a particular node. * An instance of the subclass should be registered with * {@link ASTRewrite#setTargetSourceRangeComputer(TargetSourceRangeComputer)}. @@ -32,15 +32,15 @@ import org.eclipse.jdt.core.dom.CompilationUnit; * the {@link #computeSourceRange(ASTNode)} method on this object will be * used to compute the source range for a node being deleted or replaced. * </p> - * + * * @since 3.1 */ public class TargetSourceRangeComputer { - + /** * Reified source range. Instances are "value" object * (cannot be modified). - * + * * @since 3.1 */ public static final class SourceRange { @@ -49,16 +49,16 @@ public class TargetSourceRangeComputer { * if no source position information is known. */ private int startPosition; - + /** * (possibly 0) length, or <code>0</code> * if no source position information is known. */ private int length; - + /** * Creates a new source range. - * + * * @param startPosition the 0-based character index, or <code>-1</code> * if no source position information is known * @param length the (possibly 0) length, or <code>0</code> @@ -68,10 +68,10 @@ public class TargetSourceRangeComputer { this.startPosition = startPosition; this.length = length; } - + /** * Returns the start position. - * + * * @return the 0-based character index, or <code>-1</code> * if no source position information is known */ @@ -81,7 +81,7 @@ public class TargetSourceRangeComputer { /** * Returns the source length. - * + * * @return a (possibly 0) length, or <code>0</code> * if no source position information is known */ @@ -118,7 +118,7 @@ public class TargetSourceRangeComputer { * given node. The resulting source range must cover at least the * original source range of the node. * </p> - * + * * @param node the node with a known source range in the compilation unit * being rewritten * @return the exact source range in the compilation unit being rewritten |