Introduce formatting methods for SourceException
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / stmt / rfc6020 / effective / type / EnumSpecificationEffectiveStatementImpl.java
index 66fc7d0d9577ba7829c8a4caa228ef97ec48d833..96dae96a9bbd3c2f39cba09e3c520a8cce9b060c 100644 (file)
@@ -42,8 +42,8 @@ public final class EnumSpecificationEffectiveStatementImpl extends
                     } else if (highestValue != 2147483647) {
                         newValue = highestValue + 1;
                     } else {
-                        throw new SourceException("Enum " + p + " must have a value statement",
-                            ctx.getStatementSourceReference());
+                        throw new SourceException(ctx.getStatementSourceReference(),
+                            "Enum '%s' must have a value statement", p);
                     }
 
                     p = new EnumPairImpl(p.getName(), newValue, p.getPath(), p.getDescription(), p.getReference(),