commit | a890e7c12ace24bd853893cbcf434e83fabec6b5 | [log] [tgz] |
---|---|---|
author | Sho SHIMIZU <sshimizu@us.fujitsu.com> | Fri Oct 02 14:48:13 2015 -0700 |
committer | Ray Milkey <ray@onlab.us> | Fri Oct 02 23:26:55 2015 +0000 |
tree | 16a99a5a41b2a93e84d777805160fd9621bc5036 | |
parent | f618cb08077f231ab3fe70c424fb7d02830b43d1 [diff] |
Refactor: Simplify statements Change-Id: I8f6f25e08bde450d8c1c56a21d0b03fed00e664f
diff --git a/core/store/dist/src/main/java/org/onosproject/store/resource/impl/ConsistentLinkResourceStore.java b/core/store/dist/src/main/java/org/onosproject/store/resource/impl/ConsistentLinkResourceStore.java index 3c74069..e11ead5 100644 --- a/core/store/dist/src/main/java/org/onosproject/store/resource/impl/ConsistentLinkResourceStore.java +++ b/core/store/dist/src/main/java/org/onosproject/store/resource/impl/ConsistentLinkResourceStore.java
@@ -166,21 +166,17 @@ // if Link annotation exist, use them // if all fails, use DEFAULT_BANDWIDTH - BandwidthResource bandwidth = null; + BandwidthResource bandwidth = DEFAULT_BANDWIDTH; String strBw = link.annotations().value(BANDWIDTH); if (strBw != null) { try { bandwidth = new BandwidthResource(Bandwidth.mbps(Double.parseDouble(strBw))); } catch (NumberFormatException e) { - // do nothings - bandwidth = null; + // do nothings, use default bandwidth + bandwidth = DEFAULT_BANDWIDTH; } } - if (bandwidth == null) { - // fall back, use fixed default - bandwidth = DEFAULT_BANDWIDTH; - } return new BandwidthResourceAllocation(bandwidth); }