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 11:59:59 GMT
Repository: cxf
Updated Branches:
  refs/heads/master b9191338f -> 8133fdf3b


[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/8133fdf3
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/8133fdf3
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/8133fdf3

Branch: refs/heads/master
Commit: 8133fdf3b93382f03fd9f0f3da4c22d6d3db44cf
Parents: b919133
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 12:59:45 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/8133fdf3/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 24209e9..766dc8a 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/8133fdf3/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 39ae674..a50e111 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