Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 336455 - Duplicated Nodes due to copy-paste bug in GraphModelFactory and AbstractStylingModelFactory
Summary: Duplicated Nodes due to copy-paste bug in GraphModelFactory and AbstractStyli...
Status: RESOLVED FIXED
Alias: None
Product: GEF
Classification: Tools
Component: GEF-Legacy Zest (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: gef-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-06 11:27 EST by alejandrocorbellini CLA
Modified: 2011-02-08 15:47 EST (History)
1 user (show)

See Also:


Attachments
Duplicated Nodes Test (2.48 KB, application/octet-stream)
2011-02-06 22:13 EST, alejandrocorbellini CLA
steeg: iplog+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description alejandrocorbellini CLA 2011-02-06 11:27:22 EST
Build Identifier: 20100917-0705

there is a programming error at both GraphModelFactory and AbstractStylingModelFactory that makes graphs that use IFigureProvider for customizing nodes to have duplicated nodes.

in GraphModelFactory:

if (source == null) {
					// just create the node for the destination
					if (dest != null) {
						if (figureProvider != null) {
							createNode(model, dest, figureProvider.getFigure(dest));
						} else {
							createNode(model, dest);
						}
					}
					continue;
				} else if (dest == null) {
					// just create the node for the source
					if (source != null) {
						if (figureProvider != null) {
							createNode(model, source, figureProvider.getFigure(dest));<-- Should be source here.
						} else {
							createNode(model, source);
						}
					}
					continue;
				}

in AbstractStylingModelFactory:

              if (sn == null) {
			IFigure figure = null;
			if (figureProvider != null) {
				figure = figureProvider.getFigure(source);
			}
			if (figure != null) {
				sn = createNode(graph, source, figure);
			} else {
				sn = createNode(graph, source);
			}
		}
		if (dn == null) {
			IFigure figure = null;
			if (figureProvider != null) {
				figure = figureProvider.getFigure(source);<-- should be dest here
			}
			if (figure != null) {
				dn = createNode(graph, dest, figure);
			} else {
				dn = createNode(graph, dest);
			}
		}

Reproducible: Always
Comment 1 Fabian Steeg CLA 2011-02-06 21:12:08 EST
Could you attach a snippet that hits this issue? I tried reproducing it but the sample with IFigureProvider I ran doesn't enter GraphModelFactory#doBuildGraph.
Comment 2 alejandrocorbellini CLA 2011-02-06 22:13:15 EST
Created attachment 188418 [details]
Duplicated Nodes Test

Here it goes. Maybe i'm using graphviewer the wrong way.
Comment 3 Fabian Steeg CLA 2011-02-08 15:46:46 EST
Thanks Alejandro!

Fixed in HEAD and Zest 2.0 master (see IFigureProviderTests).