diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IScope.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IScope.java index 4223e2c697b..efe962f9faa 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IScope.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IScope.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2012 IBM Corporation and others. + * Copyright (c) 2004, 2015 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 @@ -31,25 +31,21 @@ public interface IScope { EScopeKind getKind(); /** - * Returns the IName for this scope, may be null + * Returns the IName for this scope, may be {@code null} * @return The name of this scope. */ public IName getScopeName(); /** - * Returns the first enclosing non-template scope, or {@code null} if this - * is the global scope. - *
- * For scopes obtained from an index, {@code null} is returned to indicate that the - * scope is only enclosed by the global scope. + * Returns the first enclosing non-template scope, or {@code null} if this is the global scope. */ public IScope getParent() throws DOMException; /** - * This is the general lookup entry point. It returns the list of - * valid bindings for a given name. The lookup proceeds as an unqualified - * lookup. Constructors are not considered during this lookup and won't be returned. - * No attempt is made to resolve potential ambiguities or perform access checking. + * This is the general lookup entry point. It returns the list of valid bindings for a given + * name. The lookup proceeds as an unqualified lookup. Constructors are not considered during + * this lookup and won't be returned. No attempt is made to resolve potential ambiguities or + * perform access checking. * * @param name the name of the bindings * @return An array of bindings. @@ -59,11 +55,11 @@ public interface IScope { /** * Returns the binding in this scope that the given name would resolve to. Could * return null if there is no matching binding in this scope, if the binding has not - * yet been cached in this scope, or if resolve == false and the appropriate binding + * yet been cached in this scope, or if resolve is {@code false} and the appropriate binding * has not yet been resolved. * * @param name the name of the binding - * @param resolve whether or not to resolve the matching binding if it has not been so already. + * @param resolve whether or not to resolve the matching binding if it has not been so already * @return the binding in this scope that matches the name, or {@code null} */ public IBinding getBinding(IASTName name, boolean resolve); @@ -71,14 +67,14 @@ public interface IScope { /** * Returns the binding in this scope that the given name would resolve to. Could * return null if there is no matching binding in this scope, if the binding has not - * yet been cached in this scope, or if resolve == false and the appropriate binding + * yet been cached in this scope, or if resolve is {@code false} and the appropriate binding * has not yet been resolved. Accepts file local bindings from the index for the files * in the given set, only. * * @param name the name of the binding - * @param resolve whether or not to resolve the matching binding if it has not been so already. - * @param acceptLocalBindings a set of files for which to accept local bindings. - * @return the binding in this scope that matches the name, or null + * @param resolve whether or not to resolve the matching binding if it has not been so already + * @param acceptLocalBindings a set of files for which to accept local bindings + * @return the binding in this scope that matches the name, or @code null} */ public IBinding getBinding(IASTName name, boolean resolve, IIndexFileSet acceptLocalBindings); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPClassType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPClassType.java index a6a10af4f50..e2026bf3db5 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPClassType.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPClassType.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2012 IBM Corporation and others. + * Copyright (c) 2004, 2015 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 @@ -44,15 +44,15 @@ public interface ICPPClassType extends ICompositeType, ICPPBinding { public ICPPBase[] getBases(); /** - * Get fields is restated here just to point out that this method returns a list of ICPPField + * The method is restated here just to point out that this method returns a list of ICPPField * objects representing all fields, declared or inherited. */ @Override public IField[] getFields(); /** - * findField is restated here to point out that this method looks through the inheritance tree - * of this class while looking for a field with the given name If no field is found, null is + * The method is restated here to point out that this method looks through the inheritance tree + * of this class while looking for a field with the given name. If no field is found, {@code null} is * returned, if the name is found to be ambiguous a IProblemBinding is returned. * * @param name @@ -116,7 +116,7 @@ public interface ICPPClassType extends ICompositeType, ICPPBinding { public boolean isFinal(); /** - * Gets the access specifier of the {@code member}. + * Returns the access specifier of the {@code member}. * * @param member The binding of the member to get the visibility for. * {@code member} must be a member of this class. diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPScopeMapper.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPScopeMapper.java index eacf065fade..e85e81c62d1 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPScopeMapper.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/CPPScopeMapper.java @@ -61,14 +61,17 @@ public class CPPScopeMapper { fContainer= container; fNominated= inline; } + @Override public IScope getContainingScope() { return fContainer; } + @Override public ICPPNamespaceScope getNominatedScope() throws DOMException { return fNominated; } + @Override public int getPointOfDeclaration() { return 0; @@ -97,18 +100,22 @@ public class CPPScopeMapper { public IBinding[] find(String name) { return fScope.find(name); } + @Override public IBinding getBinding(IASTName name, boolean resolve) { return fScope.getBinding(name, resolve); } + @Override public IBinding getBinding(IASTName name, boolean resolve, IIndexFileSet acceptLocalBindings) { return fScope.getBinding(name, resolve, acceptLocalBindings); } + @Override @Deprecated public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup) { return fScope.getBindings(name, resolve, prefixLookup); } + @Override @Deprecated public IBinding[] getBindings(IASTName name, boolean resolve, boolean prefixLookup, IIndexFileSet acceptLocalBindings) { return getBindings(name, resolve, prefixLookup, acceptLocalBindings); @@ -174,7 +181,7 @@ public class CPPScopeMapper { @Override public ICPPInternalNamespaceScope[] getInlineNamespaces() { - // Obtain the inline namespaces from the index and map them to the ast + // Obtain the inline namespaces from the index and map them to the AST. ICPPNamespaceScope[] pre = fScope.getInlineNamespaces(); if (pre.length == 0) return ICPPInternalNamespaceScope.EMPTY_NAMESPACE_SCOPE_ARRAY;