@@ -68,8 +68,8 @@ public class Parameterized implements Callable<Integer> {
6868 private String [] excludedDims = new String [0 ];
6969
7070 private static final Pattern dimPattern1 =
71- Pattern .compile ("([\\ w-]+):([^,:]+)((?:,[^=,]+=[^=,]+)+ )" );
72- private static final Pattern dimPattern2 = Pattern .compile ("([^,:]+)((?:,[^=,]+=[^=,]+)+ )" );
71+ Pattern .compile ("([\\ w-]+):([^,:]+)((?:,[^=,]+=[^=,]+)* )" );
72+ private static final Pattern dimPattern2 = Pattern .compile ("([^,:]+)((?:,[^=,]+=[^=,]+)* )" );
7373
7474 private static final Pattern excludedDimsPattern =
7575 Pattern .compile ("[\\ w-]+:[^,:]+(?:,[\\ w-]+:[^,:]+)*" );
@@ -120,19 +120,17 @@ public Integer call() throws Exception {
120120 if (matcher1 .matches ()) {
121121 dimName = matcher1 .group (1 );
122122 dimValueName = matcher1 .group (2 );
123- confText = matcher1 .group (3 ). substring ( 1 ); // trim leading ","
123+ confText = matcher1 .group (3 );
124124 } else {
125125 // matcher2.matches
126126 dimName = matcher2 .group (1 );
127127 dimValueName = matcher2 .group (0 );
128- confText = matcher2 .group (2 ). substring ( 1 ); // trim leading ","
128+ confText = matcher2 .group (2 );
129129 }
130130
131131 final List <Map .Entry <String , String >> options = new ArrayList <>();
132- String [] splits = confText .split ("," );
133- if (splits .length == 0 ) {
134- throw new IllegalArgumentException ("Unexpected dim: " + dim );
135- }
132+ final List <String > splits =
133+ Arrays .stream (confText .split ("," )).filter (s -> !s .isEmpty ()).collect (Collectors .toList ());
136134 for (String split : splits ) {
137135 String [] kv = split .split ("=" );
138136 if (kv .length != 2 ) {
0 commit comments