Improve conflicting error message 96/78796/1
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 14 Dec 2018 12:15:58 +0000 (13:15 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Fri, 14 Dec 2018 12:15:58 +0000 (13:15 +0100)
In the unlikely event we conflict on a constant, it is nice to know
what name it has.

Change-Id: Ie775779c350e6621917d0212978f6aa2f28c32f3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
binding/mdsal-binding-generator-util/src/main/java/org/opendaylight/mdsal/binding/model/util/generated/type/builder/AbstractGeneratedTypeBuilder.java

index 38e5c922aea1463f829cf341736531039e85775b..7b94eaf3868a0ed51de504ba8f090f86ab88212e 100644 (file)
@@ -147,7 +147,7 @@ abstract class AbstractGeneratedTypeBuilder<T extends GeneratedTypeBuilderBase<T
         checkArgument(type != null, "Returning Type for Constant cannot be null!");
         checkArgument(name != null, "Name of constant cannot be null!");
         checkArgument(!containsConstant(name),
-            "This generated type already contains constant with the same name.");
+            "This generated type already contains a \"%s\" constant", name);
 
         final Constant constant = new ConstantImpl(this, type, name, value);
         this.constants = LazyCollections.lazyAdd(this.constants, constant);