Bug 237776 - Replace URL by URI
Summary: Replace URL by URI
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: p2 (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal with 1 vote (vote)
Target Milestone: 3.5 M3   Edit
Assignee: John Arthorne CLA
QA Contact:
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks: 121201 248842
  Show dependency tree
 
Reported: 2008-06-19 08:24 EDT by Pascal Rapicault CLA
Modified: 2009-05-28 16:34 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pascal Rapicault CLA 2008-06-19 08:24:23 EDT
When stared on p2, we wanted to use URIs instead of URLs but we drifted and ended up using URLs only.
In 3.5, we need to revisit this and avoid using URLs because:
 1) they force a corresponding protocol to be registered
 2) comparing URL can be extremely slow in some environments

A few additional issues to think about when doing this replacement:
 - URI/URL encoding and decoding
 - Eclipse in UNC paths environments 
 - Dealing with path math
Comment 1 Thomas Hallgren CLA 2008-06-30 06:16:58 EDT
One interesting aspect of using URI's would be if the URI scheme was used when finding repository factories. Will that be covered within the scope of this bug?
Comment 2 John Arthorne CLA 2008-07-01 11:54:37 EDT
This is possible, but it can't be the only way to distinguish repository types. For example we already have several repository factories that use the "http" scheme. See also bug 177231.
Comment 3 John Arthorne CLA 2008-10-08 23:29:36 EDT
This is released. Some random notes:

- Tagged p2.* with tag "v20081008_pre_uri_switch" before releasing.
- Changed code using URL.toExternalForm() for equals/hashCode to use URI.equals/hashCode directly, since these methods are not expensive
- Added class URIUtil with various convenience methods to help construct and manipulate URIs
- Have not touched fwAdmin or simpleconfigurator which also do URL manipulation
- Fields, methods, and variables containing "url" were renamed to use "location" or "repoLocation" instead. I'm sure I've missed some of these.
- repository locations are now stored in the preference store in encoded URI form. There is backwards compatibility code for reading unencoded URLs from preferences if there is no URI available
- Entered bug 250219 with patch to fix references in PDE.
- Various tests added for different flavours of problematic URIs. Tests involving metadata repos, artifact repos, and update sites with spaces in their paths were added. a URIUtilTest class was added for testing corner cases of the convenience methods.

I'm going to close this bug, and we can open new bugs for the inevitable issues that come up.