Skip to main content



      Home
Home » Modeling » EMF » Placing the same object twice in an EList?
Placing the same object twice in an EList? [message #430209] Wed, 13 May 2009 09:23 Go to next message
Eclipse UserFriend
Hi everyone, I'm rahter new at EMF/ECORE and I wonder if its possible,
to have the same object more than one times in an ELIST. I've set UNIQUE
to False and ORDERED to true, but when trying to place an object a
second time in the EList, an Illegal Argument Exception is thrown:

java.lang.IllegalArgumentException: The 'no duplicates' constraint is
violated

As I could find this should just happen if unique is true, but it isn't.

Is there any way around this problem? This list is used to represent a
Function and thus the single terms may occur more than once.

Thank you in advance,
Daniel
Re: Placing the same object twice in an EList? [message #430214 is a reply to message #430209] Wed, 13 May 2009 09:52 Go to previous messageGo to next message
Eclipse UserFriend
This is a multi-part message in MIME format.
--------------030103080803040300040501
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Daniel,

Comments below.

Daniel Rippel wrote:
> Hi everyone, I'm rahter new at EMF/ECORE and I wonder if its possible,
> to have the same object more than one times in an ELIST. I've set
> UNIQUE to False and ORDERED to true, but when trying to place an
> object a second time in the EList, an Illegal Argument Exception is
> thrown:
>
> java.lang.IllegalArgumentException: The 'no duplicates' constraint is
> violated
>
> As I could find this should just happen if unique is true, but it isn't.
Unfortunately long ago there was a basic assumption that all EObject
lists had to be unique:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=89325

The only workaround right now is to specialize the list implementation
that's created to override isUnique to return true. And I don't
guarantee the rest of the framework will be entirely happy.
>
> Is there any way around this problem? This list is used to represent a
> Function and thus the single terms may occur more than once.
The above only works for non-containment non-bidirectional lists. For
all other cases, it makes no sense...
>
> Thank you in advance,
> Daniel

--------------030103080803040300040501
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Daniel,<br>
<br>
Comments below.<br>
<br>
Daniel Rippel wrote:
<blockquote cite="mid:guehk9$4hj$1@build.eclipse.org" type="cite">Hi
everyone, I'm rahter new at EMF/ECORE and I wonder if its possible, to
have the same object more than one times in an ELIST. I've set UNIQUE
to False and ORDERED to true, but when trying to place an object a
second time in the EList, an Illegal Argument Exception is thrown:
<br>
<br>
java.lang.IllegalArgumentException: The 'no duplicates' constraint is
violated
<br>
<br>
As I could find this should just happen if unique is true, but it
isn't.
<br>
</blockquote>
Unfortunately long ago there was a basic assumption that all EObject
lists had to be unique:<br>
<blockquote><a
href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=89325">https://bugs.eclipse.org/bugs/show_bug.cgi?id=89325</a><br>
</blockquote>
The only workaround right now is to specialize the list implementation
that's created to override isUnique to return true.
Re: Placing the same object twice in an EList? [message #430216 is a reply to message #430214] Wed, 13 May 2009 10:48 Go to previous message
Eclipse UserFriend
Thank you for the quick reply!

The List is non-Containing and only uni-directional (as the Elements the
function may consist of, are derived from other diragrams and stored in
an containment List under the root node.) As I see the bug is out there
for a long time now. I'll see if there is a less invasive method for my
model to cope with this.



Ed Merks schrieb:
> Daniel,
>
> Comments below.
>
> Daniel Rippel wrote:
>> Hi everyone, I'm rahter new at EMF/ECORE and I wonder if its possible,
>> to have the same object more than one times in an ELIST. I've set
>> UNIQUE to False and ORDERED to true, but when trying to place an
>> object a second time in the EList, an Illegal Argument Exception is
>> thrown:
>>
>> java.lang.IllegalArgumentException: The 'no duplicates' constraint is
>> violated
>>
>> As I could find this should just happen if unique is true, but it isn't.
> Unfortunately long ago there was a basic assumption that all EObject
> lists had to be unique:
>
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=89325
>
> The only workaround right now is to specialize the list implementation
> that's created to override isUnique to return true. And I don't
> guarantee the rest of the framework will be entirely happy.
>>
>> Is there any way around this problem? This list is used to represent a
>> Function and thus the single terms may occur more than once.
> The above only works for non-containment non-bidirectional lists. For
> all other cases, it makes no sense...
>>
>> Thank you in advance,
>> Daniel
Previous Topic:Labels including properties of different objects
Next Topic:questions about generated accessor methods
Goto Forum:
  


Current Time: Sat Jul 12 12:10:51 EDT 2025

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

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

Back to the top