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

Bug 311633

Summary: [ui] RepositoryTracker duplicate checking should consult the repo manager
Product: [Eclipse Project] Equinox Reporter: Susan McCourt <susan>
Component: p2Assignee: Susan McCourt <susan>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.6   
Target Milestone: 3.7 M5   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Susan McCourt CLA 2010-05-04 16:59:50 EDT
There is code in RepositoryTracker.validateRepositoryLocation(...) that attempts to detect duplicate repository locations.  This code was written before we had IRepositoryManager.contains(URI), so the code goes through all the known repos and does URIUtil.sameURI.

This code doesn't detect any tricks done by the repo manager (such as removing slashes) to detect whether a repo URL can be considered already known.

The right thing to do is to call the manager.contains API to find duplicates.  At the abstract class level, this probably means a protected method called

contains(URI location)

that would do the old code, and the subclasses could use the manager API to make the computation.

This would be a better fix for bug 268580 than what I'll end up doing for 3.6
Comment 1 Susan McCourt CLA 2010-12-01 11:27:29 EST
these bugs will be my holiday projects...
Comment 2 Susan McCourt CLA 2010-12-20 17:42:42 EST
fixed in HEAD >20101220.
I was hoping to get rid of the specialized code for fixing bug 268580.
I was able to get rid of some odd code in ColocatedRepositoryTracker, but I was not able to get rid of the special checking for the $/ character in the RepositoryManipulationPage's local cache tracker.  The reason is simply that if the repo hasn't really been added yet (it's just been added on the pref page) we can't rely on the manager to figure out which addresses match.  That would take some kind of utility method API on the managers where you could check addresses without actually adding them.  I can live with special handling in the UI for this case since the repo list is managed by the UI until actually applied.

At least we are doing the right thing now in the trackers.
Comment 3 Susan McCourt CLA 2011-01-25 15:12:09 EST
verified through source inspection, I20110124-1800