Propagate @Nonnull and @Nullable annotations
[yangtools.git] / yang / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / stmt / rfc6020 / effective / type / IntegerTypeEffectiveStatementImpl.java
index 5576360b65edce817bf908e8f8549c54918e1243..b98b8928d82da548be6d000702f06e2b2681de6f 100644 (file)
@@ -8,6 +8,7 @@
 
 package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.type;
 
+import javax.annotation.Nonnull;
 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
 import org.opendaylight.yangtools.yang.model.api.stmt.TypeEffectiveStatement;
 import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
@@ -48,11 +49,12 @@ public final class IntegerTypeEffectiveStatementImpl extends
             typeDefinition = builder.build();
         } catch (InvalidRangeConstraintException e) {
             final RangeConstraint c = e.getOffendingConstraint();
-            throw new SourceException(String.format("Invalid range constraint: <%s, %s>", c.getMin(), c.getMax()),
-                ctx.getStatementSourceReference(), e);
+            throw new SourceException(ctx.getStatementSourceReference(), e, "Invalid range constraint: <%s, %s>",
+                c.getMin(), c.getMax());
         }
     }
 
+    @Nonnull
     @Override
     public IntegerTypeDefinition getTypeDefinition() {
         return typeDefinition;