Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(155)

Issue 27117: Implement Uri.resolve(Uri) (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
16 years, 6 months ago by johnfargo
Modified:
16 years, 1 month ago
Reviewers:
shindig.remailer, plindner, awiner
Base URL:
https://svn.apache.org/repos/asf/incubator/shindig/trunk/
Visibility:
Public.

Description

Implements method Uri.resolve(Uri). This has two benefits: 1. More efficient than the existing implementation. Using the Uri test class's resolve Uris, this method performed 30-45% better than existing. 2. Removes java.net.URI from the resolve(...) code path. This makes it possible for Uris parsed leniently by an overridden UriParser to be resolvable.

Patch Set 1 #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+87 lines, -2 lines) Patch
java/common/src/main/java/org/apache/shindig/common/uri/Uri.java View 3 chunks +87 lines, -2 lines 6 comments Download

Messages

Total messages: 3
johnfargo
16 years, 6 months ago (2009-03-25 23:33:15 UTC) #1
awiner
Some comments about performance. http://codereview.appspot.com/27117/diff/1/2 File java/common/src/main/java/org/apache/shindig/common/uri/Uri.java (right): http://codereview.appspot.com/27117/diff/1/2#newcode142 Line 142: } else if (authority ...
16 years, 6 months ago (2009-03-26 15:50:55 UTC) #2
plindner
16 years, 6 months ago (2009-03-26 16:01:14 UTC) #3
It might be nice to have some tests.  java.net.Uri has the following:

http://www.google.com/codesearch/p?hl=en#TTY8xLpnKOE/test/java/net/URI/Test.j...

http://codereview.appspot.com/27117/diff/1/2
File java/common/src/main/java/org/apache/shindig/common/uri/Uri.java (right):

http://codereview.appspot.com/27117/diff/1/2#newcode194
Line 194: Collections.addAll(mergePath, otherPath.split("/"));
Suggest using StringUtils.splitPreserveAllTokens or StringUtils.split
(non-regex).

I *think* preserveAllTokens will avoid the if statement below...
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b