Fix CanonicalValueViolation.getMessage() 62/97462/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:08 +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)

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

index 8fd699a3f70f5db26a7d266612c934704445c012..6a21058faa181f70d006a658676203701e6c1f08 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();