Fix CanonicalValueViolation.getMessage() 64/97464/1
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 13 Sep 2021 02:32:11 +0000 (04:32 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 13 Sep 2021 03:03:26 +0000 (05:03 +0200)
We should not be looking at the tag but rather at message. This fixes
anonymous exceptions being thrown from Decimal64's value support.

Change-Id: I1462032b2b3cd5357a9009ac707c0f914a4e64c8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 6d6c3348b2228133c84b49702931d8d6499681c2)

yang/yang-common/src/main/java/org/opendaylight/yangtools/yang/common/CanonicalValueViolation.java

index 75be2d4f28abd6aed2d5e4a85bf889ea0e26cf2d..f58f3be29c76f51e92a394ea1f5eb42767e94594 100644 (file)
@@ -126,7 +126,7 @@ public abstract class CanonicalValueViolation implements Immutable, Serializable
     }
 
     public final Optional<String> getMessage() {
-        return nullableString(appTag());
+        return nullableString(message());
     }
 
     abstract @Nullable String appTag();