X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=yang%2Fyang-parser-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fyangtools%2Fyang%2Fparser%2Fstmt%2Frfc6020%2Feffective%2Ftype%2FBitsSpecificationEffectiveStatementImpl.java;h=b688f18f46d00c8fb0d6933940b1eba63d358ecf;hb=04fa25a4fe8957f6492618aa9a1e9a4f9af39df4;hp=05374ce27c7d4ff9137b37556e733063d18ff06c;hpb=bf405586fc69c3781311cfb8ac19ba93b670ec8d;p=yangtools.git diff --git a/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/type/BitsSpecificationEffectiveStatementImpl.java b/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/type/BitsSpecificationEffectiveStatementImpl.java index 05374ce27c..b688f18f46 100644 --- a/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/type/BitsSpecificationEffectiveStatementImpl.java +++ b/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/type/BitsSpecificationEffectiveStatementImpl.java @@ -41,17 +41,16 @@ public final class BitsSpecificationEffectiveStatementImpl extends } else if (highestPosition != 4294967295L) { newPos = highestPosition + 1; } else { - throw new SourceException("Bit " + b + " must have a position statement", - ctx.getStatementSourceReference()); + throw new SourceException(ctx.getStatementSourceReference(), + "Bit %s must have a position statement", b); } b = new BitImpl(newPos, b.getQName(), b.getPath(), b.getDescription(), b.getReference(), b.getStatus(), b.getUnknownSchemaNodes()); } - if (b.getPosition() < 0L || b.getPosition() > 4294967295L) { - throw new SourceException("Bit " + b + " has illegal position", ctx.getStatementSourceReference()); - } + SourceException.throwIf(b.getPosition() < 0L && b.getPosition() > 4294967295L, + ctx.getStatementSourceReference(), "Bit %s has illegal position", b); if (highestPosition == null || highestPosition < b.getPosition()) { highestPosition = b.getPosition();