From b0e8bd3a81ceca594eeb5424e6293f87549ec33e Mon Sep 17 00:00:00 2001 From: CaptainB Date: Thu, 11 Jan 2024 15:09:48 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=80=A7=E8=83=BD=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=20=E6=80=A7=E8=83=BD=E6=B5=8B=E8=AF=95=E4=B8=8B=E8=BD=BDzip?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E6=B5=81=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../parse/xml/reader/JmeterDocumentParser.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/performance-test/backend/src/main/java/io/metersphere/parse/xml/reader/JmeterDocumentParser.java b/performance-test/backend/src/main/java/io/metersphere/parse/xml/reader/JmeterDocumentParser.java index 819bf99248..06e3a9efb1 100644 --- a/performance-test/backend/src/main/java/io/metersphere/parse/xml/reader/JmeterDocumentParser.java +++ b/performance-test/backend/src/main/java/io/metersphere/parse/xml/reader/JmeterDocumentParser.java @@ -386,11 +386,6 @@ public class JmeterDocumentParser implements EngineSourceParser { if (content == null) { return; } - StringTokenizer tokenizer = new StringTokenizer(IOUtils.toString(content, StandardCharsets.UTF_8), StringUtils.LF); - if (!tokenizer.hasMoreTokens()) { - return; - } - StringBuilder csv = new StringBuilder(); Object config = ((Map) csvConfig).get(filename); if (config == null) { return; @@ -399,6 +394,11 @@ public class JmeterDocumentParser implements EngineSourceParser { if (!BooleanUtils.toBoolean(csvSplit)) { return; } + StringTokenizer tokenizer = new StringTokenizer(IOUtils.toString(content, StandardCharsets.UTF_8), StringUtils.LF); + if (!tokenizer.hasMoreTokens()) { + return; + } + StringBuilder csv = new StringBuilder(); Boolean csvHasHeader = (Boolean) ((Map) (config)).get("csvHasHeader"); if (BooleanUtils.toBoolean(csvHasHeader)) { String header = tokenizer.nextToken();