Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 352727

Summary: Make StatisticBasedSimilarityChecker.hasSameUri(EObject, EObject) protected
Product: [Modeling] EMFCompare Reporter: Victor Roldan Betancort <vroldanbet>
Component: CoreAssignee: EMF Compare <emf.compare-inbox>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: laurent.goubet, vroldanbet
Version: 1.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
patch v1 laurent.goubet: iplog+, laurent.goubet: review+

Description Victor Roldan Betancort CLA 2011-07-21 07:42:56 EDT
hasSameURI method determines if 2 EObjects have the same uri fragment, this means, they are located in the same place in an equally equivalent tree structure.

This method doesn't seem to work well with CDOObject, because URI fragments contain an UUID called CDOID, so this method returns always false, and decreases the chances of 2 objects to be matched accordding to the heuristics at StatisticBasedSimilarityChecker.

My proposal is to make this method protected so it can be overriden upon subclassing of StatisticBasedSimilarityChecker.
Comment 1 Victor Roldan Betancort CLA 2011-07-21 07:44:34 EDT
Guys, I was planning to provide a patch. I synced with CVS HEAD, but found that plugins are still versioned to 1.1.1.qualifier. Is this an error, or is it expected to be like that?
Comment 2 Victor Roldan Betancort CLA 2011-07-21 08:35:03 EDT
Created attachment 200083 [details]
patch v1

- changed visibility of StatisticBasedSimilarityChecker.hasSameUri() from private to protected
Comment 3 Laurent Goubet CLA 2011-07-21 08:51:25 EDT
Victor,

The development of EMF Compare no longer take place on CVS, but on Git. You can find information about the repository on http://wiki.eclipse.org/EMF_Compare/Contributor_Guide#Checking_out_the_code .

The git repository of EMF Compare is also replicated on github : https://github.com/eclipse/emf.compare
Comment 4 Victor Roldan Betancort CLA 2011-07-21 08:52:31 EDT
Argh, I patched too fast :P Don't know how to use Git, but will be a pleasure to learn how to :)

(In reply to comment #3)
> Victor,
> 
> The development of EMF Compare no longer take place on CVS, but on Git. You can
> find information about the repository on
> http://wiki.eclipse.org/EMF_Compare/Contributor_Guide#Checking_out_the_code .
> 
> The git repository of EMF Compare is also replicated on github :
> https://github.com/eclipse/emf.compare
Comment 5 Laurent Goubet CLA 2011-07-21 08:55:41 EDT
I think I can use the patches against CVS : the patch is small enough, and the code of this class hasn't changed so much that the patch cannot be applied.

I'll come back to you if the patch cannot be applied on the current Git HEAD ;).
Comment 6 Victor Roldan Betancort CLA 2011-07-21 08:57:10 EDT
It's no problem, it is a good excuse to play with git! ;)
Comment 7 Laurent Goubet CLA 2011-07-21 11:30:40 EDT
Thanks, this has now been pushed on master.