From e0827e30eaf56d672786a86b2413ccf572bfb249 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E7=8E=89=E6=A1=94?= <769213327@qq.com> Date: Sat, 25 May 2019 13:27:27 +0800 Subject: [PATCH] Unified toPath method (#2754) --- .../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 eec9673952..62da345ca9 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; } -- GitLab