From b140bf8ba6e96869a322826338b86beb777db5b5 Mon Sep 17 00:00:00 2001 From: Sergey Prigogin Date: Mon, 5 Dec 2011 19:40:53 -0800 Subject: [PATCH] Override annotations. --- .../org/eclipse/cdt/core/dom/ast/IASTDeclarator.java | 7 ++++--- .../cdt/core/dom/ast/IASTPointerOperator.java | 7 ++++--- .../core/dom/ast/cpp/ICPPASTReferenceOperator.java | 7 ++++--- .../core/dom/parser/cpp/CPPASTReferenceOperator.java | 12 +++++++----- 4 files changed, 19 insertions(+), 14 deletions(-) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTDeclarator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTDeclarator.java index cc055191b56..f1d6994bd64 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTDeclarator.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTDeclarator.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; @@ -17,11 +17,10 @@ package org.eclipse.cdt.core.dom.ast; * @noimplement This interface is not intended to be implemented by clients. */ public interface IASTDeclarator extends IASTNode, IASTNameOwner { - /** * Constant - empty declarator array */ - public static final IASTDeclarator[] EMPTY_DECLARATOR_ARRAY = new IASTDeclarator[0]; + public static final IASTDeclarator[] EMPTY_DECLARATOR_ARRAY = {}; /** * POINTER_OPERATOR represents the relationship between an @@ -111,10 +110,12 @@ public interface IASTDeclarator extends IASTNode, IASTNameOwner { /** * @since 5.1 */ + @Override public IASTDeclarator copy(); /** * @since 5.3 */ + @Override public IASTDeclarator copy(CopyStyle style); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPointerOperator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPointerOperator.java index fe5a585b3ec..343a115cb88 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPointerOperator.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IASTPointerOperator.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; @@ -15,19 +15,20 @@ package org.eclipse.cdt.core.dom.ast; * @noimplement This interface is not intended to be implemented by clients. */ public interface IASTPointerOperator extends IASTNode { - /** * Constant/sentinel. */ - public static final IASTPointerOperator[] EMPTY_ARRAY = new IASTPointerOperator[0]; + public static final IASTPointerOperator[] EMPTY_ARRAY = {}; /** * @since 5.1 */ + @Override public IASTPointerOperator copy(); /** * @since 5.3 */ + @Override public IASTPointerOperator copy(CopyStyle style); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTReferenceOperator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTReferenceOperator.java index c0145224e29..37c8c0c0808 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTReferenceOperator.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTReferenceOperator.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; @@ -20,7 +20,6 @@ import org.eclipse.cdt.core.dom.ast.IASTPointerOperator; * @noimplement This interface is not intended to be implemented by clients. */ public interface ICPPASTReferenceOperator extends IASTPointerOperator { - /** * Returns whether the operator denotes a rvalue reference (e.g. int &&). * @since 5.2 @@ -30,10 +29,12 @@ public interface ICPPASTReferenceOperator extends IASTPointerOperator { /** * @since 5.1 */ + @Override public ICPPASTReferenceOperator copy(); /** * @since 5.3 */ + @Override public ICPPASTReferenceOperator copy(CopyStyle style); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTReferenceOperator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTReferenceOperator.java index 3820b979e29..395d54479af 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTReferenceOperator.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTReferenceOperator.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.internal.core.dom.parser.cpp; @@ -19,21 +19,23 @@ import org.eclipse.cdt.internal.core.dom.parser.ASTNode; * Reference operator for declarators. */ public class CPPASTReferenceOperator extends ASTNode implements ICPPASTReferenceOperator { - private final boolean fIsRValue; public CPPASTReferenceOperator(boolean isRValueReference) { fIsRValue= isRValueReference; } + @Override public boolean isRValueReference() { return fIsRValue; } + @Override public CPPASTReferenceOperator copy() { return copy(CopyStyle.withoutLocations); } + @Override public CPPASTReferenceOperator copy(CopyStyle style) { CPPASTReferenceOperator copy = new CPPASTReferenceOperator(fIsRValue); copy.setOffsetAndLength(this); @@ -47,8 +49,8 @@ public class CPPASTReferenceOperator extends ASTNode implements ICPPASTReference public boolean accept(ASTVisitor action) { if (action.shouldVisitPointerOperators) { switch (action.visit(this)) { - case ASTVisitor.PROCESS_ABORT : return false; - case ASTVisitor.PROCESS_SKIP : return true; + case ASTVisitor.PROCESS_ABORT: return false; + case ASTVisitor.PROCESS_SKIP: return true; } if (action.leave(this) == ASTVisitor.PROCESS_ABORT) return false;