Problem with SetCommand and unsettable Multi EReference [message #1701644] |
Tue, 14 July 2015 11:43  |
Eclipse User |
|
|
|
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
|
|
|
Re: Problem with SetCommand and unsettable Multi EReference [message #1701654 is a reply to message #1701644] |
Tue, 14 July 2015 13:07   |
Eclipse User |
|
|
|
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
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.04095 seconds