mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 17:56:01 +02:00
2005-03-18 Alain Magloire
Move more code in the try/finally as a precaution. Bad things where happening (i.e. NPE) but the monitor was not decremented * index/org/eclipse/cdt/internal/core/indexing/IndexManager.java
This commit is contained in:
parent
6f3bf0d981
commit
1575e7878e
2 changed files with 30 additions and 24 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2005-03-18 Alain Magloire
|
||||||
|
Move more code in the try/finally as a precaution. Bad things
|
||||||
|
where happening (i.e. NPE) but the monitor was not decremented
|
||||||
|
* index/org/eclipse/cdt/internal/core/indexing/IndexManager.java
|
||||||
|
|
||||||
2005-03-15 Bogdan Gheorghe
|
2005-03-15 Bogdan Gheorghe
|
||||||
Added a check for closed projects to update code
|
Added a check for closed projects to update code
|
||||||
|
|
||||||
|
|
|
@ -415,31 +415,32 @@ public class IndexManager extends JobManager{
|
||||||
//this point
|
//this point
|
||||||
ICDTIndexer indexer = null;
|
ICDTIndexer indexer = null;
|
||||||
indexer = (ICDTIndexer) indexerMap.get(project);
|
indexer = (ICDTIndexer) indexerMap.get(project);
|
||||||
|
try {
|
||||||
|
if (indexer == null){
|
||||||
|
String indexerID = null;
|
||||||
|
try {
|
||||||
|
//Indexer has not been created yet for this session
|
||||||
|
//Check to see if the indexer has been set in a session property
|
||||||
|
indexerID = (String) project.getSessionProperty(indexerIDKey);
|
||||||
|
} catch (CoreException e) {}
|
||||||
|
|
||||||
if (indexer == null){
|
//Project was either closed at startup or imported
|
||||||
String indexerID = null;
|
if (indexerID == null &&
|
||||||
try {
|
project.isAccessible()){
|
||||||
//Indexer has not been created yet for this session
|
try {
|
||||||
//Check to see if the indexer has been set in a session property
|
indexer=initializeIndexer(project);
|
||||||
indexerID = (String) project.getSessionProperty(indexerIDKey);
|
} catch (CoreException e1) {}
|
||||||
} catch (CoreException e) {}
|
}
|
||||||
|
else{
|
||||||
|
//Create the indexer and store it
|
||||||
|
indexer = getIndexer(indexerID);
|
||||||
|
}
|
||||||
|
|
||||||
//Project was either closed at startup or imported
|
//Make sure we're not putting null in map
|
||||||
if (indexerID == null &&
|
if (indexer != null)
|
||||||
project.isAccessible()){
|
indexerMap.put(project,indexer);
|
||||||
try {
|
|
||||||
indexer=initializeIndexer(project);
|
|
||||||
} catch (CoreException e1) {}
|
|
||||||
}
|
}
|
||||||
else{
|
} finally {
|
||||||
//Create the indexer and store it
|
|
||||||
indexer = getIndexer(indexerID);
|
|
||||||
}
|
|
||||||
|
|
||||||
//Make sure we're not putting null in map
|
|
||||||
if (indexer != null)
|
|
||||||
indexerMap.put(project,indexer);
|
|
||||||
|
|
||||||
monitor.exitRead();
|
monitor.exitRead();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue