Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Problem with SetCommand and unsettable Multi EReference
Problem with SetCommand and unsettable Multi EReference [message #1701644] Tue, 14 July 2015 15:43 Go to next message
Johannes Faltermeier is currently offline Johannes FaltermeierFriend
Messages: 92
Registered: December 2013
Member

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 Go to previous messageGo to next message
Ed Merks is currently online Ed MerksFriend
Messages: 30372
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
>
Re: Problem with SetCommand and unsettable Multi EReference [message #1701842 is a reply to message #1701654] Thu, 16 July 2015 07:40 Go to previous message
Johannes Faltermeier is currently offline Johannes FaltermeierFriend
Messages: 92
Registered: December 2013
Member

For reference: https://bugs.eclipse.org/bugs/show_bug.cgi?id=472796

Johannes Faltermeier

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
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 Aug 23 09:19:36 GMT 2019

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

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

Back to the top