mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-15 12:15:47 +02:00
Cosmetics.
This commit is contained in:
parent
6b6920a6d4
commit
15ef53b2b7
1 changed files with 16 additions and 23 deletions
|
@ -167,7 +167,6 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
||||||
private IndexFactory fIndexFactory= new IndexFactory(this);
|
private IndexFactory fIndexFactory= new IndexFactory(this);
|
||||||
private IndexProviderManager fIndexProviderManager = new IndexProviderManager();
|
private IndexProviderManager fIndexProviderManager = new IndexProviderManager();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Serializes creation of new indexer, when acquiring the lock you are
|
* Serializes creation of new indexer, when acquiring the lock you are
|
||||||
* not allowed to hold a lock on fPDOMs.
|
* not allowed to hold a lock on fPDOMs.
|
||||||
|
@ -341,8 +340,7 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
||||||
if (!dbFile.exists()) {
|
if (!dbFile.exists()) {
|
||||||
dbFile= null;
|
dbFile= null;
|
||||||
dbName= null;
|
dbName= null;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
ICProject currentCOwner= fFileToProject.get(dbFile);
|
ICProject currentCOwner= fFileToProject.get(dbFile);
|
||||||
if (currentCOwner != null) {
|
if (currentCOwner != null) {
|
||||||
IProject currentOwner= currentCOwner.getProject();
|
IProject currentOwner= currentCOwner.getProject();
|
||||||
|
@ -373,8 +371,7 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
||||||
}
|
}
|
||||||
if (fromScratch) {
|
if (fromScratch) {
|
||||||
pdom.setCreatedFromScratch(true);
|
pdom.setCreatedFromScratch(true);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
pdom.clear();
|
pdom.clear();
|
||||||
pdom.setClearedBecauseOfVersionMismatch(true);
|
pdom.setClearedBecauseOfVersionMismatch(true);
|
||||||
}
|
}
|
||||||
|
@ -444,14 +441,12 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
||||||
protected void onPreferenceChange(ICProject cproject, PreferenceChangeEvent event) {
|
protected void onPreferenceChange(ICProject cproject, PreferenceChangeEvent event) {
|
||||||
if (IndexerPreferences.KEY_UPDATE_POLICY.equals(event.getKey())) {
|
if (IndexerPreferences.KEY_UPDATE_POLICY.equals(event.getKey())) {
|
||||||
changeUpdatePolicy(cproject);
|
changeUpdatePolicy(cproject);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
IProject project= cproject.getProject();
|
IProject project= cproject.getProject();
|
||||||
if (project.exists() && project.isOpen()) {
|
if (project.exists() && project.isOpen()) {
|
||||||
try {
|
try {
|
||||||
changeIndexer(cproject);
|
changeIndexer(cproject);
|
||||||
}
|
} catch (Exception e) {
|
||||||
catch (Exception e) {
|
|
||||||
CCorePlugin.log(e);
|
CCorePlugin.log(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -955,7 +950,7 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
||||||
// don't attempt to hold lock on indexerMutex while canceling
|
// don't attempt to hold lock on indexerMutex while canceling
|
||||||
cancelIndexerJobs(indexer);
|
cancelIndexerJobs(indexer);
|
||||||
|
|
||||||
synchronized(fUpdatePolicies) {
|
synchronized (fUpdatePolicies) {
|
||||||
indexer= getIndexer(project);
|
indexer= getIndexer(project);
|
||||||
if (indexer != null) {
|
if (indexer != null) {
|
||||||
createPolicy(project).clearTUs();
|
createPolicy(project).clearTUs();
|
||||||
|
@ -995,7 +990,7 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
||||||
protected IStatus run(IProgressMonitor monitor) {
|
protected IStatus run(IProgressMonitor monitor) {
|
||||||
while(true) {
|
while(true) {
|
||||||
final Runnable r;
|
final Runnable r;
|
||||||
synchronized(fChangeEvents) {
|
synchronized (fChangeEvents) {
|
||||||
if (fChangeEvents.isEmpty()) {
|
if (fChangeEvents.isEmpty()) {
|
||||||
return Status.OK_STATUS;
|
return Status.OK_STATUS;
|
||||||
}
|
}
|
||||||
|
@ -1021,7 +1016,7 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
||||||
|
|
||||||
|
|
||||||
void fireStateChange(final int state) {
|
void fireStateChange(final int state) {
|
||||||
synchronized(fStateListeners) {
|
synchronized (fStateListeners) {
|
||||||
if (fLastNotifiedState == state) {
|
if (fLastNotifiedState == state) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1093,8 +1088,7 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
||||||
try {
|
try {
|
||||||
Thread.sleep(waitMaxMillis);
|
Thread.sleep(waitMaxMillis);
|
||||||
monitor.setCanceled(true);
|
monitor.setCanceled(true);
|
||||||
}
|
} catch (InterruptedException e) {
|
||||||
catch (InterruptedException e) {
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -1232,9 +1226,9 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
||||||
} finally {
|
} finally {
|
||||||
newPDOM.releaseWriteLock();
|
newPDOM.releaseWriteLock();
|
||||||
}
|
}
|
||||||
} catch(IOException ioe) {
|
} catch (IOException ioe) {
|
||||||
throw new CoreException(CCorePlugin.createStatus(ioe.getMessage()));
|
throw new CoreException(CCorePlugin.createStatus(ioe.getMessage()));
|
||||||
} catch(InterruptedException ie) {
|
} catch (InterruptedException ie) {
|
||||||
throw new CoreException(CCorePlugin.createStatus(ie.getMessage()));
|
throw new CoreException(CCorePlugin.createStatus(ie.getMessage()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1313,7 +1307,7 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isIndexerSetupPostponed(ICProject proj) {
|
public boolean isIndexerSetupPostponed(ICProject proj) {
|
||||||
synchronized(fSetupParticipants) {
|
synchronized (fSetupParticipants) {
|
||||||
return fPostponedProjects.contains(proj);
|
return fPostponedProjects.contains(proj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1347,8 +1341,7 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
||||||
ICElement other= set.get(j);
|
ICElement other= set.get(j);
|
||||||
if (contains(other, element)) {
|
if (contains(other, element)) {
|
||||||
continue allElements;
|
continue allElements;
|
||||||
}
|
} else if (contains(element, other)) {
|
||||||
else if (contains(element, other)) {
|
|
||||||
set.set(j, element);
|
set.set(j, element);
|
||||||
continue allElements;
|
continue allElements;
|
||||||
}
|
}
|
||||||
|
@ -1395,7 +1388,7 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean postponeSetup(final ICProject cproject) {
|
protected boolean postponeSetup(final ICProject cproject) {
|
||||||
synchronized(fSetupParticipants) {
|
synchronized (fSetupParticipants) {
|
||||||
for (IndexerSetupParticipant sp : fSetupParticipants) {
|
for (IndexerSetupParticipant sp : fSetupParticipants) {
|
||||||
if (sp.postponeIndexerSetup(cproject)) {
|
if (sp.postponeIndexerSetup(cproject)) {
|
||||||
fPostponedProjects.add(cproject);
|
fPostponedProjects.add(cproject);
|
||||||
|
@ -1430,7 +1423,7 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
||||||
public void notifyIndexerSetup(IndexerSetupParticipant participant, ICProject project) {
|
public void notifyIndexerSetup(IndexerSetupParticipant participant, ICProject project) {
|
||||||
if (fInShutDown)
|
if (fInShutDown)
|
||||||
return;
|
return;
|
||||||
synchronized(fSetupParticipants) {
|
synchronized (fSetupParticipants) {
|
||||||
if (fPostponedProjects.contains(project)) {
|
if (fPostponedProjects.contains(project)) {
|
||||||
setupProject(project);
|
setupProject(project);
|
||||||
}
|
}
|
||||||
|
@ -1491,8 +1484,8 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
||||||
} finally {
|
} finally {
|
||||||
index.releaseReadLock();
|
index.releaseReadLock();
|
||||||
}
|
}
|
||||||
} catch(InterruptedException ie) {
|
} catch (InterruptedException e) {
|
||||||
CCorePlugin.log(ie);
|
CCorePlugin.log(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue