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-7210] Fix StringIndexOutOfBoundsException
Date Thu, 12 Jan 2017 12:54:02 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes 1338469f7 -> a25fda846


[CXF-7210] Fix StringIndexOutOfBoundsException

Signed-off-by: Sebastian Hoß <mail@shoss.de>
(cherry picked from commit 1a8ae7afb254b77118aba543df2a720547a3ccf2)


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

Branch: refs/heads/3.0.x-fixes
Commit: a25fda846ac944a14b4f31569bb9158936778643
Parents: 1338469
Author: Sebastian Hoß <mail@shoss.de>
Authored: Wed Jan 11 13:39:31 2017 +0100
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Thu Jan 12 12:53:41 2017 +0000

----------------------------------------------------------------------
 .../main/java/org/apache/cxf/jaxrs/client/AbstractClient.java  | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/a25fda84/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
----------------------------------------------------------------------
diff --git a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
index 11d1246..0c9759e 100644
--- a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
+++ b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
@@ -647,8 +647,10 @@ public abstract class AbstractClient implements Client {
         String reqURIPath = requestURI.getRawPath();
         
         UriBuilder builder = new UriBuilderImpl().uri(newBaseURI);
-        String basePath = reqURIPath.startsWith(baseURIPath) ? baseURIPath : getBaseURI().getRawPath();

-        builder.path(reqURIPath.equals(basePath) ? "" : reqURIPath.substring(basePath.length()));
+        String basePath = reqURIPath.startsWith(baseURIPath) ? baseURIPath : getBaseURI().getRawPath();
+        String relativePath = reqURIPath.equals(basePath) ? ""
+                : reqURIPath.startsWith(basePath) ? reqURIPath.substring(basePath.length())
: reqURIPath;
+        builder.path(relativePath);
         
         String newQuery = newBaseURI.getRawQuery();
         if (newQuery == null) {


Mime
View raw message