The exception thrown does not accurately describe what has happened. Be
more user-friendly and report the exact pattern which failed to match.
Change-Id: I0818c92c4a8cdf8c180234635c1efe059ff1c4e2
Signed-off-by: Robert Varga <rovarga@cisco.com>
(cherry picked from commit
3680886f73ef87fb2818c57b12d3bc76525c3669)
«FOR c : consts»
«IF c.name == TypeConstants.PATTERN_CONSTANT_NAME && c.value instanceof List<?>»
for (Pattern p : patterns) {
«FOR c : consts»
«IF c.name == TypeConstants.PATTERN_CONSTANT_NAME && c.value instanceof List<?>»
for (Pattern p : patterns) {
- «Preconditions.importedName».checkArgument(p.matcher(_value).matches(), "Supplied value \"%s\" does not match any of the permitted patterns %s", _value, «TypeConstants.PATTERN_CONSTANT_NAME»);
+ «Preconditions.importedName».checkArgument(p.matcher(_value).matches(), "Supplied value \"%s\" does not match required pattern \"%s\"", _value, p);