Bug 238118 - UUIDConstraint don't apply for resources that don't use ID or UUID
Summary: UUIDConstraint don't apply for resources that don't use ID or UUID
Status: RESOLVED FIXED
Alias: None
Product: GMF-Runtime
Classification: Modeling
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal
Target Milestone: 2.1.1   Edit
Assignee: Anthony Hunter CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2008-06-23 10:33 EDT by Laurent LE GOFF CLA
Modified: 2011-05-17 17:41 EDT (History)
6 users (show)

See Also:


Attachments
Patch file for UUIDConstraint.java (1.23 KB, patch)
2008-06-26 13:09 EDT, Geoff Martin CLA
ahunter.eclipse: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Laurent LE GOFF CLA 2008-06-23 10:33:04 EDT
Build ID: M20080221-1800

Steps To Reproduce:
see http://www.eclipse.org/newsportal/article.php?id=13664&group=eclipse.modeling.gmf#13664

extract of the thread below:
...
I know something of the history of this constraint.

The purpose of this constraint (despite its name) is to ensure that no object in an ID-based XMLResource is "shadowed" or "unreferenceable" because of multiple objects having the same "x[sm]i:id" attribute value in the same resource.  It isn't concerned with more general URI fragments.

When multiple objects have the same ID, then the ID occurs multiple times as a value in the EObject-to-ID map.  However, looking objects up by ID can only find one of these objects because the ID-to-EObject map necessarily only contains the ID once.  So, this constraint points the user to those elements that are "shadowed."

In the case that a resource does not use IDs or has some subset of objects that don't have IDs, then looking up such an object in the EObject-to-ID map should return null.  Looking up null in the ID-to-EObject map would be expected to return null, also.  So, then, clearly eObject != null causes a failure.

To fix this problem, I think it is only necessary that if looking up the ID returns null, then nothing further should be done because when there is no ID there cannot be any shadowing.
...




More information:
Comment 1 Geoff Martin CLA 2008-06-26 13:09:00 EDT
Created attachment 105936 [details]
Patch file for UUIDConstraint.java

This patch checks to see if the returned ID is null. If it is it simply return successfully from the constraint.
Comment 2 Richard Gronback CLA 2008-06-26 13:28:43 EDT
Goeff, can you send me your contact info for our IP log?  I just need address and phone (work is fine).

Thanks,
Rich
Comment 3 Anthony Hunter CLA 2008-07-08 15:10:17 EDT
(In reply to comment #2)
> Goeff, can you send me your contact info for our IP log?  I just need address
> and phone (work is fine).
> 
> Thanks,
> Rich
> 

Hi Rich, Did we get this information?
Comment 4 Richard Gronback CLA 2008-07-08 15:13:53 EDT
(In reply to comment #3)
> (In reply to comment #2)
> > Goeff, can you send me your contact info for our IP log?  I just need address
> > and phone (work is fine).
> > 
> > Thanks,
> > Rich
> > 
> 
> Hi Rich, Did we get this information?
> 

Yes, but then I asked Bjorn if we still need to keep such information with the new IP logging that the Foundation provides and he said we didn't.  Good news.
Comment 5 Anthony Hunter CLA 2008-07-08 15:47:28 EDT
Committed to HEAD and R2_1_maintenance.
Comment 6 Eclipse Webmaster CLA 2010-07-19 12:24:28 EDT
[GMF Restructure] Bug 319140 : product GMF and component
Runtime EMF was the original product and component for this bug