From afc3218bb348f6284552e43acb73cf02af0e44b5 Mon Sep 17 00:00:00 2001 From: "Anna.Kozlova" Date: Thu, 27 Oct 2016 12:54:04 +0200 Subject: [PATCH] testng: skip empty strings in configuration of groups (IDEA-163189) --- .../testng/inspection/DependsOnGroupsInspection.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/testng/src/com/theoryinpractice/testng/inspection/DependsOnGroupsInspection.java b/plugins/testng/src/com/theoryinpractice/testng/inspection/DependsOnGroupsInspection.java index 27df04a8760a..ee36c773d45e 100644 --- a/plugins/testng/src/com/theoryinpractice/testng/inspection/DependsOnGroupsInspection.java +++ b/plugins/testng/src/com/theoryinpractice/testng/inspection/DependsOnGroupsInspection.java @@ -77,8 +77,10 @@ public class DependsOnGroupsInspection extends BaseJavaLocalInspectionTool { textField.getDocument().addDocumentListener(new DocumentAdapter() { protected void textChanged(final DocumentEvent e) { groups.clear(); - final String[] groupsFromString = textField.getText().split("[, ]"); - ContainerUtil.addAll(groups, groupsFromString); + String text = textField.getText(); + if (!StringUtil.isEmptyOrSpaces(text)) { + ContainerUtil.addAll(groups, text.split("[, ]")); + } } }); definedGroups.setComponent(textField);