Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 311633 - [ui] RepositoryTracker duplicate checking should consult the repo manager
Summary: [ui] RepositoryTracker duplicate checking should consult the repo manager
Status: VERIFIED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 3.7 M5   Edit
Assignee: Susan McCourt CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-04 16:59 EDT by Susan McCourt CLA
Modified: 2011-01-25 15:12 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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