Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 345442

Summary: NullPointerException in RenameActionProvider.fillContextMenu
Product: [Modeling] Graphiti Reporter: Michael Wenz <michael.wenz>
Component: CoreAssignee: Michael Wenz <michael.wenz>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 Flags: michael.wenz: indigo+
Version: 0.8.0   
Target Milestone: 0.8.0   
Hardware: All   
OS: All   
Whiteboard: Indigo RC1 theme_bugs

Description Michael Wenz CLA 2011-05-11 11:16:01 EDT
Reported in https://bugs.eclipse.org/bugs/show_bug.cgi?id=345272:
----
when implementing the UpdateFeature i get the following NPE:

I just followed the instructions under "Test: Update a EClass Name"
When I invoke the context menu in the PROJECT EXPLORER under EClasses
I get the following exception. Is this a bug ?

PS. should i post this first to the forum instead of bugzilla ? 

!MESSAGE java.lang.NullPointerException
!STACK 0
java.lang.NullPointerException
    at
org.eclipse.graphiti.examples.common.RenameActionProvider.fillContextMenu(RenameActionProvider.java:57)
    at
org.eclipse.ui.navigator.NavigatorActionService$2.run(NavigatorActionService.java:221)

as additional note: 
it also does not work with the delivered example so I think there must be some
bug
--- 
The RenameActionProvider gets an instance of an EClass with eResource == null
Comment 1 Michael Wenz CLA 2011-05-12 04:31:29 EDT
Problem was that all EClass objects in the tree were unloaded right after retrieving them for listing in the tree; because of that they are proxies only for which the eResource cannot be retrieved. I fixed this by modifying the time when the unload happens. For EClasses shown in the tree the unload is only performed before refreshing the tree not afterwards now.

Fixed in head.

Michael
Comment 2 Michael Wenz CLA 2011-05-12 10:58:47 EDT
Verified in install
Comment 3 Michael Wenz CLA 2011-06-24 08:43:46 EDT
Part of Graphiti Indigo 0.8.0