mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Fixed compiler warnings.
This commit is contained in:
parent
9972595fc7
commit
ef7a5f4f0b
19 changed files with 180 additions and 68 deletions
|
@ -87,10 +87,12 @@ public interface IASTCastExpression extends IASTExpression {
|
||||||
/**
|
/**
|
||||||
* @since 5.1
|
* @since 5.1
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IASTCastExpression copy();
|
public IASTCastExpression copy();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @since 5.3
|
* @since 5.3
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public IASTCastExpression copy(CopyStyle style);
|
public IASTCastExpression copy(CopyStyle style);
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,8 +44,8 @@ public interface IIndexBinding extends IBinding {
|
||||||
IIndexFile getLocalToFile() throws CoreException;
|
IIndexFile getLocalToFile() throws CoreException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
|
||||||
* @since 5.1
|
* @since 5.1
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
IIndexBinding getOwner();
|
IIndexBinding getOwner();
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,6 @@ package org.eclipse.cdt.core.index;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.dom.ast.IFileNomination;
|
import org.eclipse.cdt.core.dom.ast.IFileNomination;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDirective;
|
import org.eclipse.cdt.core.dom.ast.cpp.ICPPUsingDirective;
|
||||||
import org.eclipse.cdt.core.parser.ISignificantMacros;
|
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -35,13 +34,6 @@ public interface IIndexFile extends IFileNomination {
|
||||||
*/
|
*/
|
||||||
IIndexFileLocation getLocation() throws CoreException;
|
IIndexFileLocation getLocation() throws CoreException;
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the significant macros for this version of the file.
|
|
||||||
* @throws CoreException
|
|
||||||
* @since 5.4
|
|
||||||
*/
|
|
||||||
ISignificantMacros getSignificantMacros() throws CoreException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns all includes found in this file.
|
* Returns all includes found in this file.
|
||||||
* @return an array of all includes found in this file
|
* @return an array of all includes found in this file
|
||||||
|
@ -102,13 +94,6 @@ public interface IIndexFile extends IFileNomination {
|
||||||
*/
|
*/
|
||||||
IIndexInclude getParsedInContext() throws CoreException;
|
IIndexInclude getParsedInContext() throws CoreException;
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns <code>true</code> if the file is a header with #pragma once statement or an include
|
|
||||||
* guard, or if it is a source file.
|
|
||||||
* @since 5.4
|
|
||||||
*/
|
|
||||||
public boolean hasPragmaOnceSemantics() throws CoreException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the id of the linkage this file was parsed in.
|
* Returns the id of the linkage this file was parsed in.
|
||||||
* @since 5.0
|
* @since 5.0
|
||||||
|
|
|
@ -207,12 +207,14 @@ public interface IIndexManager extends IPDOMManager {
|
||||||
* Returns the id of the indexer working on the project.
|
* Returns the id of the indexer working on the project.
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getIndexerId(ICProject project);
|
public String getIndexerId(ICProject project);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Changes the indexer working on the project.
|
* Changes the indexer working on the project.
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setIndexerId(ICProject project, String indexerId);
|
public void setIndexerId(ICProject project, String indexerId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -16,15 +16,13 @@ import org.eclipse.core.resources.IWorkspaceRoot;
|
||||||
import org.eclipse.core.resources.ResourcesPlugin;
|
import org.eclipse.core.resources.ResourcesPlugin;
|
||||||
import org.eclipse.core.runtime.IPath;
|
import org.eclipse.core.runtime.IPath;
|
||||||
import org.eclipse.core.runtime.Path;
|
import org.eclipse.core.runtime.Path;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A location converter for converting project resource locations to be relative to a specified container.
|
* A location converter for converting project resource locations to be relative to a specified
|
||||||
* Resources outside of the associated project will not be converted (ignored).
|
* container. Resources outside of the associated project will not be converted (ignored).
|
||||||
* <br>
|
* <br>
|
||||||
* This location converter is internal-representation-compatible with URIRelativeLocationConverter
|
* This location converter is internal-representation-compatible with URIRelativeLocationConverter
|
||||||
*/
|
*/
|
||||||
/*
|
|
||||||
* Internal representation is a relative path
|
|
||||||
*/
|
|
||||||
public class ResourceContainerRelativeLocationConverter implements IIndexLocationConverter {
|
public class ResourceContainerRelativeLocationConverter implements IIndexLocationConverter {
|
||||||
protected IWorkspaceRoot root;
|
protected IWorkspaceRoot root;
|
||||||
protected IPath fullPath;
|
protected IPath fullPath;
|
||||||
|
@ -36,18 +34,13 @@ public class ResourceContainerRelativeLocationConverter implements IIndexLocatio
|
||||||
this.fullPath = container.getFullPath();
|
this.fullPath = container.getFullPath();
|
||||||
this.root = ResourcesPlugin.getWorkspace().getRoot();
|
this.root = ResourcesPlugin.getWorkspace().getRoot();
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
@Override
|
||||||
* @see org.eclipse.cdt.core.index.IIndexLocationConverter#fromInternalFormat(java.lang.String)
|
|
||||||
*/
|
|
||||||
public IIndexFileLocation fromInternalFormat(String raw) {
|
public IIndexFileLocation fromInternalFormat(String raw) {
|
||||||
IResource member= root.getFile(fullPath.append(raw));
|
IResource member= root.getFile(fullPath.append(raw));
|
||||||
return new IndexFileLocation(member.getLocationURI(), member.getFullPath().toString());
|
return new IndexFileLocation(member.getLocationURI(), member.getFullPath().toString());
|
||||||
}
|
}
|
||||||
/*
|
@Override
|
||||||
* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.core.index.IIndexLocationConverter#toInternalFormat(org.eclipse.cdt.core.index.IIndexFileLocation)
|
|
||||||
*/
|
|
||||||
public String toInternalFormat(IIndexFileLocation location) {
|
public String toInternalFormat(IIndexFileLocation location) {
|
||||||
String sFullPath= location.getFullPath();
|
String sFullPath= location.getFullPath();
|
||||||
if(sFullPath!=null) {
|
if(sFullPath!=null) {
|
||||||
|
|
|
@ -39,6 +39,7 @@ public class URIRelativeLocationConverter implements IIndexLocationConverter {
|
||||||
this.baseURI = baseURI;
|
this.baseURI = baseURI;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexFileLocation fromInternalFormat(String raw) {
|
public IIndexFileLocation fromInternalFormat(String raw) {
|
||||||
String rawPath = URIUtil.toURI(raw).getRawPath();
|
String rawPath = URIUtil.toURI(raw).getRawPath();
|
||||||
if (rawPath.length() > 0 && rawPath.charAt(0) == '/')
|
if (rawPath.length() > 0 && rawPath.charAt(0) == '/')
|
||||||
|
@ -47,6 +48,7 @@ public class URIRelativeLocationConverter implements IIndexLocationConverter {
|
||||||
return new IndexFileLocation(uri, null);
|
return new IndexFileLocation(uri, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String toInternalFormat(IIndexFileLocation location) {
|
public String toInternalFormat(IIndexFileLocation location) {
|
||||||
URI relative = baseURI.relativize(location.getURI());
|
URI relative = baseURI.relativize(location.getURI());
|
||||||
return relative.isAbsolute() ? null : relative.getPath();
|
return relative.isAbsolute() ? null : relative.getPath();
|
||||||
|
|
|
@ -50,6 +50,7 @@ public class CModelListener implements IElementChangedListener, IResourceChangeL
|
||||||
fManager= manager;
|
fManager= manager;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void elementChanged(ElementChangedEvent event) {
|
public void elementChanged(ElementChangedEvent event) {
|
||||||
// Only respond to post change events
|
// Only respond to post change events
|
||||||
if (event.getType() != ElementChangedEvent.POST_CHANGE)
|
if (event.getType() != ElementChangedEvent.POST_CHANGE)
|
||||||
|
@ -151,6 +152,7 @@ public class CModelListener implements IElementChangedListener, IResourceChangeL
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void resourceChanged(IResourceChangeEvent event) {
|
public void resourceChanged(IResourceChangeEvent event) {
|
||||||
if (event.getType() == IResourceChangeEvent.POST_BUILD) {
|
if (event.getType() == IResourceChangeEvent.POST_BUILD) {
|
||||||
fManager.handlePostBuildEvent();
|
fManager.handlePostBuildEvent();
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Markus Schorn - initial API and implementation
|
* Markus Schorn - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.internal.core.pdom;
|
package org.eclipse.cdt.internal.core.pdom;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.index.IndexerSetupParticipant;
|
import org.eclipse.cdt.core.index.IndexerSetupParticipant;
|
||||||
|
@ -22,7 +21,6 @@ import org.eclipse.cdt.internal.core.settings.model.CProjectDescriptionManager;
|
||||||
import org.eclipse.core.resources.IProject;
|
import org.eclipse.core.resources.IProject;
|
||||||
|
|
||||||
public class CProjectDescriptionListener implements ICProjectDescriptionListener {
|
public class CProjectDescriptionListener implements ICProjectDescriptionListener {
|
||||||
|
|
||||||
private PDOMManager fIndexManager;
|
private PDOMManager fIndexManager;
|
||||||
private IndexerSetupParticipant fIndexerSetupParticipant;
|
private IndexerSetupParticipant fIndexerSetupParticipant;
|
||||||
|
|
||||||
|
@ -41,6 +39,7 @@ public class CProjectDescriptionListener implements ICProjectDescriptionListener
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void handleEvent(CProjectDescriptionEvent event) {
|
public void handleEvent(CProjectDescriptionEvent event) {
|
||||||
ICProjectDescription old= event.getOldCProjectDescription();
|
ICProjectDescription old= event.getOldCProjectDescription();
|
||||||
ICProjectDescription act= event.getNewCProjectDescription();
|
ICProjectDescription act= event.getNewCProjectDescription();
|
||||||
|
|
|
@ -25,12 +25,15 @@ class JobChangeListener implements IJobChangeListener {
|
||||||
fPDomManager= pdomManager;
|
fPDomManager= pdomManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void aboutToRun(IJobChangeEvent event) {
|
public void aboutToRun(IJobChangeEvent event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void awake(IJobChangeEvent event) {
|
public void awake(IJobChangeEvent event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void done(IJobChangeEvent event) {
|
public void done(IJobChangeEvent event) {
|
||||||
if (event.getJob().belongsTo(fPDomManager)) {
|
if (event.getJob().belongsTo(fPDomManager)) {
|
||||||
if (Job.getJobManager().find(fPDomManager).length == 0) {
|
if (Job.getJobManager().find(fPDomManager).length == 0) {
|
||||||
|
@ -39,15 +42,18 @@ class JobChangeListener implements IJobChangeListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void running(IJobChangeEvent event) {
|
public void running(IJobChangeEvent event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void scheduled(IJobChangeEvent event) {
|
public void scheduled(IJobChangeEvent event) {
|
||||||
if (event.getJob().belongsTo(fPDomManager)) {
|
if (event.getJob().belongsTo(fPDomManager)) {
|
||||||
fPDomManager.fireStateChange(IndexerStateEvent.STATE_BUSY);
|
fPDomManager.fireStateChange(IndexerStateEvent.STATE_BUSY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void sleeping(IJobChangeEvent event) {
|
public void sleeping(IJobChangeEvent event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,19 +28,14 @@ import org.eclipse.core.runtime.CoreException;
|
||||||
* This class handles changes in language mappings for the PDOM by reindexing the appropriate projects.
|
* This class handles changes in language mappings for the PDOM by reindexing the appropriate projects.
|
||||||
* This class is a a work in progress and will be changed soon to be smarter about the resources it reindexes.
|
* This class is a a work in progress and will be changed soon to be smarter about the resources it reindexes.
|
||||||
*/
|
*/
|
||||||
public class LanguageMappingChangeListener implements
|
public class LanguageMappingChangeListener implements ILanguageMappingChangeListener {
|
||||||
ILanguageMappingChangeListener {
|
|
||||||
|
|
||||||
private IIndexManager fManager;
|
private IIndexManager fManager;
|
||||||
|
|
||||||
public LanguageMappingChangeListener(IIndexManager manager) {
|
public LanguageMappingChangeListener(IIndexManager manager) {
|
||||||
fManager = manager;
|
fManager = manager;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.core.model.ILanguageMappingChangeListener#handleLanguageMappingChangeEvent(org.eclipse.cdt.core.model.ILanguageMappingsChangeEvent)
|
|
||||||
*/
|
|
||||||
public void handleLanguageMappingChangeEvent(ILanguageMappingChangeEvent event) {
|
public void handleLanguageMappingChangeEvent(ILanguageMappingChangeEvent event) {
|
||||||
CModelManager manager = CModelManager.getDefault();
|
CModelManager manager = CModelManager.getDefault();
|
||||||
if (event.getType() == ILanguageMappingChangeEvent.TYPE_WORKSPACE) {
|
if (event.getType() == ILanguageMappingChangeEvent.TYPE_WORKSPACE) {
|
||||||
|
|
|
@ -31,14 +31,17 @@ public class NotifyCModelManagerTask implements IPDOMIndexerTask {
|
||||||
fProject= project;
|
fProject= project;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IPDOMIndexer getIndexer() {
|
public IPDOMIndexer getIndexer() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IndexerProgress getProgressInformation() {
|
public IndexerProgress getProgressInformation() {
|
||||||
return new IndexerProgress();
|
return new IndexerProgress();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void run(IProgressMonitor monitor) throws InterruptedException {
|
public void run(IProgressMonitor monitor) throws InterruptedException {
|
||||||
IContentType ct1= Platform.getContentTypeManager().getContentType(CCorePlugin.CONTENT_TYPE_CXXHEADER);
|
IContentType ct1= Platform.getContentTypeManager().getContentType(CCorePlugin.CONTENT_TYPE_CXXHEADER);
|
||||||
IContentType ct2= Platform.getContentTypeManager().getContentType(CCorePlugin.CONTENT_TYPE_CXXSOURCE);
|
IContentType ct2= Platform.getContentTypeManager().getContentType(CCorePlugin.CONTENT_TYPE_CXXSOURCE);
|
||||||
|
@ -51,6 +54,7 @@ public class NotifyCModelManagerTask implements IPDOMIndexerTask {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean acceptUrgentTask(IPDOMIndexerTask task) {
|
public boolean acceptUrgentTask(IPDOMIndexerTask task) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -390,12 +390,14 @@ public class PDOM extends PlatformObject implements IPDOM {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void addListener(IListener listener) {
|
public void addListener(IListener listener) {
|
||||||
if (listeners == null)
|
if (listeners == null)
|
||||||
listeners = new LinkedList<IListener>();
|
listeners = new LinkedList<IListener>();
|
||||||
listeners.add(listener);
|
listeners.add(listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void removeListener(IListener listener) {
|
public void removeListener(IListener listener) {
|
||||||
if (listeners == null)
|
if (listeners == null)
|
||||||
return;
|
return;
|
||||||
|
@ -422,6 +424,7 @@ public class PDOM extends PlatformObject implements IPDOM {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@Override
|
||||||
public PDOMFile getFile(int linkageID, IIndexFileLocation location) throws CoreException {
|
public PDOMFile getFile(int linkageID, IIndexFileLocation location) throws CoreException {
|
||||||
PDOMLinkage linkage= getLinkage(linkageID);
|
PDOMLinkage linkage= getLinkage(linkageID);
|
||||||
if (linkage == null)
|
if (linkage == null)
|
||||||
|
@ -429,6 +432,7 @@ public class PDOM extends PlatformObject implements IPDOM {
|
||||||
return PDOMFile.findFile(linkage, getFileIndex(), location, locationConverter);
|
return PDOMFile.findFile(linkage, getFileIndex(), location, locationConverter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public PDOMFile getFile(int linkageID, IIndexFileLocation location,
|
public PDOMFile getFile(int linkageID, IIndexFileLocation location,
|
||||||
ISignificantMacros macroDictionary) throws CoreException {
|
ISignificantMacros macroDictionary) throws CoreException {
|
||||||
PDOMLinkage linkage= getLinkage(linkageID);
|
PDOMLinkage linkage= getLinkage(linkageID);
|
||||||
|
@ -443,6 +447,7 @@ public class PDOM extends PlatformObject implements IPDOM {
|
||||||
return PDOMFile.findFile(linkage, getFileIndex(), location, locationConverter, macroDictionary);
|
return PDOMFile.findFile(linkage, getFileIndex(), location, locationConverter, macroDictionary);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexFragmentFile[] getFiles(int linkageID, IIndexFileLocation location) throws CoreException {
|
public IIndexFragmentFile[] getFiles(int linkageID, IIndexFileLocation location) throws CoreException {
|
||||||
PDOMLinkage linkage= getLinkage(linkageID);
|
PDOMLinkage linkage= getLinkage(linkageID);
|
||||||
if (linkage == null)
|
if (linkage == null)
|
||||||
|
@ -450,16 +455,20 @@ public class PDOM extends PlatformObject implements IPDOM {
|
||||||
return PDOMFile.findFiles(linkage, getFileIndex(), location, locationConverter);
|
return PDOMFile.findFiles(linkage, getFileIndex(), location, locationConverter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexFragmentFile[] getFiles(IIndexFileLocation location) throws CoreException {
|
public IIndexFragmentFile[] getFiles(IIndexFileLocation location) throws CoreException {
|
||||||
return PDOMFile.findFiles(this, getFileIndex(), location, locationConverter);
|
return PDOMFile.findFiles(this, getFileIndex(), location, locationConverter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexFragmentFile[] getAllFiles() throws CoreException {
|
public IIndexFragmentFile[] getAllFiles() throws CoreException {
|
||||||
final List<PDOMFile> locations = new ArrayList<PDOMFile>();
|
final List<PDOMFile> locations = new ArrayList<PDOMFile>();
|
||||||
getFileIndex().accept(new IBTreeVisitor() {
|
getFileIndex().accept(new IBTreeVisitor() {
|
||||||
|
@Override
|
||||||
public int compare(long record) throws CoreException {
|
public int compare(long record) throws CoreException {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public boolean visit(long record) throws CoreException {
|
public boolean visit(long record) throws CoreException {
|
||||||
PDOMFile file = PDOMFile.recreateFile(PDOM.this, record);
|
PDOMFile file = PDOMFile.recreateFile(PDOM.this, record);
|
||||||
locations.add(file);
|
locations.add(file);
|
||||||
|
@ -516,6 +525,7 @@ public class PDOM extends PlatformObject implements IPDOM {
|
||||||
return getFirstLinkageRecord() == 0;
|
return getFirstLinkageRecord() == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexFragmentBinding findBinding(IASTName name) throws CoreException {
|
public IIndexFragmentBinding findBinding(IASTName name) throws CoreException {
|
||||||
IBinding binding= name.resolveBinding();
|
IBinding binding= name.resolveBinding();
|
||||||
if (binding != null) {
|
if (binding != null) {
|
||||||
|
@ -553,6 +563,7 @@ public class PDOM extends PlatformObject implements IPDOM {
|
||||||
matchStack.add(matchesUpToLevel);
|
matchStack.add(matchesUpToLevel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean visit(IPDOMNode node) throws CoreException {
|
public boolean visit(IPDOMNode node) throws CoreException {
|
||||||
if (monitor.isCanceled())
|
if (monitor.isCanceled())
|
||||||
throw new CoreException(Status.OK_STATUS);
|
throw new CoreException(Status.OK_STATUS);
|
||||||
|
@ -600,6 +611,7 @@ public class PDOM extends PlatformObject implements IPDOM {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void leave(IPDOMNode node) throws CoreException {
|
public void leave(IPDOMNode node) throws CoreException {
|
||||||
final int idx= currentPath.size()-1;
|
final int idx= currentPath.size()-1;
|
||||||
if (idx >= 0 && currentPath.get(idx) == node) {
|
if (idx >= 0 && currentPath.get(idx) == node) {
|
||||||
|
@ -617,7 +629,9 @@ public class PDOM extends PlatformObject implements IPDOM {
|
||||||
return findBindings(new Pattern[] { pattern }, isFullyQualified, filter, monitor);
|
return findBindings(new Pattern[] { pattern }, isFullyQualified, filter, monitor);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IIndexFragmentBinding[] findBindings(Pattern[] patterns, boolean isFullyQualified, IndexFilter filter, IProgressMonitor monitor) throws CoreException {
|
@Override
|
||||||
|
public IIndexFragmentBinding[] findBindings(Pattern[] patterns, boolean isFullyQualified,
|
||||||
|
IndexFilter filter, IProgressMonitor monitor) throws CoreException {
|
||||||
if (monitor == null) {
|
if (monitor == null) {
|
||||||
monitor= new NullProgressMonitor();
|
monitor= new NullProgressMonitor();
|
||||||
}
|
}
|
||||||
|
@ -710,7 +724,9 @@ public class PDOM extends PlatformObject implements IPDOM {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IIndexFragmentBinding[] findMacroContainers(Pattern pattern, IndexFilter filter, IProgressMonitor monitor) throws CoreException {
|
@Override
|
||||||
|
public IIndexFragmentBinding[] findMacroContainers(Pattern pattern, IndexFilter filter,
|
||||||
|
IProgressMonitor monitor) throws CoreException {
|
||||||
if (monitor == null) {
|
if (monitor == null) {
|
||||||
monitor= new NullProgressMonitor();
|
monitor= new NullProgressMonitor();
|
||||||
}
|
}
|
||||||
|
@ -747,7 +763,9 @@ public class PDOM extends PlatformObject implements IPDOM {
|
||||||
return result.toArray(new IIndexFragmentBinding[result.size()]);
|
return result.toArray(new IIndexFragmentBinding[result.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IIndexFragmentBinding[] findBindings(char[][] names, IndexFilter filter, IProgressMonitor monitor) throws CoreException {
|
@Override
|
||||||
|
public IIndexFragmentBinding[] findBindings(char[][] names, IndexFilter filter,
|
||||||
|
IProgressMonitor monitor) throws CoreException {
|
||||||
return findBindings(names, true, filter, monitor);
|
return findBindings(names, true, filter, monitor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -797,11 +815,13 @@ public class PDOM extends PlatformObject implements IPDOM {
|
||||||
return db.getRecPtr(LINKAGES);
|
return db.getRecPtr(LINKAGES);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexLinkage[] getLinkages() {
|
public IIndexLinkage[] getLinkages() {
|
||||||
Collection<PDOMLinkage> values = getLinkageList();
|
Collection<PDOMLinkage> values = getLinkageList();
|
||||||
return values.toArray(new IIndexLinkage[values.size()]);
|
return values.toArray(new IIndexLinkage[values.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public PDOMLinkage[] getLinkageImpls() {
|
public PDOMLinkage[] getLinkageImpls() {
|
||||||
Collection<PDOMLinkage> values = getLinkageList();
|
Collection<PDOMLinkage> values = getLinkageList();
|
||||||
return values.toArray(new PDOMLinkage[values.size()]);
|
return values.toArray(new PDOMLinkage[values.size()]);
|
||||||
|
@ -822,6 +842,7 @@ public class PDOM extends PlatformObject implements IPDOM {
|
||||||
private long lastReadAccess= 0;
|
private long lastReadAccess= 0;
|
||||||
private long timeWriteLockAcquired;
|
private long timeWriteLockAcquired;
|
||||||
|
|
||||||
|
@Override
|
||||||
public void acquireReadLock() throws InterruptedException {
|
public void acquireReadLock() throws InterruptedException {
|
||||||
long t = sDEBUG_LOCKS ? System.nanoTime() : 0;
|
long t = sDEBUG_LOCKS ? System.nanoTime() : 0;
|
||||||
synchronized (mutex) {
|
synchronized (mutex) {
|
||||||
|
@ -845,6 +866,7 @@ public class PDOM extends PlatformObject implements IPDOM {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void releaseReadLock() {
|
public void releaseReadLock() {
|
||||||
boolean clearCache= false;
|
boolean clearCache= false;
|
||||||
synchronized (mutex) {
|
synchronized (mutex) {
|
||||||
|
@ -948,12 +970,14 @@ public class PDOM extends PlatformObject implements IPDOM {
|
||||||
fireChange(event);
|
fireChange(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean hasWaitingReaders() {
|
public boolean hasWaitingReaders() {
|
||||||
synchronized (mutex) {
|
synchronized (mutex) {
|
||||||
return waitingReaders > 0;
|
return waitingReaders > 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public long getLastWriteAccess() {
|
public long getLastWriteAccess() {
|
||||||
return lastWriteAccess;
|
return lastWriteAccess;
|
||||||
}
|
}
|
||||||
|
@ -966,6 +990,7 @@ public class PDOM extends PlatformObject implements IPDOM {
|
||||||
return fLinkageIDCache.get(linkage.getLinkageID());
|
return fLinkageIDCache.get(linkage.getLinkageID());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexFragmentBinding adaptBinding(IBinding binding) throws CoreException {
|
public IIndexFragmentBinding adaptBinding(IBinding binding) throws CoreException {
|
||||||
if (binding == null) {
|
if (binding == null) {
|
||||||
return null;
|
return null;
|
||||||
|
@ -997,6 +1022,7 @@ public class PDOM extends PlatformObject implements IPDOM {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexFragmentName[] findNames(IBinding binding, int options) throws CoreException {
|
public IIndexFragmentName[] findNames(IBinding binding, int options) throws CoreException {
|
||||||
ArrayList<IIndexFragmentName> names= new ArrayList<IIndexFragmentName>();
|
ArrayList<IIndexFragmentName> names= new ArrayList<IIndexFragmentName>();
|
||||||
IIndexFragmentBinding myBinding= adaptBinding(binding);
|
IIndexFragmentBinding myBinding= adaptBinding(binding);
|
||||||
|
@ -1079,6 +1105,7 @@ public class PDOM extends PlatformObject implements IPDOM {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexFragmentInclude[] findIncludedBy(IIndexFragmentFile file) throws CoreException {
|
public IIndexFragmentInclude[] findIncludedBy(IIndexFragmentFile file) throws CoreException {
|
||||||
PDOMFile pdomFile= adaptFile(file);
|
PDOMFile pdomFile= adaptFile(file);
|
||||||
if (pdomFile != null) {
|
if (pdomFile != null) {
|
||||||
|
@ -1105,6 +1132,7 @@ public class PDOM extends PlatformObject implements IPDOM {
|
||||||
return fPath;
|
return fPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexFragmentBinding[] findBindingsForPrefix(char[] prefix, boolean filescope, IndexFilter filter, IProgressMonitor monitor) throws CoreException {
|
public IIndexFragmentBinding[] findBindingsForPrefix(char[] prefix, boolean filescope, IndexFilter filter, IProgressMonitor monitor) throws CoreException {
|
||||||
return findBindingsForPrefix(prefix, filescope, false, filter, monitor);
|
return findBindingsForPrefix(prefix, filescope, false, filter, monitor);
|
||||||
}
|
}
|
||||||
|
@ -1113,6 +1141,7 @@ public class PDOM extends PlatformObject implements IPDOM {
|
||||||
return findBindingsForPrefixOrContentAssist(prefix, filescope, false, caseSensitive, filter, monitor);
|
return findBindingsForPrefixOrContentAssist(prefix, filescope, false, caseSensitive, filter, monitor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexFragmentBinding[] findBindingsForContentAssist(char[] prefix, boolean filescope, IndexFilter filter, IProgressMonitor monitor) throws CoreException {
|
public IIndexFragmentBinding[] findBindingsForContentAssist(char[] prefix, boolean filescope, IndexFilter filter, IProgressMonitor monitor) throws CoreException {
|
||||||
return findBindingsForPrefixOrContentAssist(prefix, filescope, true, false, filter, monitor);
|
return findBindingsForPrefixOrContentAssist(prefix, filescope, true, false, filter, monitor);
|
||||||
}
|
}
|
||||||
|
@ -1143,11 +1172,14 @@ public class PDOM extends PlatformObject implements IPDOM {
|
||||||
return result.toArray(new IIndexFragmentBinding[result.size()]);
|
return result.toArray(new IIndexFragmentBinding[result.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IIndexFragmentBinding[] findBindings(char[] name, boolean filescope, IndexFilter filter, IProgressMonitor monitor) throws CoreException {
|
@Override
|
||||||
|
public IIndexFragmentBinding[] findBindings(char[] name, boolean filescope, IndexFilter filter,
|
||||||
|
IProgressMonitor monitor) throws CoreException {
|
||||||
return findBindings(name, filescope, true, filter, monitor);
|
return findBindings(name, filescope, true, filter, monitor);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IIndexFragmentBinding[] findBindings(char[] name, boolean filescope, boolean isCaseSensitive, IndexFilter filter, IProgressMonitor monitor) throws CoreException {
|
public IIndexFragmentBinding[] findBindings(char[] name, boolean filescope,
|
||||||
|
boolean isCaseSensitive, IndexFilter filter, IProgressMonitor monitor) throws CoreException {
|
||||||
ArrayList<IIndexFragmentBinding> result= new ArrayList<IIndexFragmentBinding>();
|
ArrayList<IIndexFragmentBinding> result= new ArrayList<IIndexFragmentBinding>();
|
||||||
try {
|
try {
|
||||||
for (PDOMLinkage linkage : getLinkageList()) {
|
for (PDOMLinkage linkage : getLinkageList()) {
|
||||||
|
@ -1203,7 +1235,9 @@ public class PDOM extends PlatformObject implements IPDOM {
|
||||||
return result.toArray(new IIndexFragmentBinding[result.size()]);
|
return result.toArray(new IIndexFragmentBinding[result.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IIndexMacro[] findMacros(char[] prefix, boolean isPrefix, boolean isCaseSensitive, IndexFilter filter, IProgressMonitor monitor) throws CoreException {
|
@Override
|
||||||
|
public IIndexMacro[] findMacros(char[] prefix, boolean isPrefix, boolean isCaseSensitive,
|
||||||
|
IndexFilter filter, IProgressMonitor monitor) throws CoreException {
|
||||||
ArrayList<IIndexMacro> result= new ArrayList<IIndexMacro>();
|
ArrayList<IIndexMacro> result= new ArrayList<IIndexMacro>();
|
||||||
try {
|
try {
|
||||||
for (PDOMLinkage linkage : getLinkageList()) {
|
for (PDOMLinkage linkage : getLinkageList()) {
|
||||||
|
@ -1221,6 +1255,7 @@ public class PDOM extends PlatformObject implements IPDOM {
|
||||||
return result.toArray(new IIndexMacro[result.size()]);
|
return result.toArray(new IIndexMacro[result.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getProperty(String propertyName) throws CoreException {
|
public String getProperty(String propertyName) throws CoreException {
|
||||||
if (IIndexFragment.PROPERTY_FRAGMENT_FORMAT_ID.equals(propertyName)) {
|
if (IIndexFragment.PROPERTY_FRAGMENT_FORMAT_ID.equals(propertyName)) {
|
||||||
return FRAGMENT_PROPERTY_VALUE_FORMAT_ID;
|
return FRAGMENT_PROPERTY_VALUE_FORMAT_ID;
|
||||||
|
@ -1250,20 +1285,24 @@ public class PDOM extends PlatformObject implements IPDOM {
|
||||||
clearResultCache();
|
clearResultCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void clearResultCache() {
|
public void clearResultCache() {
|
||||||
synchronized (fResultCache) {
|
synchronized (fResultCache) {
|
||||||
fResultCache.clear();
|
fResultCache.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public long getCacheHits() {
|
public long getCacheHits() {
|
||||||
return db.getCacheHits();
|
return db.getCacheHits();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public long getCacheMisses() {
|
public long getCacheMisses() {
|
||||||
return db.getCacheMisses();
|
return db.getCacheMisses();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void resetCacheCounters() {
|
public void resetCacheCounters() {
|
||||||
db.resetCacheCounters();
|
db.resetCacheCounters();
|
||||||
}
|
}
|
||||||
|
@ -1272,6 +1311,7 @@ public class PDOM extends PlatformObject implements IPDOM {
|
||||||
db.flush();
|
db.flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object getCachedResult(Object key) {
|
public Object getCachedResult(Object key) {
|
||||||
synchronized (fResultCache) {
|
synchronized (fResultCache) {
|
||||||
return fResultCache.get(key);
|
return fResultCache.get(key);
|
||||||
|
@ -1282,6 +1322,7 @@ public class PDOM extends PlatformObject implements IPDOM {
|
||||||
putCachedResult(key, result, true);
|
putCachedResult(key, result, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object putCachedResult(Object key, Object result, boolean replace) {
|
public Object putCachedResult(Object key, Object result, boolean replace) {
|
||||||
synchronized (fResultCache) {
|
synchronized (fResultCache) {
|
||||||
Object old= fResultCache.put(key, result);
|
Object old= fResultCache.put(key, result);
|
||||||
|
@ -1445,6 +1486,7 @@ public class PDOM extends PlatformObject implements IPDOM {
|
||||||
return PDOMBinding.EMPTY_PDOMBINDING_ARRAY;
|
return PDOMBinding.EMPTY_PDOMBINDING_ARRAY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexFragmentFileSet createFileSet() {
|
public IIndexFragmentFileSet createFileSet() {
|
||||||
return new PDOMFileSet();
|
return new PDOMFileSet();
|
||||||
}
|
}
|
||||||
|
@ -1589,6 +1631,7 @@ public class PDOM extends PlatformObject implements IPDOM {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexScope[] getInlineNamespaces() throws CoreException {
|
public IIndexScope[] getInlineNamespaces() throws CoreException {
|
||||||
PDOMLinkage linkage = getLinkage(ILinkage.CPP_LINKAGE_ID);
|
PDOMLinkage linkage = getLinkage(ILinkage.CPP_LINKAGE_ID);
|
||||||
if (linkage == null) {
|
if (linkage == null) {
|
||||||
|
|
|
@ -20,24 +20,27 @@ import org.eclipse.cdt.internal.core.pdom.dom.PDOMFile;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
|
|
||||||
public class PDOMFileSet implements IIndexFragmentFileSet {
|
public class PDOMFileSet implements IIndexFragmentFileSet {
|
||||||
|
|
||||||
private HashSet<Long> fFileIDs= new HashSet<Long>();
|
private HashSet<Long> fFileIDs= new HashSet<Long>();
|
||||||
|
|
||||||
|
@Override
|
||||||
public void add(IIndexFragmentFile fragFile) {
|
public void add(IIndexFragmentFile fragFile) {
|
||||||
PDOMFile pdomFile= (PDOMFile) fragFile;
|
PDOMFile pdomFile= (PDOMFile) fragFile;
|
||||||
fFileIDs.add(pdomFile.getRecord());
|
fFileIDs.add(pdomFile.getRecord());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void remove(IIndexFragmentFile fragFile) {
|
public void remove(IIndexFragmentFile fragFile) {
|
||||||
PDOMFile pdomFile= (PDOMFile) fragFile;
|
PDOMFile pdomFile= (PDOMFile) fragFile;
|
||||||
fFileIDs.remove(pdomFile.getRecord());
|
fFileIDs.remove(pdomFile.getRecord());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean containsFileOfLocalBinding(IIndexFragmentBinding fb) throws CoreException {
|
public boolean containsFileOfLocalBinding(IIndexFragmentBinding fb) throws CoreException {
|
||||||
PDOMBinding pdomBinding= (PDOMBinding) fb;
|
PDOMBinding pdomBinding= (PDOMBinding) fb;
|
||||||
return fFileIDs.contains(pdomBinding.getLocalToFileRec());
|
return fFileIDs.contains(pdomBinding.getLocalToFileRec());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean contains(IIndexFragmentFile file) throws CoreException {
|
public boolean contains(IIndexFragmentFile file) throws CoreException {
|
||||||
if (file instanceof PDOMFile) {
|
if (file instanceof PDOMFile) {
|
||||||
return fFileIDs.contains(((PDOMFile) file).getRecord());
|
return fFileIDs.contains(((PDOMFile) file).getRecord());
|
||||||
|
|
|
@ -122,6 +122,8 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
||||||
public PCL(ICProject prj) {
|
public PCL(ICProject prj) {
|
||||||
fProject= prj;
|
fProject= prj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void preferenceChange(PreferenceChangeEvent event) {
|
public void preferenceChange(PreferenceChangeEvent event) {
|
||||||
if (fProject.getProject().isOpen()) {
|
if (fProject.getProject().isOpen()) {
|
||||||
onPreferenceChange(fProject, event);
|
onPreferenceChange(fProject, event);
|
||||||
|
@ -191,6 +193,7 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
||||||
fProjectDescriptionListener= new CProjectDescriptionListener(this);
|
fProjectDescriptionListener= new CProjectDescriptionListener(this);
|
||||||
fJobChangeListener= new JobChangeListener(this);
|
fJobChangeListener= new JobChangeListener(this);
|
||||||
fPreferenceChangeListener= new IPreferenceChangeListener() {
|
fPreferenceChangeListener= new IPreferenceChangeListener() {
|
||||||
|
@Override
|
||||||
public void preferenceChange(PreferenceChangeEvent event) {
|
public void preferenceChange(PreferenceChangeEvent event) {
|
||||||
onPreferenceChange(event);
|
onPreferenceChange(event);
|
||||||
}
|
}
|
||||||
|
@ -422,19 +425,23 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
||||||
return project.getElementName() + "." + time + ".pdom"; //$NON-NLS-1$//$NON-NLS-2$
|
return project.getElementName() + "." + time + ".pdom"; //$NON-NLS-1$//$NON-NLS-2$
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getDefaultIndexerId() {
|
public String getDefaultIndexerId() {
|
||||||
return getIndexerId(null);
|
return getIndexerId(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setDefaultIndexerId(String indexerId) {
|
public void setDefaultIndexerId(String indexerId) {
|
||||||
IndexerPreferences.setDefaultIndexerId(indexerId);
|
IndexerPreferences.setDefaultIndexerId(indexerId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String getIndexerId(ICProject project) {
|
public String getIndexerId(ICProject project) {
|
||||||
IProject prj= project != null ? project.getProject() : null;
|
IProject prj= project != null ? project.getProject() : null;
|
||||||
return IndexerPreferences.get(prj, IndexerPreferences.KEY_INDEXER_ID, IPDOMManager.ID_NO_INDEXER);
|
return IndexerPreferences.get(prj, IndexerPreferences.KEY_INDEXER_ID, IPDOMManager.ID_NO_INDEXER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void setIndexerId(final ICProject project, String indexerId) {
|
public void setIndexerId(final ICProject project, String indexerId) {
|
||||||
IProject prj= project.getProject();
|
IProject prj= project.getProject();
|
||||||
IndexerPreferences.set(prj, IndexerPreferences.KEY_INDEXER_ID, indexerId);
|
IndexerPreferences.set(prj, IndexerPreferences.KEY_INDEXER_ID, indexerId);
|
||||||
|
@ -733,6 +740,7 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isIndexerIdle() {
|
public boolean isIndexerIdle() {
|
||||||
return Job.getJobManager().find(this).length == 0;
|
return Job.getJobManager().find(this).length == 0;
|
||||||
}
|
}
|
||||||
|
@ -944,6 +952,7 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void reindex(final ICProject project) {
|
public void reindex(final ICProject project) {
|
||||||
Job job= new Job(Messages.PDOMManager_notifyJob_label) {
|
Job job= new Job(Messages.PDOMManager_notifyJob_label) {
|
||||||
@Override
|
@Override
|
||||||
|
@ -977,18 +986,22 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
||||||
job.schedule();
|
job.schedule();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void addIndexChangeListener(IIndexChangeListener listener) {
|
public void addIndexChangeListener(IIndexChangeListener listener) {
|
||||||
fChangeListeners.add(listener);
|
fChangeListeners.add(listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void removeIndexChangeListener(IIndexChangeListener listener) {
|
public void removeIndexChangeListener(IIndexChangeListener listener) {
|
||||||
fChangeListeners.remove(listener);
|
fChangeListeners.remove(listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void addIndexerStateListener(IIndexerStateListener listener) {
|
public void addIndexerStateListener(IIndexerStateListener listener) {
|
||||||
fStateListeners.add(listener);
|
fStateListeners.add(listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void removeIndexerStateListener(IIndexerStateListener listener) {
|
public void removeIndexerStateListener(IIndexerStateListener listener) {
|
||||||
fStateListeners.remove(listener);
|
fStateListeners.remove(listener);
|
||||||
}
|
}
|
||||||
|
@ -1034,15 +1047,18 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Runnable notify= new Runnable() {
|
Runnable notify= new Runnable() {
|
||||||
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
fIndexerStateEvent.setState(state);
|
fIndexerStateEvent.setState(state);
|
||||||
Object[] listeners= fStateListeners.getListeners();
|
Object[] listeners= fStateListeners.getListeners();
|
||||||
for (Object listener2 : listeners) {
|
for (Object listener2 : listeners) {
|
||||||
final IIndexerStateListener listener = (IIndexerStateListener) listener2;
|
final IIndexerStateListener listener = (IIndexerStateListener) listener2;
|
||||||
SafeRunner.run(new ISafeRunnable(){
|
SafeRunner.run(new ISafeRunnable(){
|
||||||
|
@Override
|
||||||
public void handleException(Throwable exception) {
|
public void handleException(Throwable exception) {
|
||||||
CCorePlugin.log(exception);
|
CCorePlugin.log(exception);
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public void run() throws Exception {
|
public void run() throws Exception {
|
||||||
listener.indexChanged(fIndexerStateEvent);
|
listener.indexChanged(fIndexerStateEvent);
|
||||||
}
|
}
|
||||||
|
@ -1054,6 +1070,7 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void handleChange(PDOM pdom, final PDOM.ChangeEvent e) {
|
public void handleChange(PDOM pdom, final PDOM.ChangeEvent e) {
|
||||||
if (fChangeListeners.isEmpty()) {
|
if (fChangeListeners.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
|
@ -1067,15 +1084,18 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
||||||
if (project != null) {
|
if (project != null) {
|
||||||
final ICProject finalProject= project;
|
final ICProject finalProject= project;
|
||||||
Runnable notify= new Runnable() {
|
Runnable notify= new Runnable() {
|
||||||
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
fIndexChangeEvent.setAffectedProject(finalProject, e);
|
fIndexChangeEvent.setAffectedProject(finalProject, e);
|
||||||
Object[] listeners= fChangeListeners.getListeners();
|
Object[] listeners= fChangeListeners.getListeners();
|
||||||
for (Object listener2 : listeners) {
|
for (Object listener2 : listeners) {
|
||||||
final IIndexChangeListener listener = (IIndexChangeListener) listener2;
|
final IIndexChangeListener listener = (IIndexChangeListener) listener2;
|
||||||
SafeRunner.run(new ISafeRunnable(){
|
SafeRunner.run(new ISafeRunnable(){
|
||||||
|
@Override
|
||||||
public void handleException(Throwable exception) {
|
public void handleException(Throwable exception) {
|
||||||
CCorePlugin.log(exception);
|
CCorePlugin.log(exception);
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public void run() throws Exception {
|
public void run() throws Exception {
|
||||||
listener.indexChanged(fIndexChangeEvent);
|
listener.indexChanged(fIndexChangeEvent);
|
||||||
}
|
}
|
||||||
|
@ -1087,6 +1107,7 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean joinIndexer(final int waitMaxMillis, final IProgressMonitor monitor) {
|
public boolean joinIndexer(final int waitMaxMillis, final IProgressMonitor monitor) {
|
||||||
assert monitor != null;
|
assert monitor != null;
|
||||||
Thread th= null;
|
Thread th= null;
|
||||||
|
@ -1169,22 +1190,27 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
||||||
return currentTicks;
|
return currentTicks;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IWritableIndex getWritableIndex(ICProject project) throws CoreException {
|
public IWritableIndex getWritableIndex(ICProject project) throws CoreException {
|
||||||
return fIndexFactory.getWritableIndex(project);
|
return fIndexFactory.getWritableIndex(project);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndex getIndex(ICProject project) throws CoreException {
|
public IIndex getIndex(ICProject project) throws CoreException {
|
||||||
return fIndexFactory.getIndex(new ICProject[] {project}, 0);
|
return fIndexFactory.getIndex(new ICProject[] {project}, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndex getIndex(ICProject[] projects) throws CoreException {
|
public IIndex getIndex(ICProject[] projects) throws CoreException {
|
||||||
return fIndexFactory.getIndex(projects, 0);
|
return fIndexFactory.getIndex(projects, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndex getIndex(ICProject project, int options) throws CoreException {
|
public IIndex getIndex(ICProject project, int options) throws CoreException {
|
||||||
return fIndexFactory.getIndex(new ICProject[] {project}, options);
|
return fIndexFactory.getIndex(new ICProject[] {project}, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndex getIndex(ICProject[] projects, int options) throws CoreException {
|
public IIndex getIndex(ICProject[] projects, int options) throws CoreException {
|
||||||
return fIndexFactory.getIndex(projects, options);
|
return fIndexFactory.getIndex(projects, options);
|
||||||
}
|
}
|
||||||
|
@ -1294,6 +1320,7 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
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 {
|
||||||
TeamPDOMExportOperation operation= new TeamPDOMExportOperation(project);
|
TeamPDOMExportOperation operation= new TeamPDOMExportOperation(project);
|
||||||
operation.setTargetLocation(location);
|
operation.setTargetLocation(location);
|
||||||
|
@ -1313,16 +1340,19 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
||||||
pdom.setProperty(IIndexFragment.PROPERTY_FRAGMENT_ID, id);
|
pdom.setProperty(IIndexFragment.PROPERTY_FRAGMENT_ID, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isProjectIndexed(ICProject proj) {
|
public boolean isProjectIndexed(ICProject proj) {
|
||||||
return !IPDOMManager.ID_NO_INDEXER.equals(getIndexerId(proj));
|
return !IPDOMManager.ID_NO_INDEXER.equals(getIndexerId(proj));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean isIndexerSetupPostponed(ICProject proj) {
|
public boolean isIndexerSetupPostponed(ICProject proj) {
|
||||||
synchronized (fSetupParticipants) {
|
synchronized (fSetupParticipants) {
|
||||||
return fPostponedProjects.contains(proj);
|
return fPostponedProjects.contains(proj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void update(ICElement[] tuSelection, int options) throws CoreException {
|
public void update(ICElement[] tuSelection, int options) throws CoreException {
|
||||||
Map<ICProject, List<ICElement>> projectsToElements= splitSelection(tuSelection);
|
Map<ICProject, List<ICElement>> projectsToElements= splitSelection(tuSelection);
|
||||||
for (Map.Entry<ICProject, List<ICElement>> entry : projectsToElements.entrySet()) {
|
for (Map.Entry<ICProject, List<ICElement>> entry : projectsToElements.entrySet()) {
|
||||||
|
@ -1427,12 +1457,15 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
||||||
fPostponedProjects.remove(cproject);
|
fPostponedProjects.remove(cproject);
|
||||||
final IndexerSetupParticipant[] participants= fSetupParticipants.toArray(new IndexerSetupParticipant[fSetupParticipants.size()]);
|
final IndexerSetupParticipant[] participants= fSetupParticipants.toArray(new IndexerSetupParticipant[fSetupParticipants.size()]);
|
||||||
Runnable notify= new Runnable() {
|
Runnable notify= new Runnable() {
|
||||||
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
for (final IndexerSetupParticipant p : participants) {
|
for (final IndexerSetupParticipant p : participants) {
|
||||||
SafeRunner.run(new ISafeRunnable(){
|
SafeRunner.run(new ISafeRunnable(){
|
||||||
|
@Override
|
||||||
public void handleException(Throwable exception) {
|
public void handleException(Throwable exception) {
|
||||||
CCorePlugin.log(exception);
|
CCorePlugin.log(exception);
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public void run() throws Exception {
|
public void run() throws Exception {
|
||||||
p.onIndexerSetup(cproject);
|
p.onIndexerSetup(cproject);
|
||||||
}
|
}
|
||||||
|
@ -1459,12 +1492,14 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void addIndexerSetupParticipant(IndexerSetupParticipant participant) {
|
public void addIndexerSetupParticipant(IndexerSetupParticipant participant) {
|
||||||
synchronized (fSetupParticipants) {
|
synchronized (fSetupParticipants) {
|
||||||
fSetupParticipants.add(participant);
|
fSetupParticipants.add(participant);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void removeIndexerSetupParticipant(IndexerSetupParticipant participant) {
|
public void removeIndexerSetupParticipant(IndexerSetupParticipant participant) {
|
||||||
synchronized (fSetupParticipants) {
|
synchronized (fSetupParticipants) {
|
||||||
fSetupParticipants.remove(participant);
|
fSetupParticipants.remove(participant);
|
||||||
|
|
|
@ -55,6 +55,7 @@ public class PDOMProxy implements IPDOM {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public synchronized void acquireReadLock() throws InterruptedException {
|
public synchronized void acquireReadLock() throws InterruptedException {
|
||||||
if (fDelegate != null) {
|
if (fDelegate != null) {
|
||||||
fDelegate.acquireReadLock();
|
fDelegate.acquireReadLock();
|
||||||
|
@ -66,6 +67,7 @@ public class PDOMProxy implements IPDOM {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexMacro[] findMacros(char[] name, boolean isPrefix, boolean caseSensitive,
|
public IIndexMacro[] findMacros(char[] name, boolean isPrefix, boolean caseSensitive,
|
||||||
IndexFilter filter, IProgressMonitor monitor) throws CoreException {
|
IndexFilter filter, IProgressMonitor monitor) throws CoreException {
|
||||||
if (fDelegate != null)
|
if (fDelegate != null)
|
||||||
|
@ -73,18 +75,21 @@ public class PDOMProxy implements IPDOM {
|
||||||
return IIndexMacro.EMPTY_INDEX_MACRO_ARRAY;
|
return IIndexMacro.EMPTY_INDEX_MACRO_ARRAY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public synchronized IIndexFragmentBinding adaptBinding(IBinding binding) throws CoreException {
|
public synchronized IIndexFragmentBinding adaptBinding(IBinding binding) throws CoreException {
|
||||||
if (fDelegate != null)
|
if (fDelegate != null)
|
||||||
return fDelegate.adaptBinding(binding);
|
return fDelegate.adaptBinding(binding);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public synchronized IIndexFragmentBinding findBinding(IASTName astName) throws CoreException {
|
public synchronized IIndexFragmentBinding findBinding(IASTName astName) throws CoreException {
|
||||||
if (fDelegate != null)
|
if (fDelegate != null)
|
||||||
return fDelegate.findBinding(astName);
|
return fDelegate.findBinding(astName);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public synchronized IIndexFragmentBinding[] findBindings(char[][] names, IndexFilter filter,
|
public synchronized IIndexFragmentBinding[] findBindings(char[][] names, IndexFilter filter,
|
||||||
IProgressMonitor monitor) throws CoreException {
|
IProgressMonitor monitor) throws CoreException {
|
||||||
if (fDelegate != null)
|
if (fDelegate != null)
|
||||||
|
@ -93,6 +98,7 @@ public class PDOMProxy implements IPDOM {
|
||||||
return IIndexFragmentBinding.EMPTY_INDEX_BINDING_ARRAY;
|
return IIndexFragmentBinding.EMPTY_INDEX_BINDING_ARRAY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public synchronized IIndexFragmentBinding[] findBindings(Pattern[] patterns, boolean isFullyQualified,
|
public synchronized IIndexFragmentBinding[] findBindings(Pattern[] patterns, boolean isFullyQualified,
|
||||||
IndexFilter filter, IProgressMonitor monitor) throws CoreException {
|
IndexFilter filter, IProgressMonitor monitor) throws CoreException {
|
||||||
if (fDelegate != null)
|
if (fDelegate != null)
|
||||||
|
@ -101,6 +107,7 @@ public class PDOMProxy implements IPDOM {
|
||||||
return IIndexFragmentBinding.EMPTY_INDEX_BINDING_ARRAY;
|
return IIndexFragmentBinding.EMPTY_INDEX_BINDING_ARRAY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public synchronized IIndexFragmentBinding[] findBindings(char[] name, boolean filescope,
|
public synchronized IIndexFragmentBinding[] findBindings(char[] name, boolean filescope,
|
||||||
IndexFilter filter, IProgressMonitor monitor) throws CoreException {
|
IndexFilter filter, IProgressMonitor monitor) throws CoreException {
|
||||||
if (fDelegate != null)
|
if (fDelegate != null)
|
||||||
|
@ -109,6 +116,7 @@ public class PDOMProxy implements IPDOM {
|
||||||
return IIndexFragmentBinding.EMPTY_INDEX_BINDING_ARRAY;
|
return IIndexFragmentBinding.EMPTY_INDEX_BINDING_ARRAY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public synchronized IIndexFragmentBinding[] findBindingsForPrefix(char[] prefix, boolean filescope,
|
public synchronized IIndexFragmentBinding[] findBindingsForPrefix(char[] prefix, boolean filescope,
|
||||||
IndexFilter filter, IProgressMonitor monitor) throws CoreException {
|
IndexFilter filter, IProgressMonitor monitor) throws CoreException {
|
||||||
if (fDelegate != null)
|
if (fDelegate != null)
|
||||||
|
@ -117,6 +125,7 @@ public class PDOMProxy implements IPDOM {
|
||||||
return IIndexFragmentBinding.EMPTY_INDEX_BINDING_ARRAY;
|
return IIndexFragmentBinding.EMPTY_INDEX_BINDING_ARRAY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public synchronized IIndexFragmentBinding[] findBindingsForContentAssist(char[] prefix, boolean filescope,
|
public synchronized IIndexFragmentBinding[] findBindingsForContentAssist(char[] prefix, boolean filescope,
|
||||||
IndexFilter filter, IProgressMonitor monitor) throws CoreException {
|
IndexFilter filter, IProgressMonitor monitor) throws CoreException {
|
||||||
if (fDelegate != null)
|
if (fDelegate != null)
|
||||||
|
@ -125,6 +134,7 @@ public class PDOMProxy implements IPDOM {
|
||||||
return IIndexFragmentBinding.EMPTY_INDEX_BINDING_ARRAY;
|
return IIndexFragmentBinding.EMPTY_INDEX_BINDING_ARRAY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public synchronized IIndexFragmentInclude[] findIncludedBy(IIndexFragmentFile file) throws CoreException {
|
public synchronized IIndexFragmentInclude[] findIncludedBy(IIndexFragmentFile file) throws CoreException {
|
||||||
if (fDelegate != null)
|
if (fDelegate != null)
|
||||||
return fDelegate.findIncludedBy(file);
|
return fDelegate.findIncludedBy(file);
|
||||||
|
@ -132,6 +142,7 @@ public class PDOMProxy implements IPDOM {
|
||||||
return new IIndexFragmentInclude[0];
|
return new IIndexFragmentInclude[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public synchronized IIndexFragmentName[] findNames(IBinding binding, int flags)
|
public synchronized IIndexFragmentName[] findNames(IBinding binding, int flags)
|
||||||
throws CoreException {
|
throws CoreException {
|
||||||
if (fDelegate != null)
|
if (fDelegate != null)
|
||||||
|
@ -140,6 +151,7 @@ public class PDOMProxy implements IPDOM {
|
||||||
return IIndexFragmentName.EMPTY_NAME_ARRAY;
|
return IIndexFragmentName.EMPTY_NAME_ARRAY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public synchronized long getCacheHits() {
|
public synchronized long getCacheHits() {
|
||||||
if (fDelegate != null)
|
if (fDelegate != null)
|
||||||
return fDelegate.getCacheHits();
|
return fDelegate.getCacheHits();
|
||||||
|
@ -147,6 +159,7 @@ public class PDOMProxy implements IPDOM {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public synchronized long getCacheMisses() {
|
public synchronized long getCacheMisses() {
|
||||||
if (fDelegate != null)
|
if (fDelegate != null)
|
||||||
return fDelegate.getCacheMisses();
|
return fDelegate.getCacheMisses();
|
||||||
|
@ -155,6 +168,7 @@ public class PDOMProxy implements IPDOM {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
|
@Override
|
||||||
public synchronized IIndexFragmentFile getFile(int linkageID, IIndexFileLocation location) throws CoreException {
|
public synchronized IIndexFragmentFile getFile(int linkageID, IIndexFileLocation location) throws CoreException {
|
||||||
if (fDelegate != null)
|
if (fDelegate != null)
|
||||||
return fDelegate.getFile(linkageID, location);
|
return fDelegate.getFile(linkageID, location);
|
||||||
|
@ -162,6 +176,7 @@ public class PDOMProxy implements IPDOM {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexFragmentFile getFile(int linkageID, IIndexFileLocation location,
|
public IIndexFragmentFile getFile(int linkageID, IIndexFileLocation location,
|
||||||
ISignificantMacros sigMacros) throws CoreException {
|
ISignificantMacros sigMacros) throws CoreException {
|
||||||
if (fDelegate != null)
|
if (fDelegate != null)
|
||||||
|
@ -170,6 +185,7 @@ public class PDOMProxy implements IPDOM {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexFragmentFile[] getFiles(int linkageID, IIndexFileLocation location)
|
public IIndexFragmentFile[] getFiles(int linkageID, IIndexFileLocation location)
|
||||||
throws CoreException {
|
throws CoreException {
|
||||||
if (fDelegate != null)
|
if (fDelegate != null)
|
||||||
|
@ -178,6 +194,7 @@ public class PDOMProxy implements IPDOM {
|
||||||
return IIndexFragmentFile.EMPTY_ARRAY;
|
return IIndexFragmentFile.EMPTY_ARRAY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public synchronized IIndexFragmentFile[] getFiles(IIndexFileLocation location) throws CoreException {
|
public synchronized IIndexFragmentFile[] getFiles(IIndexFileLocation location) throws CoreException {
|
||||||
if (fDelegate != null)
|
if (fDelegate != null)
|
||||||
return fDelegate.getFiles(location);
|
return fDelegate.getFiles(location);
|
||||||
|
@ -185,6 +202,7 @@ public class PDOMProxy implements IPDOM {
|
||||||
return IIndexFragmentFile.EMPTY_ARRAY;
|
return IIndexFragmentFile.EMPTY_ARRAY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public synchronized long getLastWriteAccess() {
|
public synchronized long getLastWriteAccess() {
|
||||||
if (fDelegate != null)
|
if (fDelegate != null)
|
||||||
return fDelegate.getLastWriteAccess();
|
return fDelegate.getLastWriteAccess();
|
||||||
|
@ -192,6 +210,7 @@ public class PDOMProxy implements IPDOM {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public synchronized IIndexLinkage[] getLinkages() {
|
public synchronized IIndexLinkage[] getLinkages() {
|
||||||
if (fDelegate != null)
|
if (fDelegate != null)
|
||||||
return fDelegate.getLinkages();
|
return fDelegate.getLinkages();
|
||||||
|
@ -199,6 +218,7 @@ public class PDOMProxy implements IPDOM {
|
||||||
return new IIndexLinkage[0];
|
return new IIndexLinkage[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public synchronized String getProperty(String propertyName) throws CoreException {
|
public synchronized String getProperty(String propertyName) throws CoreException {
|
||||||
if (fDelegate != null)
|
if (fDelegate != null)
|
||||||
return fDelegate.getProperty(propertyName);
|
return fDelegate.getProperty(propertyName);
|
||||||
|
@ -206,6 +226,7 @@ public class PDOMProxy implements IPDOM {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public synchronized void releaseReadLock() {
|
public synchronized void releaseReadLock() {
|
||||||
// read-locks not forwarded to delegate need to be released here
|
// read-locks not forwarded to delegate need to be released here
|
||||||
if (fReadLockCount > 0) {
|
if (fReadLockCount > 0) {
|
||||||
|
@ -217,10 +238,12 @@ public class PDOMProxy implements IPDOM {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean hasWaitingReaders() {
|
public boolean hasWaitingReaders() {
|
||||||
return fDelegate != null && fDelegate.hasWaitingReaders();
|
return fDelegate != null && fDelegate.hasWaitingReaders();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public synchronized void resetCacheCounters() {
|
public synchronized void resetCacheCounters() {
|
||||||
if (fDelegate != null)
|
if (fDelegate != null)
|
||||||
fDelegate.resetCacheCounters();
|
fDelegate.resetCacheCounters();
|
||||||
|
@ -234,6 +257,7 @@ public class PDOMProxy implements IPDOM {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public synchronized void addListener(IListener listener) {
|
public synchronized void addListener(IListener listener) {
|
||||||
if (fDelegate != null) {
|
if (fDelegate != null) {
|
||||||
fDelegate.addListener(listener);
|
fDelegate.addListener(listener);
|
||||||
|
@ -242,6 +266,7 @@ public class PDOMProxy implements IPDOM {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public synchronized PDOMLinkage[] getLinkageImpls() {
|
public synchronized PDOMLinkage[] getLinkageImpls() {
|
||||||
if (fDelegate != null)
|
if (fDelegate != null)
|
||||||
return fDelegate.getLinkageImpls();
|
return fDelegate.getLinkageImpls();
|
||||||
|
@ -249,6 +274,7 @@ public class PDOMProxy implements IPDOM {
|
||||||
return new PDOMLinkage[0];
|
return new PDOMLinkage[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public synchronized void removeListener(IListener listener) {
|
public synchronized void removeListener(IListener listener) {
|
||||||
if (fDelegate != null) {
|
if (fDelegate != null) {
|
||||||
fDelegate.removeListener(listener);
|
fDelegate.removeListener(listener);
|
||||||
|
@ -280,19 +306,19 @@ public class PDOMProxy implements IPDOM {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexFragmentFileSet createFileSet() {
|
public IIndexFragmentFileSet createFileSet() {
|
||||||
return new PDOMFileSet();
|
return new PDOMFileSet();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public synchronized IIndexFragmentFile[] getAllFiles() throws CoreException {
|
public synchronized IIndexFragmentFile[] getAllFiles() throws CoreException {
|
||||||
if (fDelegate != null)
|
if (fDelegate != null)
|
||||||
return fDelegate.getAllFiles();
|
return fDelegate.getAllFiles();
|
||||||
return IIndexFragmentFile.EMPTY_ARRAY;
|
return IIndexFragmentFile.EMPTY_ARRAY;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
@Override
|
||||||
* @see org.eclipse.cdt.internal.core.index.IIndexFragment#findMacroContainers(java.util.regex.Pattern, org.eclipse.cdt.core.index.IndexFilter, org.eclipse.core.runtime.IProgressMonitor)
|
|
||||||
*/
|
|
||||||
public synchronized IIndexFragmentBinding[] findMacroContainers(Pattern pattern, IndexFilter filter,
|
public synchronized IIndexFragmentBinding[] findMacroContainers(Pattern pattern, IndexFilter filter,
|
||||||
IProgressMonitor monitor) throws CoreException {
|
IProgressMonitor monitor) throws CoreException {
|
||||||
if (fDelegate != null) {
|
if (fDelegate != null) {
|
||||||
|
@ -301,19 +327,23 @@ public class PDOMProxy implements IPDOM {
|
||||||
return IIndexFragmentBinding.EMPTY_INDEX_BINDING_ARRAY;
|
return IIndexFragmentBinding.EMPTY_INDEX_BINDING_ARRAY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object getCachedResult(Object key) {
|
public Object getCachedResult(Object key) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object putCachedResult(Object key, Object value, boolean replace) {
|
public Object putCachedResult(Object key, Object value, boolean replace) {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void clearResultCache() {
|
public void clearResultCache() {
|
||||||
if (fDelegate != null)
|
if (fDelegate != null)
|
||||||
fDelegate.clearResultCache();
|
fDelegate.clearResultCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexScope[] getInlineNamespaces() throws CoreException {
|
public IIndexScope[] getInlineNamespaces() throws CoreException {
|
||||||
if (fDelegate != null)
|
if (fDelegate != null)
|
||||||
return fDelegate.getInlineNamespaces();
|
return fDelegate.getInlineNamespaces();
|
||||||
|
|
|
@ -50,7 +50,6 @@ import org.eclipse.core.runtime.Path;
|
||||||
import org.eclipse.core.runtime.SubProgressMonitor;
|
import org.eclipse.core.runtime.SubProgressMonitor;
|
||||||
|
|
||||||
public class TeamPDOMExportOperation implements IWorkspaceRunnable {
|
public class TeamPDOMExportOperation implements IWorkspaceRunnable {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Option constant (value:1) to indicate that a resource snapshot
|
* Option constant (value:1) to indicate that a resource snapshot
|
||||||
* should be saved along with the exported PDOM.
|
* should be saved along with the exported PDOM.
|
||||||
|
@ -84,6 +83,7 @@ public class TeamPDOMExportOperation implements IWorkspaceRunnable {
|
||||||
fMessageDigest= md;
|
fMessageDigest= md;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void run(IProgressMonitor monitor) throws CoreException {
|
public void run(IProgressMonitor monitor) throws CoreException {
|
||||||
getMessageDigest();
|
getMessageDigest();
|
||||||
getTargetLocation();
|
getTargetLocation();
|
||||||
|
|
|
@ -82,6 +82,7 @@ public class TeamPDOMImportOperation implements IWorkspaceRunnable {
|
||||||
fShowActivity= PDOMIndexerTask.checkDebugOption(IPDOMIndexerTask.TRACE_ACTIVITY, "true"); //$NON-NLS-1$
|
fShowActivity= PDOMIndexerTask.checkDebugOption(IPDOMIndexerTask.TRACE_ACTIVITY, "true"); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void run(IProgressMonitor pm) {
|
public void run(IProgressMonitor pm) {
|
||||||
if (fShowActivity) {
|
if (fShowActivity) {
|
||||||
System.out.println("Indexer: PDOMImporter start"); //$NON-NLS-1$
|
System.out.println("Indexer: PDOMImporter start"); //$NON-NLS-1$
|
||||||
|
|
|
@ -30,13 +30,19 @@ public class WaitForRefreshJobs extends IndexerSetupParticipant {
|
||||||
private Set<Job> fRefreshJobs= Collections.synchronizedSet(new HashSet<Job>());
|
private Set<Job> fRefreshJobs= Collections.synchronizedSet(new HashSet<Job>());
|
||||||
|
|
||||||
private IJobChangeListener fJobListener= new IJobChangeListener() {
|
private IJobChangeListener fJobListener= new IJobChangeListener() {
|
||||||
|
@Override
|
||||||
public void sleeping(IJobChangeEvent event) {}
|
public void sleeping(IJobChangeEvent event) {}
|
||||||
|
@Override
|
||||||
public void scheduled(IJobChangeEvent event) {}
|
public void scheduled(IJobChangeEvent event) {}
|
||||||
|
@Override
|
||||||
public void running(IJobChangeEvent event) {}
|
public void running(IJobChangeEvent event) {}
|
||||||
|
@Override
|
||||||
public void done(IJobChangeEvent event) {
|
public void done(IJobChangeEvent event) {
|
||||||
onJobDone(event.getJob());
|
onJobDone(event.getJob());
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public void awake(IJobChangeEvent event) {}
|
public void awake(IJobChangeEvent event) {}
|
||||||
|
@Override
|
||||||
public void aboutToRun(IJobChangeEvent event) {}
|
public void aboutToRun(IJobChangeEvent event) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -73,6 +73,7 @@ public class WritablePDOM extends PDOM implements IWritableIndexFragment {
|
||||||
return super.addFile(linkageID, location, sigMacros);
|
return super.addFile(linkageID, location, sigMacros);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexFragmentFile addUncommittedFile(int linkageID, IIndexFileLocation location,
|
public IIndexFragmentFile addUncommittedFile(int linkageID, IIndexFileLocation location,
|
||||||
ISignificantMacros significantMacros) throws CoreException {
|
ISignificantMacros significantMacros) throws CoreException {
|
||||||
uncommittedKey = new FileContentKey(linkageID, location, significantMacros);
|
uncommittedKey = new FileContentKey(linkageID, location, significantMacros);
|
||||||
|
@ -82,6 +83,7 @@ public class WritablePDOM extends PDOM implements IWritableIndexFragment {
|
||||||
return uncommittedFile;
|
return uncommittedFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public IIndexFragmentFile commitUncommittedFile() throws CoreException {
|
public IIndexFragmentFile commitUncommittedFile() throws CoreException {
|
||||||
if (uncommittedFile == null)
|
if (uncommittedFile == null)
|
||||||
return null;
|
return null;
|
||||||
|
@ -102,6 +104,7 @@ public class WritablePDOM extends PDOM implements IWritableIndexFragment {
|
||||||
return file;
|
return file;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void clearUncommittedFile() throws CoreException {
|
public void clearUncommittedFile() throws CoreException {
|
||||||
if (uncommittedFile != null) {
|
if (uncommittedFile != null) {
|
||||||
try {
|
try {
|
||||||
|
@ -115,6 +118,7 @@ public class WritablePDOM extends PDOM implements IWritableIndexFragment {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void addFileContent(IIndexFragmentFile sourceFile, IncludeInformation[] includes,
|
public void addFileContent(IIndexFragmentFile sourceFile, IncludeInformation[] includes,
|
||||||
IASTPreprocessorStatement[] macros, IASTName[][] names, ASTFilePathResolver pathResolver,
|
IASTPreprocessorStatement[] macros, IASTName[][] names, ASTFilePathResolver pathResolver,
|
||||||
YieldableIndexLock lock) throws CoreException, InterruptedException {
|
YieldableIndexLock lock) throws CoreException, InterruptedException {
|
||||||
|
@ -139,6 +143,7 @@ public class WritablePDOM extends PDOM implements IWritableIndexFragment {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void clearFile(IIndexFragmentFile file) throws CoreException {
|
public void clearFile(IIndexFragmentFile file) throws CoreException {
|
||||||
assert file.getIndexFragment() == this;
|
assert file.getIndexFragment() == this;
|
||||||
IIndexFileLocation location = file.getLocation();
|
IIndexFileLocation location = file.getLocation();
|
||||||
|
@ -158,10 +163,7 @@ public class WritablePDOM extends PDOM implements IWritableIndexFragment {
|
||||||
super.flush();
|
super.flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
@Override
|
||||||
* (non-Javadoc)
|
|
||||||
* @see org.eclipse.cdt.internal.core.index.IWritableIndexFragment#setProperty(java.lang.String, java.lang.String)
|
|
||||||
*/
|
|
||||||
public void setProperty(String propertyName, String value) throws CoreException {
|
public void setProperty(String propertyName, String value) throws CoreException {
|
||||||
if (IIndexFragment.PROPERTY_FRAGMENT_FORMAT_ID.equals(propertyName)
|
if (IIndexFragment.PROPERTY_FRAGMENT_FORMAT_ID.equals(propertyName)
|
||||||
|| IIndexFragment.PROPERTY_FRAGMENT_FORMAT_VERSION.equals(propertyName)) {
|
|| IIndexFragment.PROPERTY_FRAGMENT_FORMAT_VERSION.equals(propertyName)) {
|
||||||
|
@ -183,9 +185,11 @@ public class WritablePDOM extends PDOM implements IWritableIndexFragment {
|
||||||
public void rewriteLocations(final IIndexLocationConverter newConverter) throws CoreException {
|
public void rewriteLocations(final IIndexLocationConverter newConverter) throws CoreException {
|
||||||
final List<PDOMFile> pdomfiles = new ArrayList<PDOMFile>();
|
final List<PDOMFile> pdomfiles = new ArrayList<PDOMFile>();
|
||||||
getFileIndex().accept(new IBTreeVisitor() {
|
getFileIndex().accept(new IBTreeVisitor() {
|
||||||
|
@Override
|
||||||
public int compare(long record) throws CoreException {
|
public int compare(long record) throws CoreException {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public boolean visit(long record) throws CoreException {
|
public boolean visit(long record) throws CoreException {
|
||||||
PDOMFile file = PDOMFile.recreateFile(WritablePDOM.this, record);
|
PDOMFile file = PDOMFile.recreateFile(WritablePDOM.this, record);
|
||||||
pdomfiles.add(file);
|
pdomfiles.add(file);
|
||||||
|
|
Loading…
Add table
Reference in a new issue