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: 101
Registered: December 2013
Senior 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 offline Ed MerksFriend
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/
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: 101
Registered: December 2013
Senior 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: Thu Apr 25 15:30:31 GMT 2024

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

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

Back to the top