Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkingSetManager.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkingSetManager.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkingSetManager.java
index 3322f6ae36b..2cdf90f0d14 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkingSetManager.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkingSetManager.java
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Tasktop Technologies - fix for bug 327396
*******************************************************************************/
package org.eclipse.ui.internal;
@@ -43,6 +44,10 @@ public class WorkingSetManager extends AbstractWorkingSetManager implements
// Working set persistence
public static final String WORKING_SET_STATE_FILENAME = "workingsets.xml"; //$NON-NLS-1$
+ private boolean restoreInProgress;
+
+ private boolean savePending;
+
public WorkingSetManager(BundleContext context) {
super(context);
}
@@ -104,6 +109,8 @@ public class WorkingSetManager extends AbstractWorkingSetManager implements
if (stateFile != null && stateFile.exists()) {
try {
+ restoreInProgress = true;
+
FileInputStream input = new FileInputStream(stateFile);
BufferedReader reader = new BufferedReader(
new InputStreamReader(input, "utf-8")); //$NON-NLS-1$
@@ -122,6 +129,13 @@ public class WorkingSetManager extends AbstractWorkingSetManager implements
e,
WorkbenchMessages.ProblemRestoringWorkingSetState_title,
WorkbenchMessages.ProblemRestoringWorkingSetState_message);
+ } finally {
+ restoreInProgress = false;
+ }
+
+ if (savePending) {
+ saveState();
+ savePending = false;
}
}
}
@@ -130,6 +144,11 @@ public class WorkingSetManager extends AbstractWorkingSetManager implements
* Saves the working sets in the persistence store
*/
private void saveState() {
+ if (restoreInProgress) {
+ // bug 327396: avoid saving partial state
+ savePending = true;
+ return;
+ }
File stateFile = getWorkingSetStateFile();
if (stateFile == null) {

Back to the top