Reduce cyclomatic complexity
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / stmt / rfc6020 / LengthStatementImpl.java
index 24b8d6c02c5158b2f587238f5386615be905be7c..a8fc152e543ae28979231b56cdced423a40f6f2e 100644 (file)
@@ -20,7 +20,6 @@ import org.opendaylight.yangtools.yang.parser.spi.SubstatementValidator;
 import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractDeclaredStatement;
 import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractStatementSupport;
 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
-import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
 import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.type.LengthEffectiveStatementImpl;
 
 public class LengthStatementImpl extends AbstractDeclaredStatement<List<LengthConstraint>> implements LengthStatement {
@@ -36,9 +35,8 @@ public class LengthStatementImpl extends AbstractDeclaredStatement<List<LengthCo
         super(context);
     }
 
-    public static class Definition
-            extends
-            AbstractStatementSupport<List<LengthConstraint>, LengthStatement, EffectiveStatement<List<LengthConstraint>, LengthStatement>> {
+    public static class Definition extends AbstractStatementSupport<List<LengthConstraint>, LengthStatement,
+            EffectiveStatement<List<LengthConstraint>, LengthStatement>> {
 
         public Definition() {
             super(Rfc6020Mapping.LENGTH);
@@ -46,7 +44,7 @@ public class LengthStatementImpl extends AbstractDeclaredStatement<List<LengthCo
 
         @Override
         public List<LengthConstraint> parseArgumentValue(StmtContext<?, ?, ?> ctx, String value) {
-            return TypeUtils.parseLengthListFromString(value);
+            return TypeUtils.parseLengthListFromString(ctx, value);
         }
 
         @Override
@@ -56,13 +54,14 @@ public class LengthStatementImpl extends AbstractDeclaredStatement<List<LengthCo
 
         @Override
         public EffectiveStatement<List<LengthConstraint>, LengthStatement> createEffective(
-                StmtContext<List<LengthConstraint>, LengthStatement, EffectiveStatement<List<LengthConstraint>, LengthStatement>> ctx) {
+                StmtContext<List<LengthConstraint>, LengthStatement, EffectiveStatement<List<LengthConstraint>,
+                        LengthStatement>> ctx) {
             return new LengthEffectiveStatementImpl(ctx);
         }
 
         @Override
         public void onFullDefinitionDeclared(StmtContext.Mutable<List<LengthConstraint>,
-                LengthStatement, EffectiveStatement<List<LengthConstraint>, LengthStatement>> stmt) throws SourceException {
+                LengthStatement, EffectiveStatement<List<LengthConstraint>, LengthStatement>> stmt) {
             super.onFullDefinitionDeclared(stmt);
             SUBSTATEMENT_VALIDATOR.validate(stmt);
         }
@@ -92,4 +91,4 @@ public class LengthStatementImpl extends AbstractDeclaredStatement<List<LengthCo
     public List<LengthConstraint> getValue() {
         return argument();
     }
-}
\ No newline at end of file
+}