BUG-3051: Fix error reporting string 16/22116/1
authorRobert Varga <rovarga@cisco.com>
Mon, 8 Jun 2015 16:43:05 +0000 (18:43 +0200)
committerRobert Varga <rovarga@cisco.com>
Mon, 8 Jun 2015 16:43:05 +0000 (18:43 +0200)
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>
code-generator/binding-java-api-generator/src/main/java/org/opendaylight/yangtools/sal/java/api/generator/ClassTemplate.xtend

index bb90f8b6358b523fbc46490d4fecaa1438dfff82..7c5f78d48dee4db76b5f80b4ff8e52ed7541b058 100644 (file)
@@ -277,7 +277,7 @@ class ClassTemplate extends BaseTemplate {
             «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);
                 }
                 «ENDIF»
             «ENDFOR»