Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Wiebe2005-08-11 15:33:20 -0400
committerChris Wiebe2005-08-11 15:33:20 -0400
commitd6a0d5d0d12a67b0e4a60375ca5699a571df18bd (patch)
tree31a673567ee65a260f985d35fb40f7cd256f1aa6
parent9df072a4b2ec3024f8b03ced191aa07dcf527d7d (diff)
downloadorg.eclipse.cdt-d6a0d5d0d12a67b0e4a60375ca5699a571df18bd.tar.gz
org.eclipse.cdt-d6a0d5d0d12a67b0e4a60375ca5699a571df18bd.tar.xz
org.eclipse.cdt-d6a0d5d0d12a67b0e4a60375ca5699a571df18bd.zip
2005-08-11 Chris Wiebe
Fix PRs 104907,106415: type cache always running in background * browser/org/eclipse/cdt/core/browser/AllTypesCache.java * browser/org/eclipse/cdt/internal/core/browser/cache/TypeCacherJob.java
-rw-r--r--core/org.eclipse.cdt.core/ChangeLog5
-rw-r--r--core/org.eclipse.cdt.core/browser/org/eclipse/cdt/core/browser/AllTypesCache.java51
-rw-r--r--core/org.eclipse.cdt.core/browser/org/eclipse/cdt/internal/core/browser/cache/TypeCacherJob.java10
3 files changed, 37 insertions, 29 deletions
diff --git a/core/org.eclipse.cdt.core/ChangeLog b/core/org.eclipse.cdt.core/ChangeLog
index 4288f07c67..e639974cf6 100644
--- a/core/org.eclipse.cdt.core/ChangeLog
+++ b/core/org.eclipse.cdt.core/ChangeLog
@@ -1,3 +1,8 @@
+2005-08-11 Chris Wiebe
+ Fix PR 104907,106415: type cache always running in background
+ * browser/org/eclipse/cdt/core/browser/AllTypesCache.java
+ * browser/org/eclipse/cdt/internal/core/browser/cache/TypeCacherJob.java
+
2005-07-26 Alain Magloire
Fix PR 100992: IMethod were generated for implementation, we should generate
IFunction for method defines outside of the class shell.
diff --git a/core/org.eclipse.cdt.core/browser/org/eclipse/cdt/core/browser/AllTypesCache.java b/core/org.eclipse.cdt.core/browser/org/eclipse/cdt/core/browser/AllTypesCache.java
index d16bdfbd2d..89c047ae7d 100644
--- a/core/org.eclipse.cdt.core/browser/org/eclipse/cdt/core/browser/AllTypesCache.java
+++ b/core/org.eclipse.cdt.core/browser/org/eclipse/cdt/core/browser/AllTypesCache.java
@@ -68,15 +68,16 @@ public class AllTypesCache {
fgTypeHierarchyBuilder = new TypeHierarchyBuilder();
// load prefs
- Preferences prefs = CCorePlugin.getDefault().getPluginPreferences();
- if (prefs.contains(ENABLE_BACKGROUND_TYPE_CACHE)) {
- fgEnableIndexing = prefs.getBoolean(ENABLE_BACKGROUND_TYPE_CACHE);
- } else {
- prefs.setDefault(ENABLE_BACKGROUND_TYPE_CACHE, true);
- prefs.setValue(ENABLE_BACKGROUND_TYPE_CACHE, true);
- CCorePlugin.getDefault().savePluginPreferences();
- fgEnableIndexing = true;
- }
+// Preferences prefs = CCorePlugin.getDefault().getPluginPreferences();
+// if (prefs.contains(ENABLE_BACKGROUND_TYPE_CACHE)) {
+// fgEnableIndexing = prefs.getBoolean(ENABLE_BACKGROUND_TYPE_CACHE);
+// } else {
+// prefs.setDefault(ENABLE_BACKGROUND_TYPE_CACHE, false);
+// prefs.setValue(ENABLE_BACKGROUND_TYPE_CACHE, false);
+// CCorePlugin.getDefault().savePluginPreferences();
+// fgEnableIndexing = true;
+// }
+ fgEnableIndexing = false;
// start jobs in background after INITIAL_DELAY
TypeCacheManager.getInstance().reconcile(fgEnableIndexing, Job.BUILD, INITIAL_DELAY);
@@ -89,22 +90,22 @@ public class AllTypesCache {
};
CoreModel.getDefault().addElementChangedListener(fgElementChangedListener);
- // add property change listener
- fgPropertyChangeListener = new IPropertyChangeListener() {
- public void propertyChange(PropertyChangeEvent event) {
- String property = event.getProperty();
- if (property.equals(ENABLE_BACKGROUND_TYPE_CACHE)) {
- String value = (String) event.getNewValue();
- fgEnableIndexing = Boolean.valueOf(value).booleanValue();
- if (!fgEnableIndexing) {
- TypeCacheManager.getInstance().cancelJobs();
- } else {
- TypeCacheManager.getInstance().reconcile(fgEnableIndexing, Job.BUILD, 0);
- }
- }
- }
- };
- prefs.addPropertyChangeListener(fgPropertyChangeListener);
+// // add property change listener
+// fgPropertyChangeListener = new IPropertyChangeListener() {
+// public void propertyChange(PropertyChangeEvent event) {
+// String property = event.getProperty();
+// if (property.equals(ENABLE_BACKGROUND_TYPE_CACHE)) {
+// String value = (String) event.getNewValue();
+// fgEnableIndexing = Boolean.valueOf(value).booleanValue();
+// if (!fgEnableIndexing) {
+// TypeCacheManager.getInstance().cancelJobs();
+// } else {
+// TypeCacheManager.getInstance().reconcile(fgEnableIndexing, Job.BUILD, 0);
+// }
+// }
+// }
+// };
+// prefs.addPropertyChangeListener(fgPropertyChangeListener);
}
/**
diff --git a/core/org.eclipse.cdt.core/browser/org/eclipse/cdt/internal/core/browser/cache/TypeCacherJob.java b/core/org.eclipse.cdt.core/browser/org/eclipse/cdt/internal/core/browser/cache/TypeCacherJob.java
index 416100d23d..3cb779f2e1 100644
--- a/core/org.eclipse.cdt.core/browser/org/eclipse/cdt/internal/core/browser/cache/TypeCacherJob.java
+++ b/core/org.eclipse.cdt.core/browser/org/eclipse/cdt/internal/core/browser/cache/TypeCacherJob.java
@@ -119,6 +119,7 @@ public class TypeCacherJob extends BasicJob {
private void flush(ITypeSearchScope scope, IProgressMonitor monitor) throws InterruptedException {
// flush the cache
+ boolean success = true;
IProject project = fTypeCache.getProject();
monitor.beginTask("", 100); //$NON-NLS-1$
@@ -126,11 +127,11 @@ public class TypeCacherJob extends BasicJob {
fTypeCache.flush(scope);
if (!scope.encloses(project)) {
if (project.exists() && project.isOpen()) {
- doIndexerJob(new IndexerDependenciesJob(fIndexManager, fTypeCache, scope), monitor);
+ success = doIndexerJob(new IndexerDependenciesJob(fIndexManager, fTypeCache, scope), monitor);
}
}
- if ( monitor.isCanceled() ) {
+ if (!success || monitor.isCanceled()) {
throw new InterruptedException();
}
@@ -138,14 +139,15 @@ public class TypeCacherJob extends BasicJob {
}
private void update(ITypeSearchScope scope, IProgressMonitor monitor) throws InterruptedException {
+ boolean success = true;
IProject project = fTypeCache.getProject();
monitor.beginTask("", 100); //$NON-NLS-1$
if (project.exists() && project.isOpen()) {
- doIndexerJob(new IndexerTypesJob2(fIndexManager, fTypeCache, scope), monitor);
+ success = doIndexerJob(new IndexerTypesJob2(fIndexManager, fTypeCache, scope), monitor);
}
- if (monitor.isCanceled()) {
+ if (!success || monitor.isCanceled()) {
throw new InterruptedException();
}

Back to the top