Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 120686 Details for
Bug 211350
[ErrorHandling] Need better error handling in PerspectiveRegistry
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Part one of solution
part1.txt (text/plain), 5.10 KB, created by
Krzysztof Daniel
on 2008-12-17 07:45:47 EST
(
hide
)
Description:
Part one of solution
Filename:
MIME Type:
Creator:
Krzysztof Daniel
Created:
2008-12-17 07:45:47 EST
Size:
5.10 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ui.workbench >Index: Eclipse UI/org/eclipse/ui/internal/messages.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/messages.properties,v >retrieving revision 1.389 >diff -u -r1.389 messages.properties >--- Eclipse UI/org/eclipse/ui/internal/messages.properties 16 Dec 2008 09:04:28 -0000 1.389 >+++ Eclipse UI/org/eclipse/ui/internal/messages.properties 17 Dec 2008 12:44:18 -0000 >@@ -601,6 +601,7 @@ > Perspective_errorReadingState = Unable to read workbench state. > Perspective_problemLoadingTitle = Loading Problems > Perspective_errorLoadingState = Unable to load perspective. >+Perspective_couldNotBeFound= Description of ''{0}'' perspective could not be found. > WorkbenchPage_problemRestoringTitle = Restoring Problems > WorkbenchPage_errorReadingState = Unable to read workbench state. > >Index: Eclipse UI/org/eclipse/ui/internal/WorkbenchMessages.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchMessages.java,v >retrieving revision 1.111 >diff -u -r1.111 WorkbenchMessages.java >--- Eclipse UI/org/eclipse/ui/internal/WorkbenchMessages.java 15 Dec 2008 13:57:44 -0000 1.111 >+++ Eclipse UI/org/eclipse/ui/internal/WorkbenchMessages.java 17 Dec 2008 12:44:18 -0000 >@@ -884,6 +884,9 @@ > public static String PerspectiveBar_saveAs; > public static String PerspectiveBar_reset; > >+ >+ public static String Perspective_couldNotBeFound; >+ > public static String PerspectiveSwitcher_dockOn; > public static String PerspectiveSwitcher_topRight; > public static String PerspectiveSwitcher_topLeft; >Index: Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveRegistry.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveRegistry.java,v >retrieving revision 1.51 >diff -u -r1.51 PerspectiveRegistry.java >--- Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveRegistry.java 10 Mar 2008 03:47:52 -0000 1.51 >+++ Eclipse UI/org/eclipse/ui/internal/registry/PerspectiveRegistry.java 17 Dec 2008 12:44:18 -0000 >@@ -39,6 +39,7 @@ > import org.eclipse.jface.resource.StringConverter; > import org.eclipse.jface.util.IPropertyChangeListener; > import org.eclipse.jface.util.PropertyChangeEvent; >+import org.eclipse.osgi.util.NLS; > import org.eclipse.ui.IMemento; > import org.eclipse.ui.IPerspectiveDescriptor; > import org.eclipse.ui.IPerspectiveRegistry; >@@ -435,6 +436,15 @@ > String xmlString = store.getString(perspectivesList[i] + PERSP); > if (xmlString != null && xmlString.length() != 0) { > reader = new StringReader(xmlString); >+ } else { >+ throw new WorkbenchException( >+ new Status( >+ IStatus.ERROR, >+ WorkbenchPlugin.PI_WORKBENCH, >+ NLS >+ .bind( >+ WorkbenchMessages.Perspective_couldNotBeFound, >+ perspectivesList[i]))); > } > > // Restore the layout state. >@@ -564,6 +574,15 @@ > String xmlString = store.getString(id + PERSP); > if (xmlString != null && xmlString.length() != 0) { // defined in store > reader = new StringReader(xmlString); >+ } else { >+ throw new WorkbenchException( >+ new Status( >+ IStatus.ERROR, >+ WorkbenchPlugin.PI_WORKBENCH, >+ NLS >+ .bind( >+ WorkbenchMessages.Perspective_couldNotBeFound, >+ id))); > } > XMLMemento memento = XMLMemento.createReadRoot(reader); > reader.close(); >#P org.eclipse.ui.tests >Index: Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIDialogs.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIDialogs.java,v >retrieving revision 1.26 >diff -u -r1.26 UIDialogs.java >--- Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIDialogs.java 16 Mar 2007 18:00:00 -0000 1.26 >+++ Eclipse UI Tests/org/eclipse/ui/tests/dialogs/UIDialogs.java 17 Dec 2008 12:44:19 -0000 >@@ -10,6 +10,8 @@ > *******************************************************************************/ > package org.eclipse.ui.tests.dialogs; > >+import java.io.IOException; >+ > import junit.framework.TestCase; > > import org.eclipse.core.resources.IProject; >@@ -158,6 +160,18 @@ > dialog.setInitialSelection(description); > DialogCheck.assertDialog(dialog, this); > } >+ >+ // see bug 211350 >+ public void testLoadNotExistingPerspective() throws IOException{ >+ final String fakePerspectivID = "fakeperspetive"; >+ PerspectiveRegistry reg = (PerspectiveRegistry) WorkbenchPlugin >+ .getDefault().getPerspectiveRegistry(); >+ try { >+ reg.getCustomPersp(fakePerspectivID); >+ } catch (WorkbenchException e) { >+ assertTrue(e.getStatus().getMessage().indexOf(fakePerspectivID) != -1); >+ } >+ } > > public void testSelectPerspective() { > Dialog dialog = new SelectPerspectiveDialog(getShell(), PlatformUI
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 211350
: 120686 |
120833