From 3d928854959ecf2dfdf45cc99ebb51f1a5d90268 Mon Sep 17 00:00:00 2001 From: Sergey Prigogin Date: Wed, 21 Jan 2015 15:19:08 -0800 Subject: [PATCH] Cosmetics. --- .../internal/core/browser/ASTTypeInfo.java | 12 ++++----- .../cdt/core/dom/ast/IPointerType.java | 4 +-- .../eclipse/cdt/core/dom/ast/ITypedef.java | 2 +- .../core/dom/ast/cpp/ICPPReferenceType.java | 2 +- .../eclipse/cdt/core/index/IIndexFile.java | 1 - .../cdt/core/index/IndexLocationFactory.java | 2 -- .../parser/cpp/semantics/AccessContext.java | 27 +++++++++++-------- .../cdt/internal/core/pdom/dom/PDOMFile.java | 2 +- 8 files changed, 27 insertions(+), 25 deletions(-) diff --git a/core/org.eclipse.cdt.core/browser/org/eclipse/cdt/internal/core/browser/ASTTypeInfo.java b/core/org.eclipse.cdt.core/browser/org/eclipse/cdt/internal/core/browser/ASTTypeInfo.java index bc81b2d26b8..26e83626d3e 100644 --- a/core/org.eclipse.cdt.core/browser/org/eclipse/cdt/internal/core/browser/ASTTypeInfo.java +++ b/core/org.eclipse.cdt.core/browser/org/eclipse/cdt/internal/core/browser/ASTTypeInfo.java @@ -10,6 +10,8 @@ *******************************************************************************/ package org.eclipse.cdt.internal.core.browser; +import java.util.Arrays; + import org.eclipse.cdt.core.CCorePlugin; import org.eclipse.cdt.core.browser.IFunctionInfo; import org.eclipse.cdt.core.browser.IQualifiedTypeName; @@ -37,8 +39,6 @@ import org.eclipse.core.runtime.Assert; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Path; -import java.util.Arrays; - /** * Type info object needed to support search for local variables. * @since 5.0 @@ -62,13 +62,13 @@ public class ASTTypeInfo implements ITypeInfo, IFunctionInfo { final ASTTypeReference ref= createReference(name); elementType = IndexModelUtil.getElementType(binding); if (binding instanceof ICPPBinding) { - fqn= ((ICPPBinding)binding).getQualifiedName(); + fqn= ((ICPPBinding) binding).getQualifiedName(); } else if (binding instanceof IField) { IField field= (IField) binding; ICompositeType owner= field.getCompositeTypeOwner(); - fqn= new String[] {owner.getName(), field.getName()}; + fqn= new String[] { owner.getName(), field.getName() }; } else { - fqn= new String[] {binding.getName()}; + fqn= new String[] { binding.getName() }; } if (binding instanceof IFunction) { final IFunction function= (IFunction)binding; @@ -132,7 +132,7 @@ public class ASTTypeInfo implements ITypeInfo, IFunctionInfo { @Override public ICProject getEnclosingProject() { - if (getResolvedReference()!=null) { + if (getResolvedReference() != null) { IProject project = reference.getProject(); if (project != null) { return CCorePlugin.getDefault().getCoreModel().getCModel().getCProject(project.getName()); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IPointerType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IPointerType.java index 8a1b49eaa6e..a8ed2fcfff9 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IPointerType.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/IPointerType.java @@ -17,7 +17,7 @@ package org.eclipse.cdt.core.dom.ast; */ public interface IPointerType extends IType { /** - * Returns the type that this is a pointer to + * Returns the type that this is a pointer to. */ public IType getType(); @@ -33,7 +33,7 @@ public interface IPointerType extends IType { /** * Returns whether the pointer is qualified to be restrict. - * For c++ this is a gnu-extension. + * For c++ this is a GNU-extension. * @since 5.3 */ boolean isRestrict(); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ITypedef.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ITypedef.java index 00f34adeb60..d912a9debcd 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ITypedef.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/ITypedef.java @@ -16,7 +16,7 @@ package org.eclipse.cdt.core.dom.ast; */ public interface ITypedef extends IBinding, IType { /** - * Returns the type that this thing is a typedef of + * Returns the type that this thing is a typedef of. */ public IType getType(); } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPReferenceType.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPReferenceType.java index 460194b209b..b0909b92254 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPReferenceType.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/dom/ast/cpp/ICPPReferenceType.java @@ -19,7 +19,7 @@ import org.eclipse.cdt.core.dom.ast.IType; */ public interface ICPPReferenceType extends IType { /** - * Returns the type that this is a reference of + * Returns the type that this is a reference of. */ public IType getType(); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/IIndexFile.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/IIndexFile.java index db552ed390c..bdd020f8355 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/IIndexFile.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/IIndexFile.java @@ -29,7 +29,6 @@ public interface IIndexFile extends IFileNomination { /** * Returns an IIndexFileLocation representing the location of this file - * @return an IIndexFileLocation representing the location of this file * @throws CoreException */ IIndexFileLocation getLocation() throws CoreException; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/IndexLocationFactory.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/IndexLocationFactory.java index 5b959c8e2d6..170efab7682 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/IndexLocationFactory.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/IndexLocationFactory.java @@ -57,8 +57,6 @@ public class IndexLocationFactory { /** * Returns the absolute file path of a location, or {@code null} * if the location is not a file-system path. - * @return the absolute file path of a location, or {@code null} - * if the location is not a file-system path. */ public static IPath getAbsolutePath(IIndexFileLocation location) { return UNCPathConverter.toPath(location.getURI()); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/AccessContext.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/AccessContext.java index ae20e9dc72e..8701f8095e2 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/AccessContext.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/dom/parser/cpp/semantics/AccessContext.java @@ -46,9 +46,10 @@ public class AccessContext { /** * Checks if a binding is accessible from a given name. + * * @param binding A binding to check access for. * @param from A name corresponding to the binding. - * @return true if the binding is accessible. + * @return {@code true} if the binding is accessible. */ public static boolean isAccessible(IBinding binding, IASTName from) { return new AccessContext(from).isAccessible(binding); @@ -56,11 +57,12 @@ public class AccessContext { /** * Checks if a binding is accessible from a given name. + * * @param binding A binding to check access for. * @param bindingVisibility visibility of the binding in the containing composite type. * Used instead of calling {@link ICPPMember#getVisibility()}. * @param from A name corresponding to the binding. - * @return true if the binding is accessible. + * @return {@code true} if the binding is accessible. */ public static boolean isAccessible(IBinding binding, int bindingVisibility, IASTName from) { return new AccessContext(from).isAccessible(binding, bindingVisibility); @@ -68,9 +70,10 @@ public class AccessContext { private final IASTName name; /** - * A chain of nested classes or/and a function that determine accessibility of private/protected members - * by participating in friendship or class inheritance relationships. If both, classes and a function - * are present in the context, the outermost class has to be local to the function. + * A chain of nested classes or/and a function that determine accessibility of private/protected + * members by participating in friendship or class inheritance relationships. If both, classes + * and a function are present in the context, the outermost class has to be local to + * the function. * {@link "http://www.open-std.org/JTC1/SC22/WG21/docs/cwg_defects.html#45"} */ private IBinding[] context; @@ -78,7 +81,7 @@ public class AccessContext { * A class through which the bindings are accessed (11.2.4). */ private boolean isUnqualifiedLookup; - private ICPPClassType namingClass; // depends on the binding for which we check the access + private ICPPClassType namingClass; // Depends on the binding for which we check the access. // The first candidate is independent of the binding for which we do the access-check. private ICPPClassType firstCandidateForNamingClass; private DOMException initializationException; @@ -89,8 +92,9 @@ public class AccessContext { /** * Checks if a binding is accessible in a given context. + * * @param binding A binding to check access for. - * @return true if the binding is accessible. + * @return {@code true} if the binding is accessible. */ public boolean isAccessible(IBinding binding) { if (binding instanceof ICPPTemplateParameter) @@ -123,10 +127,11 @@ public class AccessContext { /** * Checks if a binding is accessible in a given context. + * * @param binding A binding to check access for. * @param bindingVisibility visibility of the binding in the containing composite type. * Used instead of calling {@link ICPPMember#getVisibility()}. - * @return true if the binding is accessible. + * @return {@code true} if the binding is accessible. */ public boolean isAccessible(IBinding binding, int bindingVisibility) { IBinding owner; @@ -149,7 +154,7 @@ public class AccessContext { } /** - * @return true if initialization succeeded. + * @return {@code true} if initialization succeeded. */ private boolean initialize(ICPPClassType accessOwner) { if (context == null) { @@ -276,7 +281,6 @@ public class AccessContext { return null; } - private ICPPClassType getNamingClass(ICPPClassType accessOwner) { ICPPClassType classType = firstCandidateForNamingClass; if (classType != null && isUnqualifiedLookup) { @@ -333,9 +337,10 @@ public class AccessContext { /** * Checks if objects with the given visibility are accessible at the given access level. + * * @param visibility one of: v_public, v_protected, v_private. * @param accessLevel one of: v_public, v_protected, v_private. - * @return true if the access level is sufficiently high. + * @return {@code true} if the access level is sufficiently high. */ private static boolean isAccessible(int visibility, int accessLevel) { // Note the ordering of numeric visibility values: v_public < v_protected < v_private. diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMFile.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMFile.java index 3ce0081a1df..b5c24cb69d9 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMFile.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMFile.java @@ -152,7 +152,7 @@ public class PDOMFile implements IIndexFragmentFile { if (obj == this) return true; if (obj instanceof PDOMFile) { - PDOMFile other = (PDOMFile)obj; + PDOMFile other = (PDOMFile) obj; return fLinkage.getPDOM().equals(other.getLinkage().getPDOM()) && record == other.record; } return false;