diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTQualifiedName.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTQualifiedName.java index 103b8c65d9d..06ba50d891b 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTQualifiedName.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPASTQualifiedName.java @@ -28,16 +28,16 @@ public interface ICPPASTQualifiedName extends IASTName, IASTNameOwner { "ICPPASTQualifiedName.SEGMENT_NAME - An IASTName segment"); //$NON-NLS-1$ /** - * Add a subname. + * Adds a name segment. * - * @param name IASTName + * @param name {@code IASTName} */ public void addName(IASTName name); /** - * Get all subnames. + * Returns all name segments. * - * @return IASTName [] + * @return {@code IASTName[]} */ public IASTName[] getNames(); @@ -55,15 +55,14 @@ public interface ICPPASTQualifiedName extends IASTName, IASTNameOwner { public boolean isFullyQualified(); /** - * Set this name to be fully qualified or not (true/false). + * Sets this name to be fully qualified or not (true/false). * * @param value boolean */ public void setFullyQualified(boolean value); /** - * This is used to check if the ICPPASTQualifiedName's last segment is - * an ICPPASTConversionName or an ICPPASTOperatorName. + * Returns {@code true} if last segment is an ICPPASTConversionName or an ICPPASTOperatorName. */ public boolean isConversionOrOperator(); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTQualifiedName.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTQualifiedName.java index b59a06e4189..ab1d0b4cb13 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTQualifiedName.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPASTQualifiedName.java @@ -71,8 +71,9 @@ public class CPPASTQualifiedName extends CPPASTNameBase @Override public CPPASTQualifiedName copy(CopyStyle style) { CPPASTQualifiedName copy = new CPPASTQualifiedName(); - for (IASTName name : getNames()) + for (IASTName name : getNames()) { copy.addName(name == null ? null : name.copy(style)); + } copy.setFullyQualified(isFullyQualified); copy.setOffsetAndLength(this); if (style == CopyStyle.withLocations) { @@ -83,20 +84,20 @@ public class CPPASTQualifiedName extends CPPASTNameBase @Override public final IBinding resolvePreBinding() { - // The full qualified name resolves to the same thing as the last name + // The whole qualified name resolves to the same thing as the last name. return getLastName().resolvePreBinding(); } @Override public IBinding resolveBinding() { - // The full qualified name resolves to the same thing as the last name + // The whole qualified name resolves to the same thing as the last name. IASTName lastName= getLastName(); return lastName == null ? null : lastName.resolveBinding(); } @Override public final IBinding getPreBinding() { - // The full qualified name resolves to the same thing as the last name + // The whole qualified name resolves to the same thing as the last name. return getLastName().getPreBinding(); } @@ -110,7 +111,6 @@ public class CPPASTQualifiedName extends CPPASTNameBase getLastName().setBinding(binding); } - @Override public void addName(IASTName name) { assertNotFrozen(); @@ -200,7 +200,8 @@ public class CPPASTQualifiedName extends CPPASTNameBase for (int i = 0; i <= namesPos; i++) { final IASTName name = names[i]; if (i == namesPos) { - // pointer-to-member qualified names have a dummy name as the last part of the name, don't visit it + // Pointer-to-member qualified names have a dummy name as the last segment + // of the name, don't visit it. if (name.getLookupKey().length > 0 && !name.accept(action)) return false; } else if (!name.accept(action))