Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 367204 - AbstractFeatureProvider's addIfPossible method always returns null
Summary: AbstractFeatureProvider's addIfPossible method always returns null
Status: CLOSED FIXED
Alias: None
Product: Graphiti
Classification: Modeling
Component: Core (show other bugs)
Version: 0.8.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 0.9.0   Edit
Assignee: Michael Wenz CLA
QA Contact:
URL:
Whiteboard: Juno M5 Theme_bugs
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-20 10:53 EST by Rhett Hudson CLA
Modified: 2012-06-29 04:17 EDT (History)
2 users (show)

See Also:
michael.wenz: juno+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rhett Hudson CLA 2011-12-20 10:53:04 EST
Build Identifier: 20110916-0149

The addIfPossible method of AbstractFeatureProvider always returns null. It looks like this commit http://git.eclipse.org/c/gmp/org.eclipse.gmp.graphiti.git/commit/plugins/org.eclipse.graphiti/src/org/eclipse/graphiti/features/impl/AbstractFeatureProvider.java?id=17f492ad5b4c29d17d08c2f0a5b865c866e47c29, removed the conditional block that performed an assignment to the local ret variable. In the current code, the only assignment to the ret variable is the initialization to null.

Previously, the method returned the newly added PictogramElement.

Reproducible: Always
Comment 1 Michael Wenz CLA 2011-12-29 10:27:29 EST
I fixed this by adding a return value to the method executeFeature in IDiagramEditor. The implementation in DiagramEditor returns the added PE in case of an add feature being executed, in all other cases it continues to return null.
The method addIfPossible grabs that return value and itself returns it. Also added a test case for this in GFOtherTests (testAddReturnsAddedPictogramElement).
Checked in and pushed to Eclipse:
commit 70c4695586a0f149d4f618bc797f60296c29c7d7
Author: mwenz <michael.wenz@sap.com> 2011-12-29 16:23:26
Committer: mwenz <michael.wenz@sap.com> 2011-12-29 16:23:38
Parent: ace4106947b31ad291bf068ca0c260c7a79ee2ce (.)
Branches: origin/master, master
Comment 2 Michael Wenz CLA 2012-04-11 10:50:54 EDT
Bookkeeping: Set target release
Comment 3 Michael Wenz CLA 2012-06-29 04:17:54 EDT
Part of Graphiti 0.9.0 (Eclipse Juno)