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

Bug 173597

Summary: GEF Editor Undo Error
Product: [Tools] GEF Reporter: jerlyn99
Component: GEF-Legacy GEF (MVC)Assignee: gef-inbox <gef-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: critical    
Priority: P3 CC: mattscar, nyssen
Version: 3.2   
Target Milestone: 3.6.0 (Helios) M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Screenshots
none
Patch to remove error in Flow Example Activity.java none

Description jerlyn99 CLA 2007-02-09 02:19:49 EST
Problems happens in the animated graph (e.g. Flow Diagram), which has say 6 activities on editor, and connected to each other in the most complicated way possible. Try using ctrl key to make multiple selections of connectors + activites and delete. Followed by performing an undo operation. This undo does not correctly undo the actions performed. Please rectify, with thanks.
Comment 1 Anthony Hunter CLA 2007-02-09 09:16:39 EST
There is not enough information in this Bugzilla to investigate the issue.

We need one of:

An example demonstrating the issue.
A failing JUnit test demonstrating the issue.
A patch containing a fixes for the problem.
Comment 2 jerlyn99 CLA 2007-02-11 21:15:56 EST
Created attachment 58744 [details]
Screenshots

Shows the diagram before delete, after delete and after undo.
Comment 3 jerlyn99 CLA 2007-02-11 21:16:53 EST
Ok to recreate the error:
1. Create a new Flow Diagram (GEF Plugin Example)
2. Clear the diagram
3. Put 4 new activities on diagram
4. Create connections between the 4 activities in the most complicated way you can where they are all inter-connected to each other
5. Using the ctrl-key select 3 connectors and 2 activities
6. Delete the 5 selected items at one go
7. Select undo option

You can see that the undo action does not undo correctly, ie. does not undo to the state before deletion.

8. Further undo and the steps are all reverted incorrectly and even resulted in error printed below.

I have attached screenshots for your viewing. 

Thank you.

---------------------------------------

!ENTRY org.eclipse.ui 4 4 2007-02-12 10:09:55.229
!MESSAGE Unhandled event loop exception

!ENTRY org.eclipse.ui 4 0 2007-02-12 10:09:55.245
!MESSAGE java.lang.NullPointerException
!STACK 0
java.lang.NullPointerException
	at org.eclipse.draw2d.graph.Edge.<init>(Edge.java:164)
	at org.eclipse.gef.examples.flow.parts.TransitionPart.contributeToGraph(TransitionPart.java:108)
	at org.eclipse.gef.examples.flow.parts.ActivityPart.contributeEdgesToGraph(ActivityPart.java:74)
	at org.eclipse.gef.examples.flow.parts.ActivityPart.contributeEdgesToGraph(ActivityPart.java:78)
Comment 4 Matt Scarpino CLA 2007-07-24 10:46:06 EDT
Created attachment 74469 [details]
Patch to remove error in Flow Example Activity.java

This patch forces Activity objects to check whether the Transition being added is already one of its Transitions.
Comment 5 Matt Scarpino CLA 2007-07-24 10:58:44 EDT
When you delete an Activity and one of its Transitions, the Transition will be deleted twice. If you undo the deletion, the Transition will be added twice. I think that's what's causing the error.

My patch (and it's my first, so be patient) forces each Activity to check whether a Transition added to an Activity is already one of the Activity's Transitions. On my system, this gets rid of the loop exception.
Comment 6 Alexander Nyßen CLA 2010-04-12 17:18:15 EDT
I am not able to reproduce this issue under GEF 3.6M6, thus I am closing it as resolved fixed. If somebody can provide steps to still reproduce this issue, please reopen.
Comment 7 Alexander Nyßen CLA 2014-05-22 04:07:51 EDT
Comment on attachment 74469 [details]
Patch to remove error in Flow Example Activity.java

This patch has not been applied, so marking it as obsolete.