Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 357085 - [All digrams] Changing editors (from Papyrus to text-based editor) causes recurring null pointer exception
Summary: [All digrams] Changing editors (from Papyrus to text-based editor) causes rec...
Status: RESOLVED FIXED
Alias: None
Product: Papyrus
Classification: Modeling
Component: Core (show other bugs)
Version: 0.8.1   Edit
Hardware: PC Linux
: P3 critical (vote)
Target Milestone: ---   Edit
Assignee: Vincent Lorenzo CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 358240
Blocks:
  Show dependency tree
 
Reported: 2011-09-08 09:59 EDT by Ansgar Radermacher CLA
Modified: 2012-08-31 16:23 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ansgar Radermacher CLA 2011-09-08 09:59:17 EDT
When the user changes between Papyrus and a text based editor, there are sometimes popup-windows with a set of null pointer exceptions. These are critical: when the user clicks on "ok" or "close", a new exception will be thrown immediately resulting in a new popup. It is thus not possible to close the workspace properly, nor to save.

The problem did not occur with Papyrus 0.7.x. A first analysis showed that immediately before the first null pointer exception, a "widget disposed exception" is thrown (see below). The widget is in fact a menu, the associated manager has ID org.eclipse.papyrus.table.ui.menu.tables.
An analysis (and try&error) showed that problem can be reproduced as long as org.eclipse.papyrus.diagram menu is active and more specifically the extension point associated with the toolbar.
The error can not be reproduced, if the extension point associated with the toolbar is removed. It can also not be reproduced, if the "dynamic" attribute is removed (<dynamic class="oep.diagram.menu.toolbar.ZoomToolbar" ...)          

Thread [main] (Suspended (breakpoint at line 466 in Widget))
    Menu(Widget).error(int) line: 466
    Menu(Widget).checkWidget() line: 403
    Menu.getParentMenu() line: 590          [Menu {*Disposed*}]
    MenuManager.updateMenuItem() line: 984  [MenuManager, id=org.eclipse.papyrus.table.ui.menu.tables]
    MenuManager.update(boolean, boolean) line: 870
    MenuManager.update(boolean) line: 682
    WorkbenchMenuService.updateManagers() line: 330
    WorkbenchMenuService$4.propertyChange(PropertyChangeEvent) line: 316
    EvaluationAuthority$1.run() line: 252
    SafeRunner.run(ISafeRunnable) line: 42
    EvaluationAuthority.fireServiceChange(String, Object, Object) line: 246
    EvaluationAuthority.endSourceChange(String[]) line: 197
    EvaluationAuthority.sourceChanged(String[]) line: 135
    EvaluationAuthority(ExpressionAuthority).sourceChanged(int, String[]) line: 311
    EvaluationAuthority(ExpressionAuthority).sourceChanged(int, Map) line: 290
    WorkbenchSourceProvider(AbstractSourceProvider).fireSourceChanged(int, Map) line: 99
    WorkbenchSourceProvider.checkActivePart(boolean) line: 401
    WorkbenchSourceProvider.checkActivePart() line: 300
    WorkbenchSourceProvider$1.partBroughtToTop(IWorkbenchPart) line: 239
Comment 1 Ansgar Radermacher CLA 2011-09-08 10:09:26 EDT
Workaround:
Disable (put into comments) dynamic visibility of toolbar in plugin.xml of oep.diaram.menu:

...
       </command>
         <!--
         <dynamic
               class="org.eclipse.papyrus.diagram.menu.toolbar.ZoomToolbar"
               id="zoomToolBar">
            <visibleWhen
                  checkEnabled="true">
               <and>
                  <with
                  variable="activeEditorId">
                     <equals
                           value="org.eclipse.papyrus.core.papyrusEditor">
                     </equals>
                  </with>
               </and>
            </visibleWhen>
         </dynamic>
         -->
         <visibleWhen>
             <with variable="activeEditorId"> ...
Comment 2 Ansgar Radermacher CLA 2011-09-20 09:35:02 EDT
The error does not only occur with the Zoom control (Combo), it also occurs with the font combo boxes (font name, font size) provided by GMF, but results apparently less often in visible erroneous behavior - which basically means that the error is more difficult to reproduce, but might still occur.

Current workaround:
Import org.eclipse.swt as source project. Modify class Combo: overload dispose function:

public void dispose() {
	buttonHandle = 0;
	super.dispose();
}
Comment 3 Ansgar Radermacher CLA 2012-08-31 16:14:34 EDT
Fixed in 383189
Comment 4 Ansgar Radermacher CLA 2012-08-31 16:23:26 EDT
(In reply to comment #3)
> Fixed in 383189

Clarification: Fixed due to the fix of bug 383189 (bug 357085 is a duplicate of 383189)