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

Bug 258930

Summary: Disposing a Graph with GraphContainer does not work
Product: [Tools] GEF Reporter: Markus Voelter <voelter>
Component: GEF-Legacy ZestAssignee: Ian Bull <irbull>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: ahunter.eclipse, irbull
Version: unspecified   
Target Milestone: 3.5.0 (Galileo) M5   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Markus Voelter CLA 2008-12-16 09:09:02 EST
If I try to get rid of a Graph by dispose()ing it, I get an exception if the graph contains GraphContainers.

I get an java.lang.IllegalArgumentException: Figure is not a child

I don't get a stack trace, but it dies here:

class GraphConnection
	public void dispose() {
		super.dispose();
		this.isDisposed = true;
		(getSource()).removeSourceConnection(this);
		(getDestination()).removeTargetConnection(this);
-----> 		graphModel.removeConnection(this);
Comment 1 Ian Bull CLA 2009-01-05 01:34:11 EST
thanks Markus,

I tracked this down to a problem where connections inside containers are not using the ZestLayer, but it tries to dispose from there.

I will fix this in head.
Comment 2 Ian Bull CLA 2009-01-29 20:13:35 EST
I have fixed this in Head.

Thanks!
Comment 3 Anthony Hunter CLA 2009-01-30 16:45:19 EST
Hi Ian, I have a compile error:

GraphModelEntityRelationshipFactory:

		Collections.addAll(listOfNodes, modelNodes);

The method addAll(List, GraphNode[]) is undefined for the type Collections.

Do not forget we are using Java 1.4.

I will fix later today if you do not see this since I assume we want these fixes in M5

p.s. when you fix a bug, do not forget to set the target milestone.
Comment 4 Ian Bull CLA 2009-01-30 16:57:02 EST
Thanks for reminding me about the target milestone (and pointing this out). I will also set my compiler settings for Zest. I thought they were set to 1.4, but I guess not.


Comment 5 Anthony Hunter CLA 2009-01-30 17:27:31 EST
I replaced :

		GraphNode[] modelNodes = getNodesArray(model);
		List listOfNodes = new ArrayList();
		Collections.addAll(listOfNodes, modelNodes);

with

		GraphNode[] modelNodes = getNodesArray(model);
		List listOfNodes = new ArrayList();
		for (int i = 0; i < modelNodes.length; i++) {
			listOfNodes.add(modelNodes[i]);
		}

So I can run a build and smoke test GEF (since M5 is Tuesday).
Comment 6 Ian Bull CLA 2009-01-30 17:56:27 EST
I just got the merge conflict, thanks for fixing this :)

It looks like Zest is configured correctly, I was just pointed to the wrong JRE in my workspace.  I have fixed that now.