Integrate {Inference,Source}Exception with CommonStmtCtx
[yangtools.git] / yang / yang-parser-rfc7950 / src / main / java / org / opendaylight / yangtools / yang / parser / rfc7950 / stmt / type / BitsSpecificationSupport.java
index 61a004bdb38a3c09e9c9d241f774106468ea5d31..af37b6b3f71f142e6cc8c810020ca4c016c80910 100644 (file)
@@ -75,7 +75,7 @@ final class BitsSpecificationSupport
                 final Uint32 effectivePos;
                 if (declaredPosition.isEmpty()) {
                     if (highestPosition != null) {
-                        SourceException.throwIf(Uint32.MAX_VALUE.equals(highestPosition), stmt.sourceReference(),
+                        SourceException.throwIf(Uint32.MAX_VALUE.equals(highestPosition), stmt,
                             "Bit %s must have a position statement", bitSubStmt);
                         effectivePos = Uint32.fromIntBits(highestPosition.intValue() + 1);
                     } else {
@@ -104,6 +104,6 @@ final class BitsSpecificationSupport
          *     The "bit" statement, which is a substatement to the "type" statement,
          *     MUST be present if the type is "bits".
          */
-        return new SourceException("At least one bit statement has to be present", stmt.sourceReference());
+        return new SourceException("At least one bit statement has to be present", stmt);
     }
 }