You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by wu...@apache.org on 2019/05/25 05:27:33 UTC

[skywalking] branch master updated: Unified toPath method (#2754)

This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking.git


The following commit(s) were added to refs/heads/master by this push:
     new e0827e3  Unified toPath method (#2754)
e0827e3 is described below

commit e0827e30eaf56d672786a86b2413ccf572bfb249
Author: 于玉桔 <76...@qq.com>
AuthorDate: Sat May 25 13:27:27 2019 +0800

    Unified toPath method (#2754)
---
 .../plugin/resteasy/v3/server/SynchronousDispatcherInterceptor.java  | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/apm-sniffer/apm-sdk-plugin/resteasy-plugin/resteasy-server-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/resteasy/v3/server/SynchronousDispatcherInterceptor.java b/apm-sniffer/apm-sdk-plugin/resteasy-plugin/resteasy-server-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/resteasy/v3/server/SynchronousDispatcherInterceptor.java
index eec9673..62da345 100644
--- a/apm-sniffer/apm-sdk-plugin/resteasy-plugin/resteasy-server-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/resteasy/v3/server/SynchronousDispatcherInterceptor.java
+++ b/apm-sniffer/apm-sdk-plugin/resteasy-plugin/resteasy-server-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/resteasy/v3/server/SynchronousDispatcherInterceptor.java
@@ -77,8 +77,9 @@ public class SynchronousDispatcherInterceptor implements InstanceMethodsAroundIn
     }
 
     private static String toPath(String uri) {
-        if (uri.contains("?")) {
-            return uri.substring(0, uri.indexOf("?"));
+        int index = uri.indexOf("?");
+        if (index > -1) {
+            return uri.substring(0, index);
         } else {
             return uri;
         }