diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTNodeProperty.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTNodeProperty.java index 4ce9d34a2ae..a16d6877b11 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTNodeProperty.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTNodeProperty.java @@ -6,8 +6,8 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Doug Schaefer (IBM) - Initial API and implementation - * Mike Kucera - cleanup + * Doug Schaefer (IBM) - Initial API and implementation + * Mike Kucera - cleanup *******************************************************************************/ package org.eclipse.cdt.core.dom.ast; @@ -21,7 +21,6 @@ package org.eclipse.cdt.core.dom.ast; * @noinstantiate This class is not intended to be instantiated by clients. */ public class ASTNodeProperty { - private final String name; public ASTNodeProperty(String n) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTTypeMatcher.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTTypeMatcher.java index 9705a2da9c1..a420d803ecd 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTTypeMatcher.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ASTTypeMatcher.java @@ -6,7 +6,7 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Sergey Prigogin (Google) - initial API and implementation + * Sergey Prigogin (Google) - initial API and implementation *******************************************************************************/ package org.eclipse.cdt.core.dom.ast; @@ -16,7 +16,6 @@ import org.eclipse.cdt.core.parser.util.IObjectMatcher; * @noextend This class is not intended to be subclassed by clients. */ public class ASTTypeMatcher implements IObjectMatcher { - /** * Returns true if the two objects are equal or represent the same type. */ diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTCastExpression.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTCastExpression.java index 6466d795e13..b0ef9173757 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTCastExpression.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTCastExpression.java @@ -6,7 +6,7 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * John Camelon (IBM Rational Software) - Initial API and implementation + * John Camelon (IBM Rational Software) - Initial API and implementation *******************************************************************************/ package org.eclipse.cdt.core.dom.ast; @@ -17,6 +17,17 @@ package org.eclipse.cdt.core.dom.ast; * @noimplement This interface is not intended to be implemented by clients. */ public interface IASTCastExpression extends IASTExpression { + /** + * TYPE_ID represents the relationship between a cast + * expression and the type cast to. + */ + public static final ASTNodeProperty TYPE_ID = new ASTNodeProperty("IASTCastExpression.TYPE_ID - Type Id expression is cast to"); //$NON-NLS-1$ + + /** + * OPERAND represents the relationship between a cast + * expression and the expression it is casting (operand). + */ + public static final ASTNodeProperty OPERAND = new ASTNodeProperty("IASTCastExpression.OPERAND - expression being cast"); //$NON-NLS-1$ /** * op_cast represents a traditional cast. @@ -42,12 +53,6 @@ public interface IASTCastExpression extends IASTExpression { */ public void setOperator(int value); - /** - * OPERAND represents the relationship between a cast - * expression and the expression it is casting (operand). - */ - public static final ASTNodeProperty OPERAND = new ASTNodeProperty("IASTCastExpression.OPERAND - expression being cast"); //$NON-NLS-1$ - /** * Get expression being cast. * @@ -63,12 +68,6 @@ public interface IASTCastExpression extends IASTExpression { */ public void setOperand(IASTExpression expression); - /** - * TYPE_ID represents the relationship between a cast - * expression and the type cast to. - */ - public static final ASTNodeProperty TYPE_ID = new ASTNodeProperty("IASTCastExpression.TYPE_ID - Type Id expression is cast to"); //$NON-NLS-1$ - /** * Set the typeId. * diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTExpression.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTExpression.java index ab5cb7f26fc..9c8e89abf09 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTExpression.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTExpression.java @@ -6,8 +6,8 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Doug Schaefer (IBM) - Initial API and implementation - * Markus Schorn (Wind River Systems) + * Doug Schaefer (IBM) - Initial API and implementation + * Markus Schorn (Wind River Systems) *******************************************************************************/ package org.eclipse.cdt.core.dom.ast; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTFunctionDeclarator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTFunctionDeclarator.java index 70bbb3f460c..a6e2ddc2216 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTFunctionDeclarator.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTFunctionDeclarator.java @@ -6,8 +6,8 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Doug Schaefer (IBM) - Initial API and implementation - * Markus Schorn (Wind River Systems) + * Doug Schaefer (IBM) - Initial API and implementation + * Markus Schorn (Wind River Systems) *******************************************************************************/ package org.eclipse.cdt.core.dom.ast; @@ -18,7 +18,6 @@ package org.eclipse.cdt.core.dom.ast; * @noimplement This interface is not intended to be implemented by clients. */ public interface IASTFunctionDeclarator extends IASTDeclarator { - /** * @since 5.1 */ diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTFunctionDefinition.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTFunctionDefinition.java index 7cf4d873fe1..24191a961b1 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTFunctionDefinition.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTFunctionDefinition.java @@ -17,7 +17,6 @@ package org.eclipse.cdt.core.dom.ast; * @noimplement This interface is not intended to be implemented by clients. */ public interface IASTFunctionDefinition extends IASTDeclaration { - /** * DECL_SPECIFIER represents the relationship between a * IASTFunctionDefinition and its diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTInitializerClause.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTInitializerClause.java index 8243d6a663c..0829eec5795 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTInitializerClause.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTInitializerClause.java @@ -6,7 +6,7 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Markus Schorn - initial API and implementation + * Markus Schorn - initial API and implementation *******************************************************************************/ package org.eclipse.cdt.core.dom.ast; @@ -17,7 +17,6 @@ package org.eclipse.cdt.core.dom.ast; * @noimplement This interface is not intended to be implemented by clients. */ public interface IASTInitializerClause extends IASTNode { - @Override IASTInitializerClause copy(); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTInitializerList.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTInitializerList.java index 412d61e7d58..e0701c605cb 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTInitializerList.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTInitializerList.java @@ -6,8 +6,8 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Doug Schaefer (IBM) - Initial API and implementation - * Markus Schorn (Wind River Systems) + * Doug Schaefer (IBM) - Initial API and implementation + * Markus Schorn (Wind River Systems) *******************************************************************************/ package org.eclipse.cdt.core.dom.ast; @@ -19,7 +19,6 @@ package org.eclipse.cdt.core.dom.ast; * @noimplement This interface is not intended to be implemented by clients. */ public interface IASTInitializerList extends IASTInitializer, IASTInitializerClause { - public static final ASTNodeProperty NESTED_INITIALIZER = new ASTNodeProperty( "IASTInitializerList.NESTED_INITIALIZER [IASTInitializerClause]"); //$NON-NLS-1$ @@ -69,5 +68,4 @@ public interface IASTInitializerList extends IASTInitializer, IASTInitializerCla */ @Deprecated public void addInitializer(IASTInitializer initializer); - } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTLabelStatement.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTLabelStatement.java index d0da8fea66a..78fda58a327 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTLabelStatement.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTLabelStatement.java @@ -6,7 +6,7 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Doug Schaefer (IBM) - Initial API and implementation + * Doug Schaefer (IBM) - Initial API and implementation *******************************************************************************/ package org.eclipse.cdt.core.dom.ast; @@ -37,13 +37,15 @@ public interface IASTLabelStatement extends IASTStatement, IASTNameOwner { */ public void setName(IASTName name); - + /** + * Returns the statement following the label. + */ public IASTStatement getNestedStatement(); /** * @param s */ - public void setNestedStatement( IASTStatement s ); + public void setNestedStatement(IASTStatement s); /** * @since 5.1 @@ -56,5 +58,4 @@ public interface IASTLabelStatement extends IASTStatement, IASTNameOwner { */ @Override public IASTLabelStatement copy(CopyStyle style); - } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTProblem.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTProblem.java index 9906c152a54..9dc4faf56df 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTProblem.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTProblem.java @@ -6,8 +6,8 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * IBM - Initial API and implementation - * Markus Schorn (Wind River Systems) + * IBM - Initial API and implementation + * Markus Schorn (Wind River Systems) *******************************************************************************/ package org.eclipse.cdt.core.dom.ast; @@ -19,7 +19,6 @@ import org.eclipse.cdt.core.parser.IProblem; * @noimplement This interface is not intended to be implemented by clients. */ public interface IASTProblem extends IProblem, IASTNode { - /** * @since 5.1 */ diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTProblemExpression.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTProblemExpression.java index cee135c89e2..cf3f907d05b 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTProblemExpression.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTProblemExpression.java @@ -6,19 +6,18 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * John Camelon (IBM) - Initial API and implementation + * John Camelon (IBM) - Initial API and implementation *******************************************************************************/ package org.eclipse.cdt.core.dom.ast; /** - * This interface represents a parse problem where we tried to match against a - * expression. + * This interface represents a parse problem where we tried to match against + * an expression. * * @noextend This interface is not intended to be extended by clients. * @noimplement This interface is not intended to be implemented by clients. */ public interface IASTProblemExpression extends IASTExpression, IASTProblemHolder { - /** * @since 5.1 */ diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTProblemHolder.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTProblemHolder.java index 4f517264961..14cf223cda6 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTProblemHolder.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTProblemHolder.java @@ -6,7 +6,7 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * John Camelon (IBM) - Initial API and implementation + * John Camelon (IBM) - Initial API and implementation *******************************************************************************/ package org.eclipse.cdt.core.dom.ast; @@ -38,5 +38,4 @@ public interface IASTProblemHolder { * IASTProblem */ public void setProblem(IASTProblem p); - } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTTypeId.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTTypeId.java index 9161a767800..767b376941d 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTTypeId.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTTypeId.java @@ -6,7 +6,7 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * John Camelon (IBM Rational Software) - Initial API and implementation + * John Camelon (IBM Rational Software) - Initial API and implementation *******************************************************************************/ package org.eclipse.cdt.core.dom.ast; @@ -15,7 +15,6 @@ package org.eclipse.cdt.core.dom.ast; * @noimplement This interface is not intended to be implemented by clients. */ public interface IASTTypeId extends IASTNode { - /** * Constant. */ diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTTypeIdInitializerExpression.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTTypeIdInitializerExpression.java index e46da278b5e..1d778e5c1bf 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTTypeIdInitializerExpression.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTTypeIdInitializerExpression.java @@ -6,12 +6,11 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * John Camelon (IBM Rational Software) - Initial API and implementation - * Markus Schorn (Wind River Systems) + * John Camelon (IBM Rational Software) - Initial API and implementation + * Markus Schorn (Wind River Systems) *******************************************************************************/ package org.eclipse.cdt.core.dom.ast; - /** * Compound literal: type-id { initializer } * @@ -20,7 +19,6 @@ package org.eclipse.cdt.core.dom.ast; * @since 5.1 */ public interface IASTTypeIdInitializerExpression extends IASTExpression { - /** * TYPE_ID represents the relationship between an * IASTTypeIdInitializerExpression and @@ -58,4 +56,10 @@ public interface IASTTypeIdInitializerExpression extends IASTExpression { @Override public IASTTypeIdInitializerExpression copy(); + + /** + * @since 5.4 + */ + @Override + public IASTTypeIdInitializerExpression copy(CopyStyle style); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IVariable.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IVariable.java index a69ffc3ba26..9f00e3e1054 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IVariable.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IVariable.java @@ -6,8 +6,8 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Doug Schaefer (IBM) - Initial API and implementation - * Markus Schorn (Wind River Systems) + * Doug Schaefer (IBM) - Initial API and implementation + * Markus Schorn (Wind River Systems) *******************************************************************************/ package org.eclipse.cdt.core.dom.ast; @@ -18,6 +18,8 @@ package org.eclipse.cdt.core.dom.ast; * @noimplement This interface is not intended to be implemented by clients. */ public interface IVariable extends IBinding { + /** @since 5.4 */ + public static final IVariable[] EMPTY_VARIABLE_ARRAY = {}; /** * Returns the type of the variable diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/c/ICASTDesignatedInitializer.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/c/ICASTDesignatedInitializer.java index aacfdab36d1..a25a89c9321 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/c/ICASTDesignatedInitializer.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/c/ICASTDesignatedInitializer.java @@ -6,8 +6,8 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * John Camelon (IBM) - Initial API and implementation - * Markus Schorn (Wind River Systems) + * John Camelon (IBM) - Initial API and implementation + * Markus Schorn (Wind River Systems) *******************************************************************************/ package org.eclipse.cdt.core.dom.ast.c; @@ -16,15 +16,14 @@ import org.eclipse.cdt.core.dom.ast.IASTInitializer; import org.eclipse.cdt.core.dom.ast.IASTInitializerClause; /** - * This interface represents a designated initializer. e.g. struct x y = { .z=4, - * .t[1] = 3 }; + * This interface represents a designated initializer, + * e.g. struct x y = { .z = 4, .t[1] = 3 }; * * @noextend This interface is not intended to be extended by clients. * @noimplement This interface is not intended to be implemented by clients. */ public interface ICASTDesignatedInitializer extends IASTInitializer, IASTInitializerClause { - - public static final ICASTDesignator[] EMPTY_DESIGNATOR_ARRAY = new ICASTDesignator[0]; + public static final ICASTDesignator[] EMPTY_DESIGNATOR_ARRAY = {}; public static final ASTNodeProperty DESIGNATOR = new ASTNodeProperty( "ICASTDesignatedInitializer.DESIGNATOR [ICASTDesignator]"); //$NON-NLS-1$ @@ -77,5 +76,4 @@ public interface ICASTDesignatedInitializer extends IASTInitializer, IASTInitial */ @Deprecated public void setOperandInitializer(IASTInitializer rhs); - } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTCastExpression.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTCastExpression.java index 717d788641a..6b3a9f056da 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTCastExpression.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTCastExpression.java @@ -6,7 +6,7 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * John Camelon (IBM) - Initial API and implementation + * John Camelon (IBM) - Initial API and implementation *******************************************************************************/ package org.eclipse.cdt.core.dom.ast.cpp; @@ -19,7 +19,6 @@ import org.eclipse.cdt.core.dom.ast.IASTCastExpression; * @noimplement This interface is not intended to be implemented by clients. */ public interface ICPPASTCastExpression extends IASTCastExpression { - /** * op_dynamic_cast is used for dynamic_cast<>'s. */ @@ -45,10 +44,15 @@ public interface ICPPASTCastExpression extends IASTCastExpression { */ public static final int op_last = op_const_cast; - /** * @since 5.1 */ @Override public ICPPASTCastExpression copy(); + + /** + * @since 5.4 + */ + @Override + public ICPPASTCastExpression copy(CopyStyle style); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTConstructorInitializer.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTConstructorInitializer.java index 06b7039541c..94d9661be26 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTConstructorInitializer.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTConstructorInitializer.java @@ -6,8 +6,8 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Doug Schaefer (IBM) - Initial API and implementation - * Markus Schorn (Wind River Systems) + * Doug Schaefer (IBM) - Initial API and implementation + * Markus Schorn (Wind River Systems) *******************************************************************************/ package org.eclipse.cdt.core.dom.ast.cpp; @@ -24,7 +24,6 @@ import org.eclipse.cdt.core.dom.ast.IASTInitializerList; * @noimplement This interface is not intended to be implemented by clients. */ public interface ICPPASTConstructorInitializer extends IASTInitializer { - /** * @since 5.2 */ @@ -39,6 +38,12 @@ public interface ICPPASTConstructorInitializer extends IASTInitializer { */ public IASTInitializerClause[] getArguments(); + /** + * Not allowed on frozen ast. + * @since 5.2 + */ + public void setArguments(IASTInitializerClause[] args); + /** * @since 5.1 */ @@ -51,13 +56,6 @@ public interface ICPPASTConstructorInitializer extends IASTInitializer { @Override public ICPPASTConstructorInitializer copy(CopyStyle style); - - /** - * Not allowed on frozen ast. - * @since 5.2 - */ - public void setArguments(IASTInitializerClause[] args); - /** * @deprecated Replaced by {@link #getArguments()}. */ diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTDeleteExpression.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTDeleteExpression.java index d28d9316313..5b6d6e16f3f 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTDeleteExpression.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTDeleteExpression.java @@ -6,8 +6,8 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * John Camelon (IBM) - Initial API and implementation - * Mike Kucera (IBM) + * John Camelon (IBM) - Initial API and implementation + * Mike Kucera (IBM) *******************************************************************************/ package org.eclipse.cdt.core.dom.ast.cpp; @@ -22,7 +22,6 @@ import org.eclipse.cdt.core.dom.ast.IASTImplicitNameOwner; * @noimplement This interface is not intended to be implemented by clients. */ public interface ICPPASTDeleteExpression extends IASTExpression, IASTImplicitNameOwner { - /** * OPERAND is the expression representing the pointer being * deleted. @@ -66,12 +65,11 @@ public interface ICPPASTDeleteExpression extends IASTExpression, IASTImplicitNam public void setIsVectored(boolean vectored); /** - * Is this a delete [] ? + * Is this a delete[] ? * * @return boolean */ public boolean isVectored(); - /** * @since 5.1 diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTNewExpression.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTNewExpression.java index 6c466746c56..dc712e17c4c 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTNewExpression.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTNewExpression.java @@ -6,9 +6,9 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * John Camelon (IBM) - Initial API and implementation - * Markus Schorn (Wind River Systems) - * Mike Kucera (IBM) + * John Camelon (IBM) - Initial API and implementation + * Markus Schorn (Wind River Systems) + * Mike Kucera (IBM) *******************************************************************************/ package org.eclipse.cdt.core.dom.ast.cpp; @@ -26,7 +26,6 @@ import org.eclipse.cdt.core.dom.ast.IASTTypeId; * @noimplement This interface is not intended to be implemented by clients. */ public interface ICPPASTNewExpression extends IASTExpression, IASTImplicitNameOwner { - public static final ASTNodeProperty NEW_PLACEMENT = new ASTNodeProperty( "ICPPASTNewExpression.NEW_PLACEMENT [IASTExpression]"); //$NON-NLS-1$ @@ -82,7 +81,6 @@ public interface ICPPASTNewExpression extends IASTExpression, IASTImplicitNameOw */ @Override public ICPPASTNewExpression copy(CopyStyle style); - /** * Not allowed on frozen ast. diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTSimpleTypeConstructorExpression.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTSimpleTypeConstructorExpression.java index 0b15cd95447..163d827b112 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTSimpleTypeConstructorExpression.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTSimpleTypeConstructorExpression.java @@ -6,8 +6,8 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * John Camelon (IBM) - Initial API and implementation - * Markus Schorn (Wind River Systems) + * John Camelon (IBM) - Initial API and implementation + * Markus Schorn (Wind River Systems) *******************************************************************************/ package org.eclipse.cdt.core.dom.ast.cpp; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPASTBinaryExpression.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPASTBinaryExpression.java index 5336a2b409d..96b98ed9ea1 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPASTBinaryExpression.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/gnu/cpp/IGPPASTBinaryExpression.java @@ -6,7 +6,7 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * John Camelon (IBM Rational Software) - Initial API and implementation + * John Camelon (IBM Rational Software) - Initial API and implementation *******************************************************************************/ package org.eclipse.cdt.core.dom.ast.gnu.cpp; @@ -20,7 +20,6 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTBinaryExpression; * @noimplement This interface is not intended to be implemented by clients. */ public interface IGPPASTBinaryExpression extends ICPPASTBinaryExpression { - /** * op_max represents >? */ diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IProblem.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IProblem.java index bd1ffc48c7c..0f037e9ea57 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IProblem.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IProblem.java @@ -6,11 +6,10 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * John Camelon (IBM Corporation) - initial API and implementation + * John Camelon (IBM Corporation) - initial API and implementation *******************************************************************************/ package org.eclipse.cdt.core.parser; - /** * Description of a C/C++ syntax problems and spelling errors as detected by the lexer, preprocessor, * parser or the spelling engine. @@ -26,8 +25,7 @@ package org.eclipse.cdt.core.parser; * @noimplement This interface is not intended to be implemented by clients. * @noextend This interface is not intended to be extended by clients. */ -public interface IProblem -{ +public interface IProblem { /** * Returns the problem id */ @@ -79,7 +77,6 @@ public interface IProblem */ boolean isWarning(); - /** * -1, returned when an offset or a line number is unknown. */ diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/ArrayUtil.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/ArrayUtil.java index ab5878bdcc4..4d43ae174ea 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/ArrayUtil.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/util/ArrayUtil.java @@ -144,6 +144,27 @@ public abstract class ArrayUtil { return temp; } + /** + * Assumes that array contains nulls at the end, only. + * Appends object using the current length of the array. + * @param array The array to append to. Not {@code null} + * @param currentLength The number of non-{@code null} elements in the array + * @param obj The object to append. Not {@code null} + * @return The modified array, which may be the same as the first parameter. + * @since 5.4 + */ + static public T[] appendAt(T[] array, int currentLength, T obj) { + if (obj == null) + return array; + if (currentLength >= array.length) { + array = Arrays.copyOf(array, Math.max(Math.max(currentLength + 1, array.length * 2), DEFAULT_LENGTH)); + } + Assert.isTrue(array[currentLength] == null); + Assert.isTrue(currentLength == 0 || array[currentLength - 1] != null); + array[currentLength]= obj; + return array; + } + /** * Trims the given array and returns a new array with no null entries. * Assumes that nulls can be found at the end, only. @@ -216,6 +237,25 @@ public abstract class ArrayUtil { return trim(array, false); } + /** + * Trims the given array and returns a new array with no {@code null} entries. + * Assumes that {@code null}s can be found at the end, only. + * Similar to {@link #trimAt(Class, Object[], int)}, but uses the new length instead of index. + * + * @param array the array to be trimmed + * @param newLength the new length of the array, has to be less or equal than + * the current length. + * @return the modified array, which may be the same as the first parameter. + * @since 5.4 + */ + static public T[] trim(T[] array, int newLength) { + if (newLength == array.length) + return array; + Assert.isTrue(array[newLength] == null); + Assert.isTrue(newLength == 0 || array[newLength - 1] != null); + return Arrays.copyOf(array, newLength); + } + /** * Takes contents of the two arrays up to the first null element and concatenates * them. @@ -446,7 +486,7 @@ public abstract class ArrayUtil { } /** - * @deprecated Use {@link #trimAt(Class, Object[], int)} instead + * @deprecated Use {@link #trim(Object[], int)} or {@link #trimAt(Class, Object[], int)} instead */ @SuppressWarnings("unchecked") @Deprecated @@ -456,10 +496,13 @@ public abstract class ArrayUtil { /** * To improve performance, this method should be used instead of - * {@link #removeNulls(Class, Object[])} when all of the non-null elements in + * {@link #removeNulls(Class, Object[])} when all of the non-{@code null} elements in * the array are grouped together at the beginning of the array and all of the nulls are at - * the end of the array. The position of the last non-null element in the array must also - * be known. + * the end of the array. The position of the last non-{@code null} element in the array must also + * be known. + *

+ * If you don't indend to pass {@code null} array, consider using {@link #trim(Object[], int)} + * instead. * * @since 5.1 */ @@ -525,7 +568,7 @@ public abstract class ArrayUtil { System.arraycopy(array, 0, array, 1, i); array[0] = obj; } else { - T[] temp = newArray(array, array.length*2); + T[] temp = newArray(array, array.length * 2); System.arraycopy(array, 0, temp, 1, array.length); temp[0] = obj; array = temp; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CASTCastExpression.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CASTCastExpression.java index ff2ac45fe11..8bcd8b5b112 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CASTCastExpression.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/c/CASTCastExpression.java @@ -6,8 +6,8 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * John Camelon (IBM Rational Software) - Initial API and implementation - * Markus Schorn (Wind River Systems) + * John Camelon (IBM Rational Software) - Initial API and implementation + * Markus Schorn (Wind River Systems) *******************************************************************************/ package org.eclipse.cdt.internal.core.dom.parser.c; @@ -28,7 +28,6 @@ public class CASTCastExpression extends ASTNode implements IASTCastExpression, I private IASTExpression operand; private IASTTypeId typeId; - public CASTCastExpression() { this.operator = op_cast; } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTFunctionDeclarator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTFunctionDeclarator.java index 1147986b8d0..4e86529c2cc 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTFunctionDeclarator.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTFunctionDeclarator.java @@ -30,9 +30,9 @@ import org.eclipse.cdt.internal.core.dom.parser.IASTAmbiguityParent; */ public class CPPASTFunctionDeclarator extends CPPASTDeclarator implements ICPPASTFunctionDeclarator, IASTAmbiguityParent { - private ICPPASTParameterDeclaration[] parameters = null; + private ICPPASTParameterDeclaration[] parameters; private IASTTypeId[] typeIds = NO_EXCEPTION_SPECIFICATION; - private IASTTypeId trailingReturnType= null; + private IASTTypeId trailingReturnType; private boolean varArgs; private boolean pureVirtual; @@ -40,7 +40,7 @@ public class CPPASTFunctionDeclarator extends CPPASTDeclarator implements ICPPAS private boolean isConst; private boolean isMutable; - private ICPPFunctionScope scope = null; + private ICPPFunctionScope scope; public CPPASTFunctionDeclarator() { }