Community
Participate
Working Groups
MultiPageEditorPart#pageChange(int) can cause an NPE in the following code: ISelectionProvider selectionProvider = activeEditor.getSite() .getSelectionProvider(); if (selectionProvider != null) { SelectionChangedEvent event = new SelectionChangedEvent( selectionProvider, selectionProvider.getSelection()); ((MultiPageSelectionProvider) getSite().getSelectionProvider()) .fireSelectionChanged(event); } The FormEditorSelectionProvider can return null to getSelection(). This should be checked before trying to construct a new SelectionChangedEvent. Calling this constructor with a null selection causes an assertion failure.
This is a bug in the selection provider. ISelectionProvider#getSelection() does not allow for a null return value. The selection provider should be returning an empty selection instead of null.
A little more information: In the case I encountered, FormEditorSelectionProvider got to the point where it returned the globalSelection, but globalSelection was null. This is what needs to be protected against.
Is there any PDE code involved here that needs to be changed? I only see UI and Forms code mentioned.
(moved to UI and assigned to Dejan) From an email to Dejan: After I fix the null problem (by checking for null and returning an empty selection), I'm hitting an infinite recursion problem. FormEditor#getSelection() queries the activeEditor for it's selection provider and then calls getSelection() on that. However, for whatever reason I'm getting the *same* selection provider from the activeEditor. So it just keeps recursing.
It looks like these problems stem from calling FormEditor#addPage(IEditorPart, IEditorInput) with a FormPage as the editor part.
I'm still expieriencing this bug in 3.2. Is there any workaround?
We are getting the same problem, but when not using FormEditor#addPage(IEditorPart, IEditorInput) call, editor's action contributor is not getting the actual editor part. i.e. setActiveEditor() gets null as a parameter. Can someone comment on this please?
Mass update - these bugs belong to the UA component.
Adam, do you have any ideas on this one?
Reassigning to platform-ua-inbox@eclipse.org
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.
This bug was marked as stalebug a while ago. Marking as wontfix. If this report is still relevant for the current release, please reopen and remove the stalebug whiteboard tag.