1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-30 12:25:35 +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:
* 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 <code>null</code>.
* 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 <code>null</code>, 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. <p>
* 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.
* <p>
* 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. <p>
* The notion of a read-reference may not strictly reflect what your compiler generates,
* heuristics may be used.
* <p>
* 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. <p>
* The notion of a write-reference may not strictly reflect what your compiler generates,
* heuristics may be used.
* <p>
* For pointers and arrays the access to the pointer itself is tracked, rather than considering
* the target of the pointer.
*/

View file

@ -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;

View file

@ -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 <code>true</code> 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 <code>null</code> 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;
}
}