Community
Participate
Working Groups
Build ID: 20090619-0625 Steps To Reproduce: 1. Create a new Ecore-Diagram 2. Create 2 EClass-Objects 3. Change the background-color of EClass-Object A 4. Select both EClass-Objects and trigger Copy Appearance Properties 5. Error More information: After some investigation it seems, that in org.eclipse.gmf.runtime.diagram.core.util.ViewRefactorHelper#copyViewStyle(View oldView, View newView, Style oldStyle, List excludeStyles) the error occurs. Since the default value for GradientStyle is null, it tries copy null, if the node A has no gradient set yet, which then causes the error. Attached path simply adds a check, if the old value is null. However this is just a quick fix, because it does not override a gradient of object a, if gradient of object b is not set yet. Therefor the default-value of FillStyleImpl#GRADIENT_EDEFAULT should be reconsidered.
Created attachment 140099 [details] Patch
I'd suggest to check if the feature value isSet() then set it if it is instead of a null check.
Created attachment 140189 [details] Patch
I think both approaches don't cover all use cases. Let's say there are 2 elements with a FillStyle. Element A has the GradientStyle set, element B has not. Now I would select element B first and then element A, and invoke copy appearance properties. So the styles of B should get copied into A. The null-check resp. check if the feature is set would always avoid the resetting of the GradientStyle of element A. Attached patch above should take this idea into consideration and use appropriate EMF-methods instead of null-checks.
Yes, we do need to unset the feature on a new style if it is unset on the old one. Good catch.
Committed Thomas's patch to HEAD and Maintenance streams for 2.2.1
[GMF Restructure] Bug 319140 : product GMF and component Runtime Diagram was the original product and component for this bug