1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2014-01-02 16:44:38 -08:00
parent cafab91ca1
commit c95730601b
10 changed files with 284 additions and 284 deletions

View file

@ -14,9 +14,9 @@ package org.eclipse.cdt.core.model;
/**
* Common protocol for C elements that have associated source code.
* <p>
* Note: For <code>IBinary</code>, <code>IArchive</code> and other members
* derived from a binary type, the implementation returns source iff the
* element has attached source code and debuging information.
* Note: For {@code IBinary}, {@code IArchive} and other members
* derived from a binary type, the implementation returns source iff the element
* has attached source code and debugging information.
*
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.
@ -27,12 +27,11 @@ public interface ISourceReference {
* <p>
* For binary files, this returns the source of the entire translation unit
* associated with the binary file (if there is one).
* </p>
*
* @return the source code, or <code>null</code> if this element has no
* associated source code
* @return the source code, or {@code null} if this element has no
* associated source code
* @exception CModelException if this element does not exist or if an
* exception occurs while accessing its corresponding resource
* exception occurs while accessing its corresponding resource
*/
String getSource() throws CModelException;
@ -41,17 +40,16 @@ public interface ISourceReference {
* <p>
* For binary files, this returns the range of the entire translation unit
* associated with the binary file (if there is one).
* </p>
*
* @return the source range, or <code>null</code> if if this element has no
* associated source code
* @return the source range, or {@code null} if if this element has no
* associated source code
* @exception CModelException if this element does not exist or if an
* exception occurs while accessing its corresponding resource
* exception occurs while accessing its corresponding resource
*/
ISourceRange getSourceRange() throws CModelException;
/**
* Returns the translation unit in which this member is declared, or <code>null</code>
* Returns the translation unit in which this member is declared, or {@code null}
* if this member is not declared in a translation unit (for example, a binary type).
*/
ITranslationUnit getTranslationUnit();

View file

@ -8,7 +8,7 @@
* Contributors:
* Markus Schorn - initial API and implementation
* Sergey Prigogin (Google)
*******************************************************************************/
*******************************************************************************/
package org.eclipse.cdt.core.index;
import org.eclipse.cdt.core.CCorePlugin;
@ -21,10 +21,10 @@ import org.eclipse.core.runtime.IProgressMonitor;
/**
* Starting point for working with the index. The manager can be obtained via
* {@link CCorePlugin#getIndexManager()}.
*
*
* @noextend This interface is not intended to be extended by clients.
* @noimplement This interface is not intended to be implemented by clients.
*
*
* @since 4.0
*/
public interface IIndexManager extends IPDOMManager {
@ -41,27 +41,27 @@ public interface IIndexManager extends IPDOMManager {
* added to the resulting index.
*/
public static final int ADD_DEPENDENT = 0x2;
/**
* @deprecated Extension fragments are now used depending on their configuration.
* @deprecated Extension fragments are now used depending on their configuration.
* Use one of the ADD_EXTENSION_XX flags instead.
*/
@Deprecated
public static final int SKIP_PROVIDED = 0x4;
/**
* Constant for passing to getIndex methods. This constant, when set, indicates that each index
* content provided via the ReadOnlyIndexFragmentProvider or ReadOnlyPDOMProvider, which is not
* disabled for navigation shall be included in the resulting index.
* content provided via the ReadOnlyIndexFragmentProvider or ReadOnlyPDOMProvider, which is not
* disabled for navigation shall be included in the resulting index.
*
* @since 5.4
*/
public static final int ADD_EXTENSION_FRAGMENTS_NAVIGATION = 0x8;
/**
* Constant for passing to getIndex methods. This constant, when set, indicates that the each index
* content provided via the ReadOnlyIndexFragmentProvider or ReadOnlyPDOMProvider, which is not
* disabled for content assist shall be included in the resulting index.
* Constant for passing to getIndex methods. This constant, when set, indicates that the each
* index content provided via the ReadOnlyIndexFragmentProvider or ReadOnlyPDOMProvider, which
* is not disabled for content assist shall be included in the resulting index.
*
* @since 5.4
*/
@ -69,8 +69,8 @@ public interface IIndexManager extends IPDOMManager {
/**
* Constant for passing to getIndex methods. This constant, when set, indicates that each index
* content provided via the ReadOnlyIndexFragmentProvider or ReadOnlyPDOMProvider, which is not
* disabled for add import shall be included in the resulting index.
* content provided via the ReadOnlyIndexFragmentProvider or ReadOnlyPDOMProvider, which is not
* disabled for add import shall be included in the resulting index.
*
* @since 5.4
*/
@ -78,8 +78,8 @@ public interface IIndexManager extends IPDOMManager {
/**
* Constant for passing to getIndex methods. This constant, when set, indicates that each index
* content provided via the ReadOnlyIndexFragmentProvider or ReadOnlyPDOMProvider, which is not
* disabled for the call hierarchy shall be included in the resulting index.
* content provided via the ReadOnlyIndexFragmentProvider or ReadOnlyPDOMProvider, which is not
* disabled for the call hierarchy shall be included in the resulting index.
*
* @since 5.4
*/
@ -87,8 +87,8 @@ public interface IIndexManager extends IPDOMManager {
/**
* Constant for passing to getIndex methods. This constant, when set, indicates that each index
* content provided via the ReadOnlyIndexFragmentProvider or ReadOnlyPDOMProvider, which is not
* disabled for the type hierarchy shall be included in the resulting index.
* content provided via the ReadOnlyIndexFragmentProvider or ReadOnlyPDOMProvider, which is not
* disabled for the type hierarchy shall be included in the resulting index.
*
* @since 5.4
*/
@ -96,8 +96,8 @@ public interface IIndexManager extends IPDOMManager {
/**
* Constant for passing to getIndex methods. This constant, when set, indicates that each index
* content provided via the ReadOnlyIndexFragmentProvider or ReadOnlyPDOMProvider, which is not
* disabled for the include browser shall be included in the resulting index.
* content provided via the ReadOnlyIndexFragmentProvider or ReadOnlyPDOMProvider, which is not
* disabled for the include browser shall be included in the resulting index.
*
* @since 5.4
*/
@ -105,28 +105,28 @@ public interface IIndexManager extends IPDOMManager {
/**
* Constant for passing to getIndex methods. This constant, when set, indicates that each index
* content provided via the ReadOnlyIndexFragmentProvider or ReadOnlyPDOMProvider, which is not
* disabled for the search shall be included in the resulting index.
* content provided via the ReadOnlyIndexFragmentProvider or ReadOnlyPDOMProvider, which is not
* disabled for the search shall be included in the resulting index.
*
* @since 5.4
*/
public static final int ADD_EXTENSION_FRAGMENTS_SEARCH = 0x200;
/**
* Constant for passing to getIndex methods. This constant, when set, indicates that each index
* content provided via the ReadOnlyIndexFragmentProvider or ReadOnlyPDOMProvider, which is not
* disabled for the editor shall be included in the resulting index.
* content provided via the ReadOnlyIndexFragmentProvider or ReadOnlyPDOMProvider, which is not
* disabled for the editor shall be included in the resulting index.
*
* @since 5.5
*/
public static final int ADD_EXTENSION_FRAGMENTS_EDITOR = 0x400;
/**
* Constant for indicating that there is no time out period for joining the indexer job.
* Constant for indicating that there is no time out period for joining the indexer job.
* @see IIndexManager#joinIndexer(int, IProgressMonitor)
*/
public static final int FOREVER= -1;
/**
* Constant for requesting an update of all translation units.
*/
@ -155,7 +155,7 @@ public interface IIndexManager extends IPDOMManager {
* This flag modifies behavior of UPDATE_CHECK_TIMESTAMPS. Both, the timestamp and the hash
* of the contents of a translation unit, have to change in order to trigger re-indexing.
* Checking for content changes may reduce indexing overhead for projects that use code
* generation since generated files are sometimes recreated with identical contents.
* generation since generated files are sometimes recreated with identical contents.
* @since 5.2
*/
public static final int UPDATE_CHECK_CONTENTS_HASH= 0x10;
@ -163,7 +163,7 @@ public interface IIndexManager extends IPDOMManager {
/**
* Include files that are otherwise would be excluded from the index. This flag is sticky
* for the duration of the Eclipse session. If the files are later updated without this flag,
* they remain in the index.
* they remain in the index.
* @since 5.3
*/
public static final int FORCE_INDEX_INCLUSION= 0x20;
@ -199,18 +199,23 @@ public interface IIndexManager extends IPDOMManager {
IIndex getIndex(ICProject[] projects) throws CoreException;
/**
* Returns the index for the given project. You can specify to add dependencies or dependent projects.
* Returns the index for the given project. You can specify to add dependencies or dependent
* projects.
*
* @param project the project to get the index for
* @param options <code>0</code> or a combination of {@link #ADD_DEPENDENCIES} and {@link #ADD_DEPENDENT}.
* @param options <code>0</code> or a combination of {@link #ADD_DEPENDENCIES} and
* {@link #ADD_DEPENDENT}.
* @return an index for the project
* @throws CoreException
*/
IIndex getIndex(ICProject project, int options) throws CoreException;
/**
* Returns the index for the given projects. You can specify to add dependencies or dependent projects.
* Returns the index for the given projects. You can specify to add dependencies or dependent
* projects.
* @param projects the projects to get the index for
* @param options <code>0</code> or a combination of {@link #ADD_DEPENDENCIES} and {@link #ADD_DEPENDENT}.
* @param options <code>0</code> or a combination of {@link #ADD_DEPENDENCIES} and
* {@link #ADD_DEPENDENT}.
* @return an index for the projects
* @throws CoreException
*/
@ -227,7 +232,7 @@ public interface IIndexManager extends IPDOMManager {
* @param listener the listener to unregister.
*/
void removeIndexChangeListener(IIndexChangeListener listener);
/**
* Registers a listener that will be notified whenever the indexer changes its state.
* @param listener the listener to register.
@ -239,33 +244,33 @@ public interface IIndexManager extends IPDOMManager {
* @param listener the listener to unregister.
*/
void removeIndexerStateListener(IIndexerStateListener listener);
/**
* Joins the indexer and reports progress.
* @param waitMaxMillis time limit in millis after which the method returns with <code>false</code>,
* or {@link #FOREVER}.
* @param waitMaxMillis time limit in milliseconds after which the method returns with
* {@code false}, or {@link #FOREVER}.
* @param monitor a monitor to report progress.
* @return <code>true</code>, if the indexer went idle in the given time.
*/
boolean joinIndexer(int waitMaxMillis, IProgressMonitor monitor);
/**
* Checks whether the indexer is currently idle. The indexer is idle, when there is currently no request
* to update files of an index and no initialization for a project is performed. However, the indexer becomes
* idle, when the setup of a project is postponed (check with {@link #isIndexerSetupPostponed(ICProject)}).
*/
boolean isIndexerIdle();
/**
* Returns whether an indexer is selected for the project.
* @since 4.0
*/
boolean isProjectIndexed(ICProject proj);
/**
* Return whether the indexer-setup for a project is currently postponed. Note,
* that a postponed setup does not prevent the indexer from becoming idle ({@link #isIndexerIdle()}.
* The fact that the indexer-setup for a project is no longer postponed, will be reported using
* The fact that the indexer-setup for a project is no longer postponed, will be reported using
* {@link IndexerSetupParticipant#onIndexerSetup(ICProject)}.
*/
boolean isIndexerSetupPostponed(ICProject proj);
@ -283,7 +288,7 @@ public interface IIndexManager extends IPDOMManager {
*/
@Override
public void setIndexerId(ICProject project, String indexerId);
/**
* Clears the entire index of the project and schedules the indexer.
* @since 4.0
@ -302,22 +307,23 @@ public interface IIndexManager extends IPDOMManager {
* @since 4.0
*/
public void update(ICElement[] tuSelection, int options) throws CoreException;
/**
* Export index for usage within a team.
* @param project a project for which the pdom is to be exported.
* @param project a project for which the PDOM is to be exported.
* @param location the target location for the database.
* @param options currently none are supported.
* @throws CoreException
* @since 4.0
*/
public void export(ICProject project, String location, int options, IProgressMonitor monitor) throws CoreException;
public void export(ICProject project, String location, int options, IProgressMonitor monitor)
throws CoreException;
/**
* Adds a participant for the indexer-setup
*/
public void addIndexerSetupParticipant(IndexerSetupParticipant participant);
/**
* Removes a participant for the indexer-setup
*/

View file

@ -328,7 +328,7 @@ public interface IIndexFragment {
IIndexFragmentFile[] getDefectiveFiles() throws CoreException;
/**
* @return an array of files containg unresolved includes.
* @return an array of files containing unresolved includes.
*/
IIndexFragmentFile[] getFilesWithUnresolvedIncludes() throws CoreException;

View file

@ -10,7 +10,6 @@
* Andrew Ferguson (Symbian)
* Sergey Prigogin (Google)
******************************************************************************/
package org.eclipse.cdt.internal.core.index;
import org.eclipse.cdt.core.dom.ast.IASTName;
@ -26,7 +25,6 @@ import org.eclipse.core.runtime.CoreException;
* The interface that an actual storage for an index has to implement.
*/
public interface IWritableIndexFragment extends IIndexFragment {
/**
* Clears the entire fragment.
*/

View file

@ -521,7 +521,7 @@ public class PDOMManager implements IWritableIndexManager, IListener {
enqueue(new NotifyCModelManagerTask(cproject.getProject()));
}
}
if (IndexerPreferences.getReindexOnIndexerChange(cproject.getProject())) {
enqueue(new PDOMRebuildTask(indexer));
}
@ -575,9 +575,9 @@ public class PDOMManager implements IWritableIndexManager, IListener {
IndexUpdatePolicy policy= createPolicy(project);
boolean rebuild=
pdom.isClearedBecauseOfVersionMismatch() ||
pdom.isCreatedFromScratch() ||
policy.isInitialRebuildRequested();
pdom.isClearedBecauseOfVersionMismatch() ||
pdom.isCreatedFromScratch() ||
policy.isInitialRebuildRequested();
if (rebuild) {
if (IPDOMManager.ID_NO_INDEXER.equals(indexer.getID())) {
rebuild= false;
@ -1535,7 +1535,7 @@ public class PDOMManager implements IWritableIndexManager, IListener {
/**
* @param cproject the project to check
* @return whether the content in the project fragment of the specified project's index
* is complete (contains all sources) and up to date.
* is complete (contains all sources) and up to date.
* @throws CoreException
*/
public boolean isProjectContentSynced(ICProject cproject) throws CoreException {
@ -1544,11 +1544,11 @@ public class PDOMManager implements IWritableIndexManager, IListener {
}
/**
* Checks whether the index is in sync with the file system.
* Checks whether the index is in sync with the file system.
* @param cproject the project to check
* @return <code>null</code> when the content in the project fragment of the specified project's index
* is complete (contains all sources) and up to date; or an @link{IStatus} indicating the first
* occurrence of an index file found not up-to-date, along with its include trail.
* @return {@code null} when the content in the project fragment of the specified project's
* index is complete (contains all sources) and up to date; or an {@link IStatus} indicating
* the first occurrence of an index file found not up-to-date, along with its include trail.
* @throws CoreException in case of a file access or other internal error
*/
public IStatus getProjectContentSyncState(ICProject cproject) throws CoreException {
@ -1567,7 +1567,7 @@ public class PDOMManager implements IWritableIndexManager, IListener {
IResource resource= tu.getResource();
if (resource instanceof IFile && isSubjectToIndexing(tu.getLanguage())) {
IIndexFileLocation location= IndexLocationFactory.getWorkspaceIFL((IFile) resource);
syncStatus = areSynchronized(new HashSet<IIndexFileLocation>(), index, resource, location);
syncStatus = areSynchronized(new HashSet<IIndexFileLocation>(), index, resource, location);
if (syncStatus != null) {
return syncStatus;
}
@ -1613,7 +1613,7 @@ public class PDOMManager implements IWritableIndexManager, IListener {
return new MultiStatus(CCorePlugin.PLUGIN_ID, IStatus.OK, "No index file found for: " + location, null); //$NON-NLS-1$
for (IIndexFile file : files) {
long diff = resource.getLocalTimeStamp() - file.getTimestamp();
long diff = resource.getLocalTimeStamp() - file.getTimestamp();
if (diff != 0) {
return new MultiStatus(CCorePlugin.PLUGIN_ID, IStatus.OK,
"Index timestamp for '" //$NON-NLS-1$
@ -1632,7 +1632,7 @@ public class PDOMManager implements IWritableIndexManager, IListener {
String path= newLocation.getFullPath();
if (path != null) {
IResource newResource= ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(path));
MultiStatus m = areSynchronized(trail, index, newResource, newLocation);
MultiStatus m = areSynchronized(trail, index, newResource, newLocation);
if (m != null) {
m.add(new Status(IStatus.INFO, CCorePlugin.PLUGIN_ID,
"Included by " + file.getLocation().getFullPath())); //$NON-NLS-1$

View file

@ -6,9 +6,8 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Andrew Ferguson (Symbian) - Initial implementation
* Andrew Ferguson (Symbian) - Initial implementation
*******************************************************************************/
package org.eclipse.cdt.ui.tests.search;
import junit.framework.TestSuite;

View file

@ -13,7 +13,6 @@ package org.eclipse.cdt.internal.ui.actions;
import org.eclipse.cdt.core.index.IIndexManager;
public class UpdateUnresolvedIncludesAction extends AbstractUpdateIndexAction {
@Override
protected int getUpdateOptions() {
return IIndexManager.UPDATE_UNRESOLVED_INCLUDES;

View file

@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.cdt.internal.ui.actions;
/**
* Handler for {@link org.eclipse.cdt.internal.ui.actions.UpdateIndexWithModifiedFilesAction}
*
@ -18,7 +17,6 @@ package org.eclipse.cdt.internal.ui.actions;
* @noinstantiate This class is not intended to be instantiated by clients.
*/
public class UpdateUnresolvedIncludesHandler extends AbstractUpdateIndexHandler {
private final UpdateUnresolvedIncludesAction updateAction = new UpdateUnresolvedIncludesAction();
@Override

View file

@ -24,18 +24,17 @@ import org.eclipse.cdt.core.index.IIndexFileLocation;
* @author Doug Schaefer
*/
public class CSearchElement implements IAdaptable {
private final IIndexFileLocation location;
public CSearchElement(IIndexFileLocation loc) {
this.location= loc;
}
@Override
public int hashCode() {
return location.hashCode();
}
@Override
public boolean equals(Object obj) {
if (!(obj instanceof CSearchElement))
@ -47,7 +46,7 @@ public class CSearchElement implements IAdaptable {
final IIndexFileLocation getLocation() {
return location;
}
@Override
@SuppressWarnings({ "unchecked", "rawtypes" })
public Object getAdapter(Class adapterType) {