Skip to content

Commit

Permalink
Support arrays without square brackets
Browse files Browse the repository at this point in the history
  • Loading branch information
Piumal1999 committed Sep 25, 2024
1 parent 7a94f0f commit 7a1449b
Showing 1 changed file with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -61,14 +60,10 @@ private List<String> getReporterTypesOrNull(String typeConfig) {
if (typeConfig == null || typeConfig.isEmpty()) {
return null;
}
if (typeConfig.startsWith("[") && typeConfig.endsWith("]")) {
return Arrays.stream(typeConfig.substring(1, typeConfig.length() - 1).split(","))
.map(String::trim)
.filter(s -> !s.isEmpty())
.collect(Collectors.toList());
} else {
return Collections.singletonList(typeConfig);
}
return Arrays.stream(typeConfig.replaceAll("[\\[\\]]", "").split(","))
.map(String::trim)
.filter(s -> !s.isEmpty())
.collect(Collectors.toList());
}

private List<String> getReportersClassesOrNull(Map<String, String> configs) {
Expand Down

0 comments on commit 7a1449b

Please sign in to comment.