Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Duplicate UUID's from EcoreUtil.UUID im my GMF diagram
Duplicate UUID's from EcoreUtil.UUID im my GMF diagram [message #428594] Tue, 24 March 2009 23:21 Go to next message
Brian Jakubik is currently offline Brian JakubikFriend
Messages: 140
Registered: July 2009
Senior Member
In my GMF diagram wizard, we go and initialize the contents of a the
diagram with some default nodes, connections and values, and randomly, I
get a diagram with a duplicate UUID. It just so happens that the UUID
in question is the target for my connection so it does not show, and
Ironically enough, its appears to always be on the same element and same
connection. If I debug it, it does not happen, so I'm pulling out my
hair trying to figure this out.

Ive looked at the EcoreUtil UUID generate(), and from what I can tell,
it looks like it always should return something unique, is that not
always the case?

Any ideas?

Thanks
Brian Jakubik
Re: Duplicate UUID's from EcoreUtil.UUID im my GMF diagram [message #428597 is a reply to message #428594] Wed, 25 March 2009 00:48 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Brian,

Comments below.

Brian Jakubik wrote:
> In my GMF diagram wizard, we go and initialize the contents of a the
> diagram with some default nodes, connections and values, and randomly,
> I get a diagram with a duplicate UUID. It just so happens that the
> UUID in question is the target for my connection so it does not show,
> and Ironically enough, its appears to always be on the same element
> and same connection.
That hardly sounds random, does it?
> If I debug it, it does not happen, so I'm pulling out my hair trying
> to figure this out.
That sounds painful. Hopefully you're still young and the hairs will
grow back.
>
> Ive looked at the EcoreUtil UUID generate(), and from what I can tell,
> it looks like it always should return something unique, is that not
> always the case?
I'll bet you'd be hard pressed to write a test case that shows
otherwise. The code will actually make your test case wait for it to get
a unique one.
>
> Any ideas?
Not a clue. Probably there's something interesting and relevant missing
from the description...
>
> Thanks
> Brian Jakubik


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Duplicate UUID's from EcoreUtil.UUID im my GMF diagram [message #428602 is a reply to message #428594] Wed, 25 March 2009 10:43 Go to previous messageGo to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 676
Registered: July 2009
Senior Member
Hey Brian,

don't be offended, but did you check twice that the UUID's are
identical? I once was shocked, seeing duplicate uuid's all over my
model. At a closer look I proved they were actually unique... Somehow
the eye seems to compare such cryptic patterns in large chunks and it's
easy to miss differences at the character level.

Felix
Re: Duplicate UUID's from EcoreUtil.UUID im my GMF diagram [message #428608 is a reply to message #428602] Wed, 25 March 2009 12:03 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Felix,

And this is yet another reason I don't like UUIDs. A serialization
using them is like an eye chart where even 20/20 vision doesn't actually
help to bring it into focus. And that's on top of the fact that XML
itself is generally unfit for human consumption to begin with. Textual
DSLs I say! Xtext all the way!!


Felix Dorner wrote:
> Hey Brian,
>
> don't be offended, but did you check twice that the UUID's are
> identical? I once was shocked, seeing duplicate uuid's all over my
> model. At a closer look I proved they were actually unique... Somehow
> the eye seems to compare such cryptic patterns in large chunks and
> it's easy to miss differences at the character level.
>
> Felix


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Duplicate UUID's from EcoreUtil.UUID im my GMF diagram [message #428611 is a reply to message #428594] Wed, 25 March 2009 12:34 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: give.a.damus.gmail.com

--=-xtXBijSuCXiTOBRizMl5
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi, Brian,

There's nothing to prevent an application from assigning the same ID to
two objects in the same resource (regardless of how the ID is
generated). The eObjectToIdMap will have two occurrences of the same
ID, but the idToEObjectMap can only have one, mapping to one of your
objects. The other is "shadowed." This could definitely cause the
diagram to become confused when a reference resolves to the wrong
object.

This sounds like some kind of duplication or copy/paste operation was a
little too zealous in dealing with IDs?

HTH,

Christian


On Tue, 2009-03-24 at 18:21 -0500, Brian Jakubik wrote:

> In my GMF diagram wizard, we go and initialize the contents of a the
> diagram with some default nodes, connections and values, and randomly, I
> get a diagram with a duplicate UUID. It just so happens that the UUID
> in question is the target for my connection so it does not show, and
> Ironically enough, its appears to always be on the same element and same
> connection. If I debug it, it does not happen, so I'm pulling out my
> hair trying to figure this out.
>
> Ive looked at the EcoreUtil UUID generate(), and from what I can tell,
> it looks like it always should return something unique, is that not
> always the case?
>
> Any ideas?
>
> Thanks
> Brian Jakubik

--=-xtXBijSuCXiTOBRizMl5
Content-Type: text/html; charset="utf-8"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.24.1.1">
</HEAD>
<BODY>
Hi, Brian,<BR>
<BR>
There's nothing to prevent an application from assigning the same ID to two objects in the same resource (regardless of how the ID is generated).&nbsp; The eObjectToIdMap will have two occurrences of the same ID, but the idToEObjectMap can only have one, mapping to one of your objects.&nbsp; The other is &quot;shadowed.&quot;&nbsp; This could definitely cause the diagram to become confused when a reference resolves to the wrong object.<BR>
<BR>
This sounds like some kind of duplication or copy/paste operation was a little too zealous in dealing with IDs?<BR>
<BR>
HTH,<BR>
<BR>
Christian<BR>
<BR>
<BR>
On Tue, 2009-03-24 at 18:21 -0500, Brian Jakubik wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
In my GMF diagram wizard, we go and initialize the contents of a the
diagram with some default nodes, connections and values, and randomly, I
get a diagram with a duplicate UUID. It just so happens that the UUID
in question is the target for my connection so it does not show, and
Ironically enough, its appears to always be on the same element and same
connection. If I debug it, it does not happen, so I'm pulling out my
hair trying to figure this out.

Ive looked at the EcoreUtil UUID generate(), and from what I can tell,
it looks like it always should return something unique, is that not
always the case?

Any ideas?

Thanks
Brian Jakubik
</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>

--=-xtXBijSuCXiTOBRizMl5--
Re: Duplicate UUID's from EcoreUtil.UUID im my GMF diagram [message #428626 is a reply to message #428602] Wed, 25 March 2009 14:39 Go to previous messageGo to next message
Brian Jakubik is currently offline Brian JakubikFriend
Messages: 140
Registered: July 2009
Senior Member
Yes, they are duplicate. All the UUID's are very similar, but using
find in my text editor reveals it is identical.

Felix Dorner wrote:
> Hey Brian,
>
> don't be offended, but did you check twice that the UUID's are
> identical? I once was shocked, seeing duplicate uuid's all over my
> model. At a closer look I proved they were actually unique... Somehow
> the eye seems to compare such cryptic patterns in large chunks and it's
> easy to miss differences at the character level.
>
> Felix
Re: Duplicate UUID's from EcoreUtil.UUID im my GMF diagram [message #428628 is a reply to message #428611] Wed, 25 March 2009 14:45 Go to previous message
Brian Jakubik is currently offline Brian JakubikFriend
Messages: 140
Registered: July 2009
Senior Member
Sounds exactly what is happening here, Ill look into it more, and
hopefully try to come to a resolution.

Christian W. Damus wrote:
> Hi, Brian,
>
> There's nothing to prevent an application from assigning the same ID to
> two objects in the same resource (regardless of how the ID is
> generated). The eObjectToIdMap will have two occurrences of the same
> ID, but the idToEObjectMap can only have one, mapping to one of your
> objects. The other is "shadowed." This could definitely cause the
> diagram to become confused when a reference resolves to the wrong object.
>
> This sounds like some kind of duplication or copy/paste operation was a
> little too zealous in dealing with IDs?
>
> HTH,
>
> Christian
>
>
> On Tue, 2009-03-24 at 18:21 -0500, Brian Jakubik wrote:
>> In my GMF diagram wizard, we go and initialize the contents of a the
>> diagram with some default nodes, connections and values, and randomly, I
>> get a diagram with a duplicate UUID. It just so happens that the UUID
>> in question is the target for my connection so it does not show, and
>> Ironically enough, its appears to always be on the same element and same
>> connection. If I debug it, it does not happen, so I'm pulling out my
>> hair trying to figure this out.
>>
>> Ive looked at the EcoreUtil UUID generate(), and from what I can tell,
>> it looks like it always should return something unique, is that not
>> always the case?
>>
>> Any ideas?
>>
>> Thanks
>> Brian Jakubik
Previous Topic:On the subject of EMaps
Next Topic:Re: Mix-Ins in EMF
Goto Forum:
  


Current Time: Fri Apr 26 12:46:05 GMT 2024

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

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

Back to the top