equal
deleted
inserted
replaced
23 import java.io.OutputStream; |
23 import java.io.OutputStream; |
24 import java.util.ArrayList; |
24 import java.util.ArrayList; |
25 import java.util.Collection; |
25 import java.util.Collection; |
26 import java.util.EnumSet; |
26 import java.util.EnumSet; |
27 import java.util.List; |
27 import java.util.List; |
|
28 import java.util.regex.Pattern; |
|
29 import java.util.regex.PatternSyntaxException; |
28 |
30 |
29 /** |
31 /** |
30 * |
32 * |
31 * @author Ing. František Kučera (frantovo.cz) |
33 * @author Ing. František Kučera (frantovo.cz) |
32 */ |
34 */ |
102 |
104 |
103 if (!namedParameters.isEmpty() && !numberedParameters.isEmpty()) { |
105 if (!namedParameters.isEmpty() && !numberedParameters.isEmpty()) { |
104 e.addProblem(new InvalidOptionsException.OptionProblem("Named and numbered parameters can not be used together in one command.")); |
106 e.addProblem(new InvalidOptionsException.OptionProblem("Named and numbered parameters can not be used together in one command.")); |
105 } |
107 } |
106 |
108 |
|
109 try { |
|
110 Pattern.compile(namePrefix + "test" + nameSuffix); |
|
111 } catch (PatternSyntaxException regexException) { |
|
112 e.addProblem(new InvalidOptionsException.OptionProblem("Ivalid regular expression in name prefix or suffix", regexException)); |
|
113 } |
107 |
114 |
108 if (e.hasProblems()) { |
115 if (e.hasProblems()) { |
109 throw e; |
116 throw e; |
110 } |
117 } |
111 } |
118 } |