Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 104579 - [Forms] AssertionFailed from MultiPageEditorPart
Summary: [Forms] AssertionFailed from MultiPageEditorPart
Status: RESOLVED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: User Assistance (show other bugs)
Version: 3.1   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: platform-ua-inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-20 16:33 EDT by Jared Burns CLA
Modified: 2019-10-09 07:04 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jared Burns CLA 2005-07-20 16:33:07 EDT
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.
Comment 1 Jared Burns CLA 2005-07-20 16:54:44 EDT
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.
Comment 2 Jared Burns CLA 2005-07-20 16:56:20 EDT
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.
Comment 3 Konrad Kolosowski CLA 2005-07-25 16:34:58 EDT
Is there any PDE code involved here that needs to be changed?  I only see UI 
and Forms code mentioned.
Comment 4 Jared Burns CLA 2005-07-25 16:54:36 EDT
(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.
Comment 5 Jared Burns CLA 2005-07-25 17:45:31 EDT
It looks like these problems stem from calling FormEditor#addPage(IEditorPart,
IEditorInput) with a FormPage as the editor part.
Comment 6 Peter Lanser CLA 2006-09-11 14:29:38 EDT
I'm still expieriencing this bug in 3.2. Is there any workaround?
Comment 7 Eugene Kuleshov CLA 2008-10-23 22:39:51 EDT
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?
Comment 8 Boris Bokowski CLA 2009-02-10 10:55:32 EST
Mass update - these bugs belong to the UA component.
Comment 9 Chris Goldthorpe CLA 2009-03-24 19:01:23 EDT
Adam, do you have any ideas on this one?
Comment 10 Chris Goldthorpe CLA 2009-04-15 10:38:17 EDT
Reassigning to platform-ua-inbox@eclipse.org
Comment 11 Eclipse Genie CLA 2019-04-02 00:31:01 EDT
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.
Comment 12 Lars Vogel CLA 2019-10-09 07:04:41 EDT
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.