1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-31 12:55:40 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2013-12-06 18:03:34 -08:00
parent 3649ffac46
commit bdde88fd2a
3 changed files with 47 additions and 44 deletions

View file

@ -8,18 +8,17 @@
* Contributors: * Contributors:
* Markus Schorn - initial API and implementation * Markus Schorn - initial API and implementation
* Andrew Ferguson (Symbian) * Andrew Ferguson (Symbian)
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.index; package org.eclipse.cdt.core.index;
import org.eclipse.cdt.core.dom.IName; import org.eclipse.cdt.core.dom.IName;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
/** /**
* Interface for all the names in the index. These constitute either a * Interface for all the names in the index. These constitute either a declaration or a reference.
* declaration or a reference. *
*
* @since 4.0 * @since 4.0
* *
* @noextend This interface is not intended to be extended by clients. * @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented 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. * Returns the file the name belongs to.
* @throws CoreException * @throws CoreException
*/ */
public IIndexFile getFile() throws CoreException; public IIndexFile getFile() throws CoreException;
/** /**
* Returns the character offset of the location of the name. * 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. * Returns the length of the name.
*/ */
public int getNodeLength(); public int getNodeLength();
/** /**
* Returns the name of the definition that contains this name. * Returns the name of the definition that contains this name. May return {@code null}.
* May return <code>null</code>.
* Currently this is implemented for function and method definitions, only. * Currently this is implemented for function and method definitions, only.
*/ */
public IIndexName getEnclosingDefinition() throws CoreException; public IIndexName getEnclosingDefinition() throws CoreException;
/** /**
* Returns the names of the references contained in this definition. * Returns the names of the references contained in this definition.
* Returns <code>null</code>, if the name is not a definition. * Returns {@code null}, if the name is not a definition.
* *
* Currently the method works with function definitions, only. * Currently the method works with function definitions, only.
*/ */
public IIndexName[] getEnclosedNames() throws CoreException; public IIndexName[] getEnclosedNames() throws CoreException;
@ -61,25 +59,27 @@ public interface IIndexName extends IName {
* Returns whether a declaration is a base-class specifier. * Returns whether a declaration is a base-class specifier.
*/ */
public boolean isBaseSpecifier() throws CoreException; public boolean isBaseSpecifier() throws CoreException;
/** /**
* Returns whether this name potentially denotes a polymorphic method call. This is the case * 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 * 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. <p> * pointer or a reference to an object.
* <p>
* No checks are performed whether the method is actually virtual or not. * No checks are performed whether the method is actually virtual or not.
*/ */
public boolean couldBePolymorphicMethodCall() throws CoreException; public boolean couldBePolymorphicMethodCall() throws CoreException;
/** /**
* Returns whether this name specifies an inline namespace. * Returns whether this name specifies an inline namespace.
* @since 5.3 * @since 5.3
*/ */
public boolean isInlineNamespaceDefinition() throws CoreException; public boolean isInlineNamespaceDefinition() throws CoreException;
/** /**
* Returns whether this name is a read-reference to a variable or field. * 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, * The notion of a read-reference may not strictly reflect what your compiler generates,
* heuristics may be used. <p> * heuristics may be used.
* <p>
* For pointers and arrays the access to the pointer itself is tracked, rather than considering * For pointers and arrays the access to the pointer itself is tracked, rather than considering
* the target of the pointer. * 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. * 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, * The notion of a write-reference may not strictly reflect what your compiler generates,
* heuristics may be used. <p> * heuristics may be used.
* <p>
* For pointers and arrays the access to the pointer itself is tracked, rather than considering * For pointers and arrays the access to the pointer itself is tracked, rather than considering
* the target of the pointer. * the target of the pointer.
*/ */

View file

@ -9,7 +9,7 @@
* Markus Schorn - initial API and implementation * Markus Schorn - initial API and implementation
* Andrew Ferguson (Symbian) * Andrew Ferguson (Symbian)
* Bryan Wilkinson (QNX) * Bryan Wilkinson (QNX)
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.index; package org.eclipse.cdt.core.index;
import org.eclipse.cdt.core.dom.ILinkage; 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); 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 * Get an IndexFilter that filters out bindings from linkages other than that specified.
* specified *
* @param linkageID the id of the linkage whose bindings should be retained * @param linkageID the id of the linkage whose bindings should be retained
* @return an IndexFilter instance * @return an IndexFilter instance
*/ */
@ -48,10 +48,11 @@ abstract public class IndexFilter {
} }
/** /**
* Get an IndexFilter that filters out bindings without declarations and those * Get an IndexFilter that filters out bindings without declarations and those from linkages
* from linkages other than that specified. * other than that specified.
* @param linkageID the id of the linkage whose bindings should be retained, or -1 *
* to accept all linkages. * @param linkageID the id of the linkage whose bindings should be retained, or -1
* to accept all linkages.
* @return an IndexFilter instance * @return an IndexFilter instance
*/ */
public static IndexFilter getDeclaredBindingFilter(final int linkageID, boolean acceptImplicit) { 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 * Get an IndexFilter that filters out bindings without declarations and those
* from linkages other than that specified. * from linkages other than that specified.
* @param linkageID the id of the linkage whose bindings should be retained, or -1 *
* to accept all linkages. * @param linkageID the id of the linkage whose bindings should be retained, or -1
* to accept all linkages.
* @return an IndexFilter instance * @return an IndexFilter instance
* @since 5.1 * @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. * 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) * @see IIndex#findBindings(java.util.regex.Pattern, boolean, IndexFilter, org.eclipse.core.runtime.IProgressMonitor)
*
* @param linkage a linkage to be tested * @param linkage a linkage to be tested
* @return whether to include objects of the given linkage in the query. * @return whether to include objects of the given linkage in the query.
*/ */
public boolean acceptLinkage(ILinkage linkage) { public boolean acceptLinkage(ILinkage linkage) {
return true; return true;
} }
/** /**
* Determines whether or not a binding is valid. * Determines whether or not a binding is valid.
* *
* @param binding the binding being checked for validity * @param binding the binding being checked for validity
* @return whether or not the binding is valid * @return whether or not the binding is valid
* @throws CoreException * @throws CoreException
*/ */
public boolean acceptBinding(IBinding binding) throws CoreException { public boolean acceptBinding(IBinding binding) throws CoreException {
return true; return true;

View file

@ -6,8 +6,8 @@
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* IBM Rational Software - Initial API and implementation * IBM Rational Software - Initial API and implementation
* Markus Schorn (Wind River Systems) * Markus Schorn (Wind River Systems)
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.internal.corext.util; package org.eclipse.cdt.internal.corext.util;
@ -40,7 +40,7 @@ public class CModelUtil {
} }
return unit; return unit;
} }
public static ITranslationUnit toOriginal(ITranslationUnit unit) { public static ITranslationUnit toOriginal(ITranslationUnit unit) {
if (unit.isWorkingCopy()) { if (unit.isWorkingCopy()) {
return (((IWorkingCopy) unit).getOriginalElement()); return (((IWorkingCopy) unit).getOriginalElement());
@ -84,7 +84,7 @@ public class CModelUtil {
} }
return folder; return folder;
} }
/** /**
* Returns <code>true</code> if the given source root is * Returns <code>true</code> if the given source root is
* referenced. This means it is own by a different project but is referenced * referenced. This means it is own by a different project but is referenced
@ -100,7 +100,7 @@ public class CModelUtil {
} }
return false; return false;
} }
/** /**
* Returns the translation unit the element belongs to or <code>null</code> if it does not. * Returns the translation unit the element belongs to or <code>null</code> if it does not.
*/ */
@ -113,7 +113,7 @@ public class CModelUtil {
} }
return null; return null;
} }
/* /*
* Don't log not-exists exceptions * Don't log not-exists exceptions
*/ */
@ -126,5 +126,4 @@ public class CModelUtil {
return true; return true;
return false; return false;
} }
} }