You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2019/08/28 05:42:05 UTC

[GitHub] [skywalking] stalary commented on a change in pull request #3357: ADD: add operationName length threshold

stalary commented on a change in pull request #3357: ADD: add operationName length threshold
URL: https://github.com/apache/skywalking/pull/3357#discussion_r318400159
 
 

 ##########
 File path: apm-commons/apm-util/src/main/java/org/apache/skywalking/apm/util/StringUtil.java
 ##########
 @@ -62,4 +64,11 @@ public static boolean substringMatch(CharSequence str, int index, CharSequence s
         }
         return true;
     }
+
+    public static String cut(String str, int threshold) {
+        if (isEmpty(str) || str.getBytes().length <= threshold) {
+            return str;
+        }
+        return new String(Arrays.copyOf(str.getBytes(), threshold));
 
 Review comment:
   ok,I will modify it later.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services