From bdde88fd2ad42e339ba5c82614ee8a3aef3f8081 Mon Sep 17 00:00:00 2001 From: Sergey Prigogin Date: Fri, 6 Dec 2013 18:03:34 -0800 Subject: [PATCH] Cosmetics. --- .../eclipse/cdt/core/index/IIndexName.java | 49 ++++++++++--------- .../eclipse/cdt/core/index/IndexFilter.java | 29 ++++++----- .../cdt/internal/corext/util/CModelUtil.java | 13 +++-- 3 files changed, 47 insertions(+), 44 deletions(-) diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/IIndexName.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/IIndexName.java index 3fc4b741723..17985845810 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/IIndexName.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/IIndexName.java @@ -8,18 +8,17 @@ * Contributors: * Markus Schorn - initial API and implementation * Andrew Ferguson (Symbian) - *******************************************************************************/ + *******************************************************************************/ package org.eclipse.cdt.core.index; import org.eclipse.cdt.core.dom.IName; import org.eclipse.core.runtime.CoreException; /** - * Interface for all the names in the index. These constitute either a - * declaration or a reference. - * + * Interface for all the names in the index. These constitute either a declaration or a reference. + * * @since 4.0 - * + * * @noextend This interface is not intended to be extended by clients. * @noimplement This interface is not intended to be implemented by clients. */ @@ -28,10 +27,10 @@ public interface IIndexName extends IName { /** * Returns the file the name belongs to. - * @throws CoreException + * @throws CoreException */ public IIndexFile getFile() throws CoreException; - + /** * Returns the character offset of the location of the name. */ @@ -41,18 +40,17 @@ public interface IIndexName extends IName { * Returns the length of the name. */ public int getNodeLength(); - + /** - * Returns the name of the definition that contains this name. - * May return null. + * Returns the name of the definition that contains this name. May return {@code null}. * Currently this is implemented for function and method definitions, only. */ public IIndexName getEnclosingDefinition() throws CoreException; - + /** - * Returns the names of the references contained in this definition. - * Returns null, if the name is not a definition. - * + * Returns the names of the references contained in this definition. + * Returns {@code null}, if the name is not a definition. + * * Currently the method works with function definitions, only. */ public IIndexName[] getEnclosedNames() throws CoreException; @@ -61,25 +59,27 @@ public interface IIndexName extends IName { * Returns whether a declaration is a base-class specifier. */ public boolean isBaseSpecifier() throws CoreException; - + /** - * Returns whether this name potentially denotes a polymorphic method call. This is the case - * when the name is not qualified and denotes a method call and the method is accessed via a - * pointer or a reference to an object.

+ * Returns whether this name potentially denotes a polymorphic method call. This is the case + * when the name is not qualified and denotes a method call and the method is accessed via a + * pointer or a reference to an object. + *

* No checks are performed whether the method is actually virtual or not. */ public boolean couldBePolymorphicMethodCall() throws CoreException; - + /** * Returns whether this name specifies an inline namespace. * @since 5.3 */ public boolean isInlineNamespaceDefinition() throws CoreException; - + /** * Returns whether this name is a read-reference to a variable or field. - * The notion of a read-reference may not strictly reflect what your compiler generates, - * heuristics may be used.

+ * The notion of a read-reference may not strictly reflect what your compiler generates, + * heuristics may be used. + *

* For pointers and arrays the access to the pointer itself is tracked, rather than considering * the target of the pointer. */ @@ -87,8 +87,9 @@ public interface IIndexName extends IName { /** * Returns whether this name is a write-reference to a variable or field. - * The notion of a write-reference may not strictly reflect what your compiler generates, - * heuristics may be used.

+ * The notion of a write-reference may not strictly reflect what your compiler generates, + * heuristics may be used. + *

* For pointers and arrays the access to the pointer itself is tracked, rather than considering * the target of the pointer. */ diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/IndexFilter.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/IndexFilter.java index 421de88d660..0850406144e 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/IndexFilter.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/index/IndexFilter.java @@ -9,7 +9,7 @@ * Markus Schorn - initial API and implementation * Andrew Ferguson (Symbian) * Bryan Wilkinson (QNX) - *******************************************************************************/ + *******************************************************************************/ package org.eclipse.cdt.core.index; import org.eclipse.cdt.core.dom.ILinkage; @@ -33,8 +33,8 @@ abstract public class IndexFilter { public static final IndexFilter C_DECLARED_OR_IMPLICIT= getDeclaredBindingFilter(ILinkage.C_LINKAGE_ID, true); /** - * Get an IndexFilter that filters out bindings from linkages other than that - * specified + * Get an IndexFilter that filters out bindings from linkages other than that specified. + * * @param linkageID the id of the linkage whose bindings should be retained * @return an IndexFilter instance */ @@ -48,10 +48,11 @@ abstract public class IndexFilter { } /** - * Get an IndexFilter that filters out bindings without declarations and those - * from linkages other than that specified. - * @param linkageID the id of the linkage whose bindings should be retained, or -1 - * to accept all linkages. + * Get an IndexFilter that filters out bindings without declarations and those from linkages + * other than that specified. + * + * @param linkageID the id of the linkage whose bindings should be retained, or -1 + * to accept all linkages. * @return an IndexFilter instance */ public static IndexFilter getDeclaredBindingFilter(final int linkageID, boolean acceptImplicit) { @@ -60,9 +61,10 @@ abstract public class IndexFilter { /** * Get an IndexFilter that filters out bindings without declarations and those - * from linkages other than that specified. - * @param linkageID the id of the linkage whose bindings should be retained, or -1 - * to accept all linkages. + * from linkages other than that specified. + * + * @param linkageID the id of the linkage whose bindings should be retained, or -1 + * to accept all linkages. * @return an IndexFilter instance * @since 5.1 */ @@ -73,19 +75,20 @@ abstract public class IndexFilter { /** * Returns whether or not to include objects of the given linkage in the query. * @see IIndex#findBindings(java.util.regex.Pattern, boolean, IndexFilter, org.eclipse.core.runtime.IProgressMonitor) + * * @param linkage a linkage to be tested * @return whether to include objects of the given linkage in the query. */ public boolean acceptLinkage(ILinkage linkage) { return true; } - + /** * Determines whether or not a binding is valid. - * + * * @param binding the binding being checked for validity * @return whether or not the binding is valid - * @throws CoreException + * @throws CoreException */ public boolean acceptBinding(IBinding binding) throws CoreException { return true; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/util/CModelUtil.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/util/CModelUtil.java index f0fea27fd0c..c901530c21c 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/util/CModelUtil.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/corext/util/CModelUtil.java @@ -6,8 +6,8 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * IBM Rational Software - Initial API and implementation - * Markus Schorn (Wind River Systems) + * IBM Rational Software - Initial API and implementation + * Markus Schorn (Wind River Systems) *******************************************************************************/ package org.eclipse.cdt.internal.corext.util; @@ -40,7 +40,7 @@ public class CModelUtil { } return unit; } - + public static ITranslationUnit toOriginal(ITranslationUnit unit) { if (unit.isWorkingCopy()) { return (((IWorkingCopy) unit).getOriginalElement()); @@ -84,7 +84,7 @@ public class CModelUtil { } return folder; } - + /** * Returns true if the given source root is * referenced. This means it is own by a different project but is referenced @@ -100,7 +100,7 @@ public class CModelUtil { } return false; } - + /** * Returns the translation unit the element belongs to or null if it does not. */ @@ -113,7 +113,7 @@ public class CModelUtil { } return null; } - + /* * Don't log not-exists exceptions */ @@ -126,5 +126,4 @@ public class CModelUtil { return true; return false; } - }