Introduce formatting methods for SourceException
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / stmt / rfc6020 / Utils.java
index a19e00df1cdee1b2fb1249e1dabd196c484929bd..3123445b478574bee0f9ac12a10eed0f48218abf 100644 (file)
@@ -107,8 +107,7 @@ public final class Utils {
         // to detect if key contains duplicates
         if ((new HashSet<>(keyTokens)).size() < keyTokens.size()) {
             // FIXME: report all duplicate keys
-            throw new SourceException(String.format("Duplicate value in list key: %s", value),
-                    ctx.getStatementSourceReference());
+            throw new SourceException(ctx.getStatementSourceReference(), "Duplicate value in list key: %s", value);
         }
 
         Set<SchemaNodeIdentifier.Relative> keyNodes = new HashSet<>();