Problem with SetCommand and unsettable Multi EReference [message #1701644] |
Tue, 14 July 2015 15:43 |
|
I have an EClass with an unsettable multi EReference. When I create a new instance the reference is unset.
Now when I use a set command with an empty list, my expectation would be that after the command was executed, the feature is set.
However this is not the case, because on creation the SetCommand internally creates an IdentityCommand, since the old value and the new value are both empty.
Is this a bug or am I missing something important? I attached my test-projects including a test case. I was using a regular Mars Modeling Edition as the target.
Thanks,
Johannes
testObject = FooFactory.eINSTANCE.createTestObject();
assertFalse(testObject.isSetUnsettableMultiContainment());
Command command = SetCommand.create(editingDomain, testObject,
FooPackage.eINSTANCE.getTestObject_UnsettableMultiContainment(), Collections.emptyList());
commandStack.execute(command);
assertTrue(testObject.isSetUnsettableMultiContainment()); // fails here
Johannes Faltermeier
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
|
|
|
Re: Problem with SetCommand and unsettable Multi EReference [message #1701654 is a reply to message #1701644] |
Tue, 14 July 2015 17:07 |
Ed Merks Messages: 33141 Registered: July 2009 |
Senior Member |
|
|
That sounds like a bug. Please open a bugzilla.
On 14/07/2015 5:43 PM, Johannes Faltermeier wrote:
> I have an EClass with an unsettable multi EReference. When I create a new instance the reference is unset.
> Now when I use a set command with an empty list, my expectation would be that after the command was executed, the feature is set.
> However this is not the case, because on creation the SetCommand internally creates an IdentityCommand, since the old value and the new value are both empty.
> Is this a bug or am I missing something important? I attached my test-projects including a test case. I was using a regular Mars Modeling Edition as the target.
>
> Thanks,
> Johannes
>
>
> testObject = FooFactory.eINSTANCE.createTestObject();
> assertFalse(testObject.isSetUnsettableMultiContainment());
> Command command = SetCommand.create(editingDomain, testObject,
> FooPackage.eINSTANCE.getTestObject_UnsettableMultiContainment(), Collections.emptyList());
> commandStack.execute(command);
> assertTrue(testObject.isSetUnsettableMultiContainment()); // fails here
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
Powered by
FUDForum. Page generated in 0.03423 seconds