commit | 1684b00a21a3f16a39f06bd16725e720d78a056e | [log] [tgz] |
---|---|---|
author | Jian Li <pyguni@gmail.com> | Wed Dec 16 15:38:46 2015 -0800 |
committer | Gerrit Code Review <gerrit@onlab.us> | Fri Dec 18 00:55:23 2015 +0000 |
tree | 0d76e3ced7928c6e9eea006880dade7e82fe7bc9 | |
parent | 1dfef09812acaa71582e03e0b2fa3cb093b42371 [diff] |
Bugfix: only allow REMARK band to have a precedence Change-Id: I3b47f6f78d409832c2a5ef9f059e1b48ba38deaf
diff --git a/core/api/src/main/java/org/onosproject/net/meter/DefaultBand.java b/core/api/src/main/java/org/onosproject/net/meter/DefaultBand.java index 58a2476..9bc9970 100644 --- a/core/api/src/main/java/org/onosproject/net/meter/DefaultBand.java +++ b/core/api/src/main/java/org/onosproject/net/meter/DefaultBand.java
@@ -125,12 +125,10 @@ @Override public DefaultBand build() { - checkArgument(type != Type.REMARK && prec == null, - "Only REMARK bands can have a precendence."); + checkArgument(type == Type.REMARK ^ prec == null, + "Only REMARK bands can have a precedence."); return new DefaultBand(type, rate, burstSize, prec); } - - } }