diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTParameterDeclaration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTParameterDeclaration.java index e302b4e2e19..b08da127cb6 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTParameterDeclaration.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTParameterDeclaration.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; @@ -18,7 +18,6 @@ import org.eclipse.cdt.core.dom.ast.IASTParameterDeclaration; * @noimplement This interface is not intended to be implemented by clients. */ public interface ICPPASTParameterDeclaration extends ICPPASTTemplateParameter, IASTParameterDeclaration { - /** * @since 5.2 */ @@ -27,15 +26,18 @@ public interface ICPPASTParameterDeclaration extends ICPPASTTemplateParameter, I /** * @since 5.1 */ + @Override public ICPPASTParameterDeclaration copy(); /** * @since 5.3 */ + @Override public ICPPASTParameterDeclaration copy(CopyStyle style); /** * @since 5.2 */ + @Override public ICPPASTDeclarator getDeclarator(); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTName.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTName.java index 9a4d26cb47e..54dd18bef60 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTName.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTName.java @@ -6,10 +6,10 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * John Camelon(IBM) - Initial API and implementation - * Markus Schorn (Wind River Systems) - * Bryan Wilkinson (QNX) - * Anton Leherbauer (Wind River Systems) + * John Camelon(IBM) - Initial API and implementation + * Markus Schorn (Wind River Systems) + * Bryan Wilkinson (QNX) + * Anton Leherbauer (Wind River Systems) *******************************************************************************/ package org.eclipse.cdt.internal.core.dom.parser.cpp; @@ -45,10 +45,12 @@ public class CPPASTName extends CPPASTNameBase implements ICPPASTCompletionConte name = CharArrayUtils.EMPTY; } - public CPPASTName copy() { + @Override + public CPPASTName copy() { return copy(CopyStyle.withoutLocations); } + @Override public CPPASTName copy(CopyStyle style) { CPPASTName copy = new CPPASTName(name == null ? null : name.clone()); copy.setOffsetAndLength(this); @@ -78,6 +80,7 @@ public class CPPASTName extends CPPASTNameBase implements ICPPASTCompletionConte return null; } + @Override public IBinding[] findBindings(IASTName n, boolean isPrefix, String[] namespaces) { IASTNode parent = getParent(); if (parent instanceof ICPPASTElaboratedTypeSpecifier) { @@ -142,14 +145,17 @@ public class CPPASTName extends CPPASTNameBase implements ICPPASTCompletionConte return (IBinding[])ArrayUtil.removeNulls(IBinding.class, bindings); } - public char[] toCharArray() { + @Override + public char[] toCharArray() { return name; } - public char[] getSimpleID() { + @Override + public char[] getSimpleID() { return name; } + @Override public char[] getLookupKey() { return name; } @@ -185,6 +191,7 @@ public class CPPASTName extends CPPASTNameBase implements ICPPASTCompletionConte return true; } + @Override public IBinding[] findBindings(IASTName n, boolean isPrefix) { return findBindings(n, isPrefix, null); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTParameterDeclaration.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTParameterDeclaration.java index 7fa03b047a4..f317d66b1f7 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTParameterDeclaration.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTParameterDeclaration.java @@ -37,14 +37,17 @@ public class CPPASTParameterDeclaration extends ASTNode implements ICPPASTParame setDeclarator(declarator); } + @Override public boolean isParameterPack() { return fDeclarator != null && CPPVisitor.findInnermostDeclarator(fDeclarator).declaresParameterPack(); } + @Override public CPPASTParameterDeclaration copy() { return copy(CopyStyle.withoutLocations); } + @Override public CPPASTParameterDeclaration copy(CopyStyle style) { CPPASTParameterDeclaration copy = new CPPASTParameterDeclaration(); copy.setDeclSpecifier(fDeclSpec == null ? null : fDeclSpec.copy(style)); @@ -56,15 +59,18 @@ public class CPPASTParameterDeclaration extends ASTNode implements ICPPASTParame return copy; } + @Override public IASTDeclSpecifier getDeclSpecifier() { return fDeclSpec; } - public ICPPASTDeclarator getDeclarator() { + @Override + public ICPPASTDeclarator getDeclarator() { return fDeclarator; } - public void setDeclSpecifier(IASTDeclSpecifier declSpec) { + @Override + public void setDeclSpecifier(IASTDeclSpecifier declSpec) { assertNotFrozen(); this.fDeclSpec = declSpec; if (declSpec != null) { @@ -73,7 +79,8 @@ public class CPPASTParameterDeclaration extends ASTNode implements ICPPASTParame } } - public void setDeclarator(IASTDeclarator declarator) { + @Override + public void setDeclarator(IASTDeclarator declarator) { assertNotFrozen(); if (declarator instanceof ICPPASTDeclarator) { fDeclarator = (ICPPASTDeclarator) declarator; @@ -85,7 +92,7 @@ public class CPPASTParameterDeclaration extends ASTNode implements ICPPASTParame } @Override - public boolean accept( ASTVisitor action ){ + public boolean accept(ASTVisitor action) { if (action.shouldVisitParameterDeclarations) { switch (action.visit((IASTParameterDeclaration) this)) { case ASTVisitor.PROCESS_ABORT: return false; @@ -105,7 +112,8 @@ public class CPPASTParameterDeclaration extends ASTNode implements ICPPASTParame } return true; } - + + @Override public void replace(IASTNode child, IASTNode other) { if (child == fDeclarator) { other.setPropertyInParent(child.getPropertyInParent());