| Summary: | Some GraphNode constructors ignore 'data' parameter | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Tools] GEF | Reporter: | Stefan Tucker <stefan.tucker> | ||||||
| Component: | GEF-Legacy Zest | Assignee: | Ian Bull <irbull> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | irbull | ||||||
| Version: | 3.4 | ||||||||
| Target Milestone: | --- | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows Server 2003 | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
Created attachment 105134 [details]
org.eclipse.zest.core
Patch to fix this.
Created attachment 105135 [details]
mylyn/context/zip
Thanks for pointing this out. I have cleaned up the constructors so they are properly chained. |
The following GraphNode constructors do not pass the 'data' parameter to the super constructor. This prevents the data member from being set. GraphNode(IContainer graphModel, int style, String text, Object data) GraphNode(IContainer graphModel, int style, String text, Image image, Object data) The fix is to modify the following lines: 105#super(graphModel.getGraph(), style); to 105#super(graphModel.getGraph(), style, data); and 126#super(graphModel.getGraph(), style); to 126#super(graphModel.getGraph(), style, data); The workaround is to call setData(data) after constructing an object. If the ctors collapsed so that the more general ones call the more specific ones (with " " and null), this can be fixed in one place. public GraphNode(IContainer graphModel, int style, Object data) { this(graphModel, style, " " /*text*/, null /*image*/, data); } public GraphNode(IContainer graphModel, int style, String text, Object data) { this(graphModel, style, text, null /*image*/, data); }