Bug 5942: When condition of uses node is not exposed by the YANG parser
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / stmt / rfc6020 / FractionDigitsStatementImpl.java
index ab7413aa82869d87ed0fb73135830e9b8593afbe..5b54c5e9b4fa0b6572a34f3fd70f4860ce360bc1 100644 (file)
@@ -30,9 +30,8 @@ public class FractionDigitsStatementImpl extends AbstractDeclaredStatement<Integ
         super(context);
     }
 
-    public static class Definition
-            extends
-            AbstractStatementSupport<Integer, FractionDigitsStatement, EffectiveStatement<Integer, FractionDigitsStatement>> {
+    public static class Definition extends AbstractStatementSupport<Integer, FractionDigitsStatement,
+            EffectiveStatement<Integer, FractionDigitsStatement>> {
 
         public Definition() {
             super(Rfc6020Mapping.FRACTION_DIGITS);
@@ -46,8 +45,8 @@ public class FractionDigitsStatementImpl extends AbstractDeclaredStatement<Integ
             try {
                 fractionDigits = Integer.parseInt(value);
             } catch (NumberFormatException e) {
-                throw new IllegalArgumentException(String.format("%s is not valid fraction-digits integer argument",
-                        value), e);
+                throw new SourceException(String.format("%s is not valid fraction-digits integer argument",
+                        value), ctx.getStatementSourceReference(), e);
             }
 
             Preconditions.checkArgument(FRAC_DIGITS_ALLOWED.contains(fractionDigits),
@@ -69,7 +68,7 @@ public class FractionDigitsStatementImpl extends AbstractDeclaredStatement<Integ
 
         @Override
         public void onFullDefinitionDeclared(final StmtContext.Mutable<Integer, FractionDigitsStatement,
-                EffectiveStatement<Integer, FractionDigitsStatement>> stmt) throws SourceException {
+                EffectiveStatement<Integer, FractionDigitsStatement>> stmt) {
             super.onFullDefinitionDeclared(stmt);
             SUBSTATEMENT_VALIDATOR.validate(stmt);
         }