You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by dk...@apache.org on 2011/12/22 16:49:27 UTC

svn commit: r1222290 - in /camel/branches/camel-2.8.x: ./ camel-core/src/main/java/org/apache/camel/util/URISupport.java camel-core/src/test/java/org/apache/camel/util/URISupportTest.java

Author: dkulp
Date: Thu Dec 22 15:49:27 2011
New Revision: 1222290

URL: http://svn.apache.org/viewvc?rev=1222290&view=rev
Log:
Merged revisions 1206660 via svnmerge from 
https://svn.apache.org/repos/asf/camel/trunk

........
  r1206660 | hadrian | 2011-11-26 22:26:46 -0500 (Sat, 26 Nov 2011) | 1 line
  
  CAMEL-4601. Patch applied with thank to Bilgin
........

Modified:
    camel/branches/camel-2.8.x/   (props changed)
    camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/util/URISupport.java
    camel/branches/camel-2.8.x/camel-core/src/test/java/org/apache/camel/util/URISupportTest.java

Propchange: camel/branches/camel-2.8.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/util/URISupport.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/util/URISupport.java?rev=1222290&r1=1222289&r2=1222290&view=diff
==============================================================================
--- camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/util/URISupport.java (original)
+++ camel/branches/camel-2.8.x/camel-core/src/main/java/org/apache/camel/util/URISupport.java Thu Dec 22 15:49:27 2011
@@ -143,7 +143,7 @@ public final class URISupport {
         if (query != null) {
             s = s + "?" + query;
         }
-        if (uri.getFragment() != null) {
+        if ((!s.contains("#")) && (uri.getFragment() != null)) {
             s = s + "#" + uri.getFragment();
         }
 

Modified: camel/branches/camel-2.8.x/camel-core/src/test/java/org/apache/camel/util/URISupportTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/camel-core/src/test/java/org/apache/camel/util/URISupportTest.java?rev=1222290&r1=1222289&r2=1222290&view=diff
==============================================================================
--- camel/branches/camel-2.8.x/camel-core/src/test/java/org/apache/camel/util/URISupportTest.java (original)
+++ camel/branches/camel-2.8.x/camel-core/src/test/java/org/apache/camel/util/URISupportTest.java Thu Dec 22 15:49:27 2011
@@ -106,6 +106,13 @@ public class URISupportTest extends Cont
         assertEquals("http://camel.apache.org?foo=123", s);
     }
 
+    public void testCreateURIWithQueryHasOneFragment() throws Exception {
+        URI uri = new URI("smtp://localhost#fragmentOne");
+        URI resultUri = URISupport.createURIWithQuery(uri, null);
+        assertNotNull(resultUri);
+        assertEquals("smtp://localhost#fragmentOne", resultUri.toString());
+    }
+
     public void testNormalizeEndpointWithEqualSignInParameter() throws Exception {
         String out = URISupport.normalizeUri("jms:queue:foo?selector=somekey='somevalue'&foo=bar");
         assertNotNull(out);