Community
Participate
Working Groups
Build ID: 3.2.2 In org.eclipse.ui.workbench plugin / org.eclipse.ui.internal.registry.PerspectiveRegistry, the loadCustom method has three problems : 1) If the xmlString is empty, as is happening in our product, reader = null, and the call to XMLMementor.createReadRoot(reader) fails because the reader = null 2) If the first perspective is found, reader will be set up. If the second perspective is not found (such as because of the problem in 1), then reader will still have a value, but it will be referencing a closed stream. 3) There is no information logged to the error log that will help to identify any problem -- all that is displayed is a dialog message
(1) applies to PerspectiveRegistry.getCustomPersp(String) too.
Is there a fix fr this in 3.4?
No there is not currently.
Raji, Pavel, could you place here reproduction steps? I'd like to create a fix :-)
The first point problem occurs by calling a code like this... try { PerspectiveRegistry perspRegistry = (PerspectiveRegistry) PlatformUI.getWorkbench().getPerspectiveRegistry(); perspRegistry.getCustomPersp("SomeNonexistingPerspective"); } catch (Exception e) { e.printStackTrace(); } Internally causes calling this with reader == null... XMLMemento memento = XMLMemento.createReadRoot(reader); Hope this helps.
Created attachment 120686 [details] Part one of solution Kevin, can I take this bug? This patch addresses concern 1 & 2 in the bug description and comment 1. Guys, is it what you expect? Patch for concern 3 will be created soon.
> Guys, is it what you expect? > > Patch for concern 3 will be created soon. > Seems fine to me. Thanks.
Christopher, thanks. Looks fine.
Created attachment 120833 [details] PatchToBeReleasedSoon
I'm taking this bug :-)
Slightly modified patch released to HEAD.