Skip to main content



      Home
Home » Modeling » EMF » Problem with SetCommand and unsettable Multi EReference
Problem with SetCommand and unsettable Multi EReference [message #1701644] Tue, 14 July 2015 11:43 Go to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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
>
Re: Problem with SetCommand and unsettable Multi EReference [message #1701842 is a reply to message #1701654] Thu, 16 July 2015 03:40 Go to previous message
Eclipse UserFriend
For reference: https://bugs.eclipse.org/bugs/show_bug.cgi?id=472796
Previous Topic:[Ecore] xsd2ecore files not readable any longer after migration to Mars
Next Topic:[CDO] Multi-threaded access and CommitConflicts
Goto Forum:
  


Current Time: Fri Jul 25 01:35:46 EDT 2025

Powered by FUDForum. Page generated in 0.03641 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top