Committed by
Thomas Vachuska
Flip right hand side and left hand side of if-condition
Change-Id: Ic7574e645d0d6b5dc7a1e25ae2eb36212c96ab4b
Showing
19 changed files
with
33 additions
and
33 deletions
... | @@ -144,7 +144,7 @@ public class PcepAttributeVer1 implements PcepAttribute { | ... | @@ -144,7 +144,7 @@ public class PcepAttributeVer1 implements PcepAttribute { |
144 | */ | 144 | */ |
145 | public boolean parseMetricList(ChannelBuffer cb) throws PcepParseException { | 145 | public boolean parseMetricList(ChannelBuffer cb) throws PcepParseException { |
146 | 146 | ||
147 | - if (null == llMetricList) { | 147 | + if (llMetricList == null) { |
148 | llMetricList = new LinkedList<PcepMetricObject>(); | 148 | llMetricList = new LinkedList<PcepMetricObject>(); |
149 | } | 149 | } |
150 | 150 | ... | ... |
... | @@ -120,8 +120,8 @@ public class PcepEndPointsObjectVer1 implements PcepEndPointsObject { | ... | @@ -120,8 +120,8 @@ public class PcepEndPointsObjectVer1 implements PcepEndPointsObject { |
120 | int destIpAddress; | 120 | int destIpAddress; |
121 | 121 | ||
122 | endPointsObjHeader = PcepObjectHeader.read(cb); | 122 | endPointsObjHeader = PcepObjectHeader.read(cb); |
123 | - if (END_POINTS_OBJ_TYPE == endPointsObjHeader.getObjType() | 123 | + if (endPointsObjHeader.getObjType() == END_POINTS_OBJ_TYPE |
124 | - && END_POINTS_OBJ_CLASS == endPointsObjHeader.getObjClass()) { | 124 | + && endPointsObjHeader.getObjClass() == END_POINTS_OBJ_CLASS) { |
125 | sourceIpAddress = cb.readInt(); | 125 | sourceIpAddress = cb.readInt(); |
126 | destIpAddress = cb.readInt(); | 126 | destIpAddress = cb.readInt(); |
127 | } else { | 127 | } else { | ... | ... |
... | @@ -212,7 +212,7 @@ public class PcepErrorObjectVer1 implements PcepErrorObject { | ... | @@ -212,7 +212,7 @@ public class PcepErrorObjectVer1 implements PcepErrorObject { |
212 | while (listIterator.hasNext()) { | 212 | while (listIterator.hasNext()) { |
213 | PcepValueType tlv = listIterator.next(); | 213 | PcepValueType tlv = listIterator.next(); |
214 | 214 | ||
215 | - if (null == tlv) { | 215 | + if (tlv == null) { |
216 | log.debug("TLV is null from OptionalTlv list"); | 216 | log.debug("TLV is null from OptionalTlv list"); |
217 | continue; | 217 | continue; |
218 | } | 218 | } | ... | ... |
... | @@ -393,12 +393,12 @@ public class PcepErrorVer1 implements PcepError { | ... | @@ -393,12 +393,12 @@ public class PcepErrorVer1 implements PcepError { |
393 | ToStringHelper toStrHelper = MoreObjects.toStringHelper(getClass()); | 393 | ToStringHelper toStrHelper = MoreObjects.toStringHelper(getClass()); |
394 | 394 | ||
395 | //RP Object list is optional | 395 | //RP Object list is optional |
396 | - if (null != llRPObjList) { | 396 | + if (llRPObjList != null) { |
397 | toStrHelper.add("RpObjectList", llRPObjList); | 397 | toStrHelper.add("RpObjectList", llRPObjList); |
398 | } | 398 | } |
399 | 399 | ||
400 | //TE Object list is optional | 400 | //TE Object list is optional |
401 | - if (null != llTEObjList) { | 401 | + if (llTEObjList != null) { |
402 | toStrHelper.add("TeObjectList", llTEObjList); | 402 | toStrHelper.add("TeObjectList", llTEObjList); |
403 | } | 403 | } |
404 | 404 | ... | ... |
... | @@ -126,7 +126,7 @@ class PcepInitiateMsgVer1 implements PcepInitiateMsg { | ... | @@ -126,7 +126,7 @@ class PcepInitiateMsgVer1 implements PcepInitiateMsg { |
126 | 126 | ||
127 | boolean isDelLspRequest = false; | 127 | boolean isDelLspRequest = false; |
128 | 128 | ||
129 | - if (null == cb) { | 129 | + if (cb == null) { |
130 | throw new PcepParseException("Channel buffer is empty"); | 130 | throw new PcepParseException("Channel buffer is empty"); |
131 | } | 131 | } |
132 | 132 | ... | ... |
... | @@ -250,7 +250,7 @@ public class PcepLabelObjectVer1 implements PcepLabelObject { | ... | @@ -250,7 +250,7 @@ public class PcepLabelObjectVer1 implements PcepLabelObject { |
250 | while (listIterator.hasNext()) { | 250 | while (listIterator.hasNext()) { |
251 | PcepValueType tlv = listIterator.next(); | 251 | PcepValueType tlv = listIterator.next(); |
252 | 252 | ||
253 | - if (null == tlv) { | 253 | + if (tlv == null) { |
254 | log.debug("tlv is null from OptionalTlv list"); | 254 | log.debug("tlv is null from OptionalTlv list"); |
255 | continue; | 255 | continue; |
256 | } | 256 | } | ... | ... |
... | @@ -235,7 +235,7 @@ public class PcepLabelRangeObjectVer1 implements PcepLabelRangeObject { | ... | @@ -235,7 +235,7 @@ public class PcepLabelRangeObjectVer1 implements PcepLabelRangeObject { |
235 | while (listIterator.hasNext()) { | 235 | while (listIterator.hasNext()) { |
236 | PcepValueType tlv = listIterator.next(); | 236 | PcepValueType tlv = listIterator.next(); |
237 | 237 | ||
238 | - if (null == tlv) { | 238 | + if (tlv == null) { |
239 | log.debug("tlv is null from OptionalTlv list"); | 239 | log.debug("tlv is null from OptionalTlv list"); |
240 | continue; | 240 | continue; |
241 | } | 241 | } | ... | ... |
... | @@ -377,7 +377,7 @@ public class PcepLspObjectVer1 implements PcepLspObject { | ... | @@ -377,7 +377,7 @@ public class PcepLspObjectVer1 implements PcepLspObject { |
377 | while (listIterator.hasNext()) { | 377 | while (listIterator.hasNext()) { |
378 | PcepValueType tlv = listIterator.next(); | 378 | PcepValueType tlv = listIterator.next(); |
379 | 379 | ||
380 | - if (null == tlv) { | 380 | + if (tlv == null) { |
381 | log.debug("tlv is null from OptionalTlv list"); | 381 | log.debug("tlv is null from OptionalTlv list"); |
382 | continue; | 382 | continue; |
383 | } | 383 | } | ... | ... |
... | @@ -308,7 +308,7 @@ public class PcepLspaObjectVer1 implements PcepLspaObject { | ... | @@ -308,7 +308,7 @@ public class PcepLspaObjectVer1 implements PcepLspaObject { |
308 | ListIterator<PcepValueType> listIterator = llOptionalTlv.listIterator(); | 308 | ListIterator<PcepValueType> listIterator = llOptionalTlv.listIterator(); |
309 | while (listIterator.hasNext()) { | 309 | while (listIterator.hasNext()) { |
310 | PcepValueType tlv = listIterator.next(); | 310 | PcepValueType tlv = listIterator.next(); |
311 | - if (null == tlv) { | 311 | + if (tlv == null) { |
312 | log.debug("Warning: tlv is null from OptionalTlv list"); | 312 | log.debug("Warning: tlv is null from OptionalTlv list"); |
313 | continue; | 313 | continue; |
314 | } | 314 | } | ... | ... |
... | @@ -326,7 +326,7 @@ public class PcepOpenObjectVer1 implements PcepOpenObject { | ... | @@ -326,7 +326,7 @@ public class PcepOpenObjectVer1 implements PcepOpenObject { |
326 | ListIterator<PcepValueType> listIterator = llOptionalTlv.listIterator(); | 326 | ListIterator<PcepValueType> listIterator = llOptionalTlv.listIterator(); |
327 | while (listIterator.hasNext()) { | 327 | while (listIterator.hasNext()) { |
328 | PcepValueType tlv = listIterator.next(); | 328 | PcepValueType tlv = listIterator.next(); |
329 | - if (null == tlv) { | 329 | + if (tlv == null) { |
330 | log.debug("TLV is null from OptionalTlv list"); | 330 | log.debug("TLV is null from OptionalTlv list"); |
331 | continue; | 331 | continue; |
332 | } | 332 | } | ... | ... |
... | @@ -253,7 +253,7 @@ class PcepReportMsgVer1 implements PcepReportMsg { | ... | @@ -253,7 +253,7 @@ class PcepReportMsgVer1 implements PcepReportMsg { |
253 | PcepSrpObject srpObj = stateRpt.getSrpObject(); | 253 | PcepSrpObject srpObj = stateRpt.getSrpObject(); |
254 | 254 | ||
255 | //SRP object is optional | 255 | //SRP object is optional |
256 | - if (null != srpObj) { | 256 | + if (srpObj != null) { |
257 | srpObj.write(cb); | 257 | srpObj.write(cb); |
258 | } | 258 | } |
259 | 259 | ... | ... |
... | @@ -159,7 +159,7 @@ public class PcepSrpObjectVer1 implements PcepSrpObject { | ... | @@ -159,7 +159,7 @@ public class PcepSrpObjectVer1 implements PcepSrpObject { |
159 | 159 | ||
160 | srpObjHeader = PcepObjectHeader.read(cb); | 160 | srpObjHeader = PcepObjectHeader.read(cb); |
161 | 161 | ||
162 | - if (SRP_OBJ_CLASS != srpObjHeader.getObjClass()) { | 162 | + if (srpObjHeader.getObjClass() != SRP_OBJ_CLASS) { |
163 | throw new PcepParseException("SRP object expected. But received " + srpObjHeader.getObjClass()); | 163 | throw new PcepParseException("SRP object expected. But received " + srpObjHeader.getObjClass()); |
164 | } | 164 | } |
165 | 165 | ||
... | @@ -258,7 +258,7 @@ public class PcepSrpObjectVer1 implements PcepSrpObject { | ... | @@ -258,7 +258,7 @@ public class PcepSrpObjectVer1 implements PcepSrpObject { |
258 | while (listIterator.hasNext()) { | 258 | while (listIterator.hasNext()) { |
259 | PcepValueType tlv = listIterator.next(); | 259 | PcepValueType tlv = listIterator.next(); |
260 | 260 | ||
261 | - if (null == tlv) { | 261 | + if (tlv == null) { |
262 | log.debug("tlv is null from OptionalTlv list"); | 262 | log.debug("tlv is null from OptionalTlv list"); |
263 | continue; | 263 | continue; |
264 | } | 264 | } | ... | ... |
... | @@ -98,22 +98,22 @@ public class PcepStateReportVer1 implements PcepStateReport { | ... | @@ -98,22 +98,22 @@ public class PcepStateReportVer1 implements PcepStateReport { |
98 | this.attrList = attrList; | 98 | this.attrList = attrList; |
99 | this.rroObj = rroObj; | 99 | this.rroObj = rroObj; |
100 | this.bandwidth = bandwidth; | 100 | this.bandwidth = bandwidth; |
101 | - if (null == rroObj) { | 101 | + if (rroObj == null) { |
102 | this.isRroObjectSet = false; | 102 | this.isRroObjectSet = false; |
103 | } else { | 103 | } else { |
104 | this.isRroObjectSet = true; | 104 | this.isRroObjectSet = true; |
105 | } | 105 | } |
106 | - if (null == eroObj) { | 106 | + if (eroObj == null) { |
107 | this.isEroObjectSet = false; | 107 | this.isEroObjectSet = false; |
108 | } else { | 108 | } else { |
109 | this.isEroObjectSet = true; | 109 | this.isEroObjectSet = true; |
110 | } | 110 | } |
111 | - if (null == attrList) { | 111 | + if (attrList == null) { |
112 | this.isAttributeListSet = false; | 112 | this.isAttributeListSet = false; |
113 | } else { | 113 | } else { |
114 | this.isAttributeListSet = true; | 114 | this.isAttributeListSet = true; |
115 | } | 115 | } |
116 | - if (null == bandwidth) { | 116 | + if (bandwidth == null) { |
117 | this.isBandwidthObjectSet = false; | 117 | this.isBandwidthObjectSet = false; |
118 | } else { | 118 | } else { |
119 | this.isBandwidthObjectSet = true; | 119 | this.isBandwidthObjectSet = true; | ... | ... |
... | @@ -343,7 +343,7 @@ public class PcepTEObjectVer1 implements PcepTEObject { | ... | @@ -343,7 +343,7 @@ public class PcepTEObjectVer1 implements PcepTEObject { |
343 | while (listIterator.hasNext()) { | 343 | while (listIterator.hasNext()) { |
344 | PcepValueType tlv = listIterator.next(); | 344 | PcepValueType tlv = listIterator.next(); |
345 | 345 | ||
346 | - if (null == tlv) { | 346 | + if (tlv == null) { |
347 | log.debug("TLV is null from OptionalTlv list"); | 347 | log.debug("TLV is null from OptionalTlv list"); |
348 | continue; | 348 | continue; |
349 | } | 349 | } | ... | ... |
... | @@ -152,7 +152,7 @@ public class LocalTENodeDescriptorsTLV implements PcepValueType { | ... | @@ -152,7 +152,7 @@ public class LocalTENodeDescriptorsTLV implements PcepValueType { |
152 | 152 | ||
153 | while (listIterator.hasNext()) { | 153 | while (listIterator.hasNext()) { |
154 | PcepValueType tlv = listIterator.next(); | 154 | PcepValueType tlv = listIterator.next(); |
155 | - if (null == tlv) { | 155 | + if (tlv == null) { |
156 | log.debug("TLV is null from subTlv list"); | 156 | log.debug("TLV is null from subTlv list"); |
157 | continue; | 157 | continue; |
158 | } | 158 | } | ... | ... |
... | @@ -102,13 +102,13 @@ public class PcepRsvpUserErrorSpec implements PcepRsvpErrorSpec { | ... | @@ -102,13 +102,13 @@ public class PcepRsvpUserErrorSpec implements PcepRsvpErrorSpec { |
102 | cb.writeShort(userErrorValue); | 102 | cb.writeShort(userErrorValue); |
103 | cb.writeBytes(errDesc); | 103 | cb.writeBytes(errDesc); |
104 | 104 | ||
105 | - if (null != llRsvpUserSpecSubObj) { | 105 | + if (llRsvpUserSpecSubObj != null) { |
106 | 106 | ||
107 | ListIterator<PcepValueType> listIterator = llRsvpUserSpecSubObj.listIterator(); | 107 | ListIterator<PcepValueType> listIterator = llRsvpUserSpecSubObj.listIterator(); |
108 | 108 | ||
109 | while (listIterator.hasNext()) { | 109 | while (listIterator.hasNext()) { |
110 | PcepValueType tlv = listIterator.next(); | 110 | PcepValueType tlv = listIterator.next(); |
111 | - if (null == tlv) { | 111 | + if (tlv == null) { |
112 | continue; | 112 | continue; |
113 | } | 113 | } |
114 | tlv.write(cb); | 114 | tlv.write(cb); |
... | @@ -145,7 +145,7 @@ public class PcepRsvpUserErrorSpec implements PcepRsvpErrorSpec { | ... | @@ -145,7 +145,7 @@ public class PcepRsvpUserErrorSpec implements PcepRsvpErrorSpec { |
145 | 145 | ||
146 | objHeader = PcepRsvpSpecObjHeader.read(cb); | 146 | objHeader = PcepRsvpSpecObjHeader.read(cb); |
147 | 147 | ||
148 | - if (CLASS_NUM != objHeader.getObjClassNum() || CLASS_TYPE != objHeader.getObjClassType()) { | 148 | + if (objHeader.getObjClassNum() != CLASS_NUM || objHeader.getObjClassType() != CLASS_TYPE) { |
149 | throw new PcepParseException("Expected PcepRsvpUserErrorSpec object."); | 149 | throw new PcepParseException("Expected PcepRsvpUserErrorSpec object."); |
150 | } | 150 | } |
151 | enterpriseNum = cb.readInt(); | 151 | enterpriseNum = cb.readInt(); | ... | ... |
... | @@ -154,7 +154,7 @@ public class RemoteTENodeDescriptorsTLV implements PcepValueType { | ... | @@ -154,7 +154,7 @@ public class RemoteTENodeDescriptorsTLV implements PcepValueType { |
154 | while (listIterator.hasNext()) { | 154 | while (listIterator.hasNext()) { |
155 | PcepValueType tlv = listIterator.next(); | 155 | PcepValueType tlv = listIterator.next(); |
156 | 156 | ||
157 | - if (null == tlv) { | 157 | + if (tlv == null) { |
158 | log.debug("TLV is null from subTlv list"); | 158 | log.debug("TLV is null from subTlv list"); |
159 | continue; | 159 | continue; |
160 | } | 160 | } | ... | ... |
... | @@ -152,7 +152,7 @@ public class TELinkAttributesTlv implements PcepValueType { | ... | @@ -152,7 +152,7 @@ public class TELinkAttributesTlv implements PcepValueType { |
152 | while (listIterator.hasNext()) { | 152 | while (listIterator.hasNext()) { |
153 | PcepValueType tlv = listIterator.next(); | 153 | PcepValueType tlv = listIterator.next(); |
154 | 154 | ||
155 | - if (null == tlv) { | 155 | + if (tlv == null) { |
156 | log.debug("TLV is null from subTlv list"); | 156 | log.debug("TLV is null from subTlv list"); |
157 | continue; | 157 | continue; |
158 | } | 158 | } | ... | ... |
... | @@ -628,7 +628,7 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid | ... | @@ -628,7 +628,7 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid |
628 | PcepValueType tlv; | 628 | PcepValueType tlv; |
629 | LinkedList<PcepValueType> llSubObjects = createPcepPath(path); | 629 | LinkedList<PcepValueType> llSubObjects = createPcepPath(path); |
630 | 630 | ||
631 | - if (null == llSubObjects || 0 == llSubObjects.size()) { | 631 | + if (llSubObjects == null || llSubObjects.size() == 0) { |
632 | log.error("There is no link information to create tunnel"); | 632 | log.error("There is no link information to create tunnel"); |
633 | return null; | 633 | return null; |
634 | } | 634 | } |
... | @@ -661,7 +661,7 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid | ... | @@ -661,7 +661,7 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid |
661 | PcepEroObject eroobj = pc.factory().buildEroObject().setSubObjects(llSubObjects).build(); | 661 | PcepEroObject eroobj = pc.factory().buildEroObject().setSubObjects(llSubObjects).build(); |
662 | 662 | ||
663 | int iBandwidth = DEFAULT_BANDWIDTH_VALUE; | 663 | int iBandwidth = DEFAULT_BANDWIDTH_VALUE; |
664 | - if (null != tunnel.annotations().value("bandwidth")) { | 664 | + if (tunnel.annotations().value("bandwidth") != null) { |
665 | iBandwidth = Integer.parseInt(tunnel.annotations().value("bandwidth")); | 665 | iBandwidth = Integer.parseInt(tunnel.annotations().value("bandwidth")); |
666 | } | 666 | } |
667 | // build bandwidth object | 667 | // build bandwidth object |
... | @@ -692,7 +692,7 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid | ... | @@ -692,7 +692,7 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid |
692 | 692 | ||
693 | LinkedList<PcInitiatedLspRequest> llPcInitiatedLspRequestList = createPcInitiatedLspReqList(tunnel, path, | 693 | LinkedList<PcInitiatedLspRequest> llPcInitiatedLspRequestList = createPcInitiatedLspReqList(tunnel, path, |
694 | pc, srpId); | 694 | pc, srpId); |
695 | - if (null == llPcInitiatedLspRequestList || 0 == llPcInitiatedLspRequestList.size()) { | 695 | + if (llPcInitiatedLspRequestList == null || llPcInitiatedLspRequestList.size() == 0) { |
696 | log.error("Failed to create PcInitiatedLspRequestList"); | 696 | log.error("Failed to create PcInitiatedLspRequestList"); |
697 | return; | 697 | return; |
698 | } | 698 | } |
... | @@ -740,7 +740,7 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid | ... | @@ -740,7 +740,7 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid |
740 | LinkedList<PcepValueType> llOptionalTlv = new LinkedList<PcepValueType>(); | 740 | LinkedList<PcepValueType> llOptionalTlv = new LinkedList<PcepValueType>(); |
741 | LinkedList<PcInitiatedLspRequest> llPcInitiatedLspRequestList = new LinkedList<PcInitiatedLspRequest>(); | 741 | LinkedList<PcInitiatedLspRequest> llPcInitiatedLspRequestList = new LinkedList<PcInitiatedLspRequest>(); |
742 | 742 | ||
743 | - if (null != statefulIpv4IndentifierTlv) { | 743 | + if (statefulIpv4IndentifierTlv != null) { |
744 | tlv = statefulIpv4IndentifierTlv; | 744 | tlv = statefulIpv4IndentifierTlv; |
745 | } else { | 745 | } else { |
746 | tlv = new StatefulIPv4LspIdentidiersTlv(( | 746 | tlv = new StatefulIPv4LspIdentidiersTlv(( |
... | @@ -819,7 +819,7 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid | ... | @@ -819,7 +819,7 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid |
819 | PcepEroObject eroobj = pc.factory().buildEroObject().setSubObjects(llSubObjects).build(); | 819 | PcepEroObject eroobj = pc.factory().buildEroObject().setSubObjects(llSubObjects).build(); |
820 | 820 | ||
821 | int iBandwidth = DEFAULT_BANDWIDTH_VALUE; | 821 | int iBandwidth = DEFAULT_BANDWIDTH_VALUE; |
822 | - if (null != tunnel.annotations().value("bandwidth")) { | 822 | + if (tunnel.annotations().value("bandwidth") != null) { |
823 | iBandwidth = Integer.parseInt(tunnel.annotations().value("bandwidth")); | 823 | iBandwidth = Integer.parseInt(tunnel.annotations().value("bandwidth")); |
824 | } | 824 | } |
825 | // build bandwidth object | 825 | // build bandwidth object |
... | @@ -957,7 +957,7 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid | ... | @@ -957,7 +957,7 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid |
957 | break; | 957 | break; |
958 | } | 958 | } |
959 | } | 959 | } |
960 | - if (null != ipv4LspTlv) { | 960 | + if (ipv4LspTlv != null) { |
961 | pcepTunnelData.setStatefulIpv4IndentifierTlv(ipv4LspTlv); | 961 | pcepTunnelData.setStatefulIpv4IndentifierTlv(ipv4LspTlv); |
962 | } | 962 | } |
963 | 963 | ||
... | @@ -1021,7 +1021,7 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid | ... | @@ -1021,7 +1021,7 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid |
1021 | } | 1021 | } |
1022 | log.debug("Sync report received"); | 1022 | log.debug("Sync report received"); |
1023 | 1023 | ||
1024 | - if (null != msgPath.getBandwidthObject()) { | 1024 | + if (msgPath.getBandwidthObject() != null) { |
1025 | bandwidth = msgPath.getBandwidthObject().getBandwidth(); | 1025 | bandwidth = msgPath.getBandwidthObject().getBandwidth(); |
1026 | } | 1026 | } |
1027 | 1027 | ... | ... |
-
Please register or login to post a comment