From 8250dffde07ca1044c72d5f866fa707a918b0508 Mon Sep 17 00:00:00 2001 From: huangwei5 Date: Wed, 19 Sep 2018 11:17:28 +0800 Subject: [PATCH] tools: fix Toollet static{} --- src/test/java/com/xiaomi/infra/pegasus/tools/Toollet.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/xiaomi/infra/pegasus/tools/Toollet.java b/src/test/java/com/xiaomi/infra/pegasus/tools/Toollet.java index 97dd307e..bfbad6e6 100644 --- a/src/test/java/com/xiaomi/infra/pegasus/tools/Toollet.java +++ b/src/test/java/com/xiaomi/infra/pegasus/tools/Toollet.java @@ -36,11 +36,10 @@ public class Toollet { int process_id = -1; while ((line = input.readLine()) != null) { if (line.contains("pegasus_server") && line.contains("meta")) { - String[] words = line.split(" "); - for (String word : words) { + String[] words = line.split("\\s+"); + if (words.length > 1) { try { - process_id = Integer.valueOf(word); - break; + process_id = Integer.valueOf(words[1]); } catch (Throwable ex) { } }