1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Cosmetics.

This commit is contained in:
sprigogin 2011-07-09 12:41:18 -07:00
parent a33ed9c492
commit 78f658d473
4 changed files with 8 additions and 9 deletions

View file

@ -202,7 +202,7 @@ public abstract class AbstractIndexerTask extends PDOMWriter {
fIsFastIndexer= fastIndexer; fIsFastIndexer= fastIndexer;
fFilesToUpdate= filesToUpdate; fFilesToUpdate= filesToUpdate;
Collections.addAll(fFilesToRemove, filesToRemove); Collections.addAll(fFilesToRemove, filesToRemove);
updateRequestedFiles(fFilesToUpdate.length + fFilesToRemove.size()); incrementRequestedFilesCount(fFilesToUpdate.length + fFilesToRemove.size());
fUrgentTasks = new LinkedList<AbstractIndexerTask>(); fUrgentTasks = new LinkedList<AbstractIndexerTask>();
} }
@ -402,7 +402,7 @@ public abstract class AbstractIndexerTask extends PDOMWriter {
fFilesToUpdate = urgentTask.fFilesToUpdate; fFilesToUpdate = urgentTask.fFilesToUpdate;
fForceNumberFiles = urgentTask.fForceNumberFiles; fForceNumberFiles = urgentTask.fForceNumberFiles;
fFilesToRemove = urgentTask.fFilesToRemove; fFilesToRemove = urgentTask.fFilesToRemove;
updateRequestedFiles(fFilesToUpdate.length + fFilesToRemove.size()); incrementRequestedFilesCount(fFilesToUpdate.length + fFilesToRemove.size());
extractFiles(files, indexFilesToRemove, monitor); extractFiles(files, indexFilesToRemove, monitor);
removeFilesInIndex(fFilesToRemove, indexFilesToRemove, monitor); removeFilesInIndex(fFilesToRemove, indexFilesToRemove, monitor);
} }
@ -535,7 +535,7 @@ public abstract class AbstractIndexerTask extends PDOMWriter {
} }
} }
synchronized (this) { synchronized (this) {
updateRequestedFiles(count - fFilesToUpdate.length); incrementRequestedFilesCount(count - fFilesToUpdate.length);
fFilesToUpdate= null; fFilesToUpdate= null;
} }
} }
@ -644,14 +644,14 @@ public abstract class AbstractIndexerTask extends PDOMWriter {
for (IIndexFragmentFile ifile : ifiles) { for (IIndexFragmentFile ifile : ifiles) {
fIndex.clearFile(ifile, null); fIndex.clearFile(ifile, null);
} }
updateRequestedFiles(-1); incrementRequestedFilesCount(-1);
} }
for (IIndexFragmentFile ifile : indexFilesToRemove) { for (IIndexFragmentFile ifile : indexFilesToRemove) {
if (monitor.isCanceled()) { if (monitor.isCanceled()) {
return; return;
} }
fIndex.clearFile(ifile, null); fIndex.clearFile(ifile, null);
updateRequestedFiles(-1); incrementRequestedFilesCount(-1);
} }
} finally { } finally {
fIndex.releaseWriteLock(1); fIndex.releaseWriteLock(1);

View file

@ -531,7 +531,7 @@ abstract public class PDOMWriter {
/** /**
* Updates current progress information with the provided delta. * Updates current progress information with the provided delta.
*/ */
protected final void updateRequestedFiles(int delta) { protected final void incrementRequestedFilesCount(int delta) {
synchronized (fInfo) { synchronized (fInfo) {
fInfo.fRequestedFilesCount += delta; fInfo.fRequestedFilesCount += delta;
} }

View file

@ -52,8 +52,8 @@ public class WritablePDOM extends PDOM implements IWritableIndexFragment {
this(dbPath, locationConverter, ChunkCache.getSharedInstance(), linkageFactoryMappings); this(dbPath, locationConverter, ChunkCache.getSharedInstance(), linkageFactoryMappings);
} }
public WritablePDOM(File dbPath, IIndexLocationConverter locationConverter, ChunkCache cache, Map<String, public WritablePDOM(File dbPath, IIndexLocationConverter locationConverter, ChunkCache cache,
IPDOMLinkageFactory> linkageFactoryMappings) throws CoreException { Map<String, IPDOMLinkageFactory> linkageFactoryMappings) throws CoreException {
super(dbPath, locationConverter, cache, linkageFactoryMappings); super(dbPath, locationConverter, cache, linkageFactoryMappings);
} }

View file

@ -272,7 +272,6 @@ public class CEditor extends TextEditor implements ISelectionChangedListener, IC
// look up the current range of the marker when the document has been edited // look up the current range of the marker when the document has been edited
IAnnotationModel model= getDocumentProvider().getAnnotationModel(getEditorInput()); IAnnotationModel model= getDocumentProvider().getAnnotationModel(getEditorInput());
if (model instanceof AbstractMarkerAnnotationModel) { if (model instanceof AbstractMarkerAnnotationModel) {
AbstractMarkerAnnotationModel markerModel= (AbstractMarkerAnnotationModel) model; AbstractMarkerAnnotationModel markerModel= (AbstractMarkerAnnotationModel) model;
Position pos= markerModel.getMarkerPosition(marker); Position pos= markerModel.getMarkerPosition(marker);
if (pos != null && !pos.isDeleted()) { if (pos != null && !pos.isDeleted()) {