cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject cxf git commit: [CXF-7210] Fix StringIndexOutOfBoundsException
Date Thu, 12 Jan 2017 05:57:12 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.1.x-fixes 1db2bf9f4 -> 51ccfe43e


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

Branch: refs/heads/3.1.x-fixes
Commit: 51ccfe43eda48af10310ad9eba8dda1c5107b879
Parents: 1db2bf9
Author: Sebastian Hoß <mail@shoss.de>
Authored: Wed Jan 11 13:39:31 2017 +0100
Committer: Freeman Fang <freeman.fang@gmail.com>
Committed: Thu Jan 12 13:55:14 2017 +0800

----------------------------------------------------------------------
 .../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/51ccfe43/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 b83989f..4a7d277 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
@@ -648,8 +648,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