aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOleg Besedin2012-04-17 16:50:08 (EDT)
committerOleg Besedin2012-04-17 16:50:37 (EDT)
commitfdf4db780aacd85623c995e81788979e721fb568 (patch)
tree6f4b0d504d1961336d97a50935b8c9431cce5b87
parent9edb3c6c0d3b0e0a979d82b5ee40bfe8d3fea799 (diff)
downloadeclipse.platform.ui-fdf4db780aacd85623c995e81788979e721fb568.zip
eclipse.platform.ui-fdf4db780aacd85623c995e81788979e721fb568.tar.gz
eclipse.platform.ui-fdf4db780aacd85623c995e81788979e721fb568.tar.bz2
Bug 377031 - Empty/broken workbench.xmi file makes workspace unusablev20120417-2050
-rw-r--r--bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ResourceHandler.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ResourceHandler.java b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ResourceHandler.java
index 7d141c9..d015d38 100644
--- a/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ResourceHandler.java
+++ b/bundles/org.eclipse.e4.ui.workbench/src/org/eclipse/e4/ui/internal/workbench/ResourceHandler.java
@@ -196,9 +196,11 @@ public class ResourceHandler implements IModelResourceHandler {
boolean restore = restoreLastModified > lastApplicationModification;
+ resource = null;
if (restore && saveAndRestore) {
resource = loadResource(restoreLocation);
- } else {
+ }
+ if (resource == null) {
Resource applicationResource = loadResource(applicationDefinitionInstance);
MApplication theApp = (MApplication) applicationResource.getContents().get(0);
resource = resourceSetImpl.createResource(restoreLocation);
@@ -229,8 +231,8 @@ public class ResourceHandler implements IModelResourceHandler {
resource = resourceSetImpl.getResource(uri, true);
} catch (Exception e) {
// TODO We could use diagnostics for better analyzing the error
- logger.error(e);
- resource = resourceSetImpl.getResource(uri, false);
+ logger.error(e, "Unable to load resource " + uri.toString()); //$NON-NLS-1$
+ return null;
}
// TODO once we switch from deltas, we only need this once on the default model?