cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: [CXF-7417] If the schemaSpecificPart is not null then assume it is an opaque URI update
Date Wed, 21 Jun 2017 12:07:37 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes 13d52fe00 -> eab5aea86


[CXF-7417] If the schemaSpecificPart is not null then assume it is an opaque URI update


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/eab5aea8
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/eab5aea8
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/eab5aea8

Branch: refs/heads/3.0.x-fixes
Commit: eab5aea86e9b722c409991b6f185c83104eb960c
Parents: 13d52fe
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Wed Jun 21 12:59:45 2017 +0100
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Wed Jun 21 13:07:22 2017 +0100

----------------------------------------------------------------------
 .../main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java    | 4 ++--
 .../java/org/apache/cxf/jaxrs/impl/UriBuilderImplTest.java     | 6 ++++++
 2 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/eab5aea8/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java
b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java
index 9d43562..adc2b86 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java
@@ -623,8 +623,8 @@ public class UriBuilderImpl extends UriBuilder implements Cloneable {
             scheme = theScheme;
         }
         String rawPath = uri.getRawPath();
-        if (!uri.isOpaque() 
-            && (theScheme != null || rawPath != null && rawPath.startsWith("/")))
{
+        if (!uri.isOpaque() && schemeSpecificPart == null
+            && (theScheme != null || rawPath != null)) {
             port = uri.getPort();
             host = uri.getHost();
             if (rawPath != null) {

http://git-wip-us.apache.org/repos/asf/cxf/blob/eab5aea8/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriBuilderImplTest.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriBuilderImplTest.java
b/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriBuilderImplTest.java
index e04322d..9a43e8d 100644
--- a/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriBuilderImplTest.java
+++ b/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriBuilderImplTest.java
@@ -43,6 +43,12 @@ import org.junit.Test;
 public class UriBuilderImplTest extends Assert {
 
     @Test
+    public void testFromUriRelativePath() throws Exception {
+        UriBuilder builder = UriBuilder.fromUri("path");
+        URI uri = builder.queryParam("a", "b").build();
+        assertEquals("path?a=b", uri.toString());
+    }
+    @Test
     public void testUriTemplate() throws Exception {
         UriBuilder builder = UriBuilder.fromUri("http://localhost:8080/{a}/{b}");
         URI uri = builder.build("1", "2");


Mime
View raw message