mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-11-03 09:41:14 +01:00
Flip right hand side and left hand side of if-condition
Change-Id: Ic7574e645d0d6b5dc7a1e25ae2eb36212c96ab4b
This commit is contained in:
parent
1da61a2404
commit
de09fa0bb0
@ -144,7 +144,7 @@ public class PcepAttributeVer1 implements PcepAttribute {
|
||||
*/
|
||||
public boolean parseMetricList(ChannelBuffer cb) throws PcepParseException {
|
||||
|
||||
if (null == llMetricList) {
|
||||
if (llMetricList == null) {
|
||||
llMetricList = new LinkedList<PcepMetricObject>();
|
||||
}
|
||||
|
||||
|
||||
@ -120,8 +120,8 @@ public class PcepEndPointsObjectVer1 implements PcepEndPointsObject {
|
||||
int destIpAddress;
|
||||
|
||||
endPointsObjHeader = PcepObjectHeader.read(cb);
|
||||
if (END_POINTS_OBJ_TYPE == endPointsObjHeader.getObjType()
|
||||
&& END_POINTS_OBJ_CLASS == endPointsObjHeader.getObjClass()) {
|
||||
if (endPointsObjHeader.getObjType() == END_POINTS_OBJ_TYPE
|
||||
&& endPointsObjHeader.getObjClass() == END_POINTS_OBJ_CLASS) {
|
||||
sourceIpAddress = cb.readInt();
|
||||
destIpAddress = cb.readInt();
|
||||
} else {
|
||||
|
||||
@ -212,7 +212,7 @@ public class PcepErrorObjectVer1 implements PcepErrorObject {
|
||||
while (listIterator.hasNext()) {
|
||||
PcepValueType tlv = listIterator.next();
|
||||
|
||||
if (null == tlv) {
|
||||
if (tlv == null) {
|
||||
log.debug("TLV is null from OptionalTlv list");
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -393,12 +393,12 @@ public class PcepErrorVer1 implements PcepError {
|
||||
ToStringHelper toStrHelper = MoreObjects.toStringHelper(getClass());
|
||||
|
||||
//RP Object list is optional
|
||||
if (null != llRPObjList) {
|
||||
if (llRPObjList != null) {
|
||||
toStrHelper.add("RpObjectList", llRPObjList);
|
||||
}
|
||||
|
||||
//TE Object list is optional
|
||||
if (null != llTEObjList) {
|
||||
if (llTEObjList != null) {
|
||||
toStrHelper.add("TeObjectList", llTEObjList);
|
||||
}
|
||||
|
||||
|
||||
@ -126,7 +126,7 @@ class PcepInitiateMsgVer1 implements PcepInitiateMsg {
|
||||
|
||||
boolean isDelLspRequest = false;
|
||||
|
||||
if (null == cb) {
|
||||
if (cb == null) {
|
||||
throw new PcepParseException("Channel buffer is empty");
|
||||
}
|
||||
|
||||
|
||||
@ -250,7 +250,7 @@ public class PcepLabelObjectVer1 implements PcepLabelObject {
|
||||
while (listIterator.hasNext()) {
|
||||
PcepValueType tlv = listIterator.next();
|
||||
|
||||
if (null == tlv) {
|
||||
if (tlv == null) {
|
||||
log.debug("tlv is null from OptionalTlv list");
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -235,7 +235,7 @@ public class PcepLabelRangeObjectVer1 implements PcepLabelRangeObject {
|
||||
while (listIterator.hasNext()) {
|
||||
PcepValueType tlv = listIterator.next();
|
||||
|
||||
if (null == tlv) {
|
||||
if (tlv == null) {
|
||||
log.debug("tlv is null from OptionalTlv list");
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -377,7 +377,7 @@ public class PcepLspObjectVer1 implements PcepLspObject {
|
||||
while (listIterator.hasNext()) {
|
||||
PcepValueType tlv = listIterator.next();
|
||||
|
||||
if (null == tlv) {
|
||||
if (tlv == null) {
|
||||
log.debug("tlv is null from OptionalTlv list");
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -308,7 +308,7 @@ public class PcepLspaObjectVer1 implements PcepLspaObject {
|
||||
ListIterator<PcepValueType> listIterator = llOptionalTlv.listIterator();
|
||||
while (listIterator.hasNext()) {
|
||||
PcepValueType tlv = listIterator.next();
|
||||
if (null == tlv) {
|
||||
if (tlv == null) {
|
||||
log.debug("Warning: tlv is null from OptionalTlv list");
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -326,7 +326,7 @@ public class PcepOpenObjectVer1 implements PcepOpenObject {
|
||||
ListIterator<PcepValueType> listIterator = llOptionalTlv.listIterator();
|
||||
while (listIterator.hasNext()) {
|
||||
PcepValueType tlv = listIterator.next();
|
||||
if (null == tlv) {
|
||||
if (tlv == null) {
|
||||
log.debug("TLV is null from OptionalTlv list");
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -253,7 +253,7 @@ class PcepReportMsgVer1 implements PcepReportMsg {
|
||||
PcepSrpObject srpObj = stateRpt.getSrpObject();
|
||||
|
||||
//SRP object is optional
|
||||
if (null != srpObj) {
|
||||
if (srpObj != null) {
|
||||
srpObj.write(cb);
|
||||
}
|
||||
|
||||
|
||||
@ -159,7 +159,7 @@ public class PcepSrpObjectVer1 implements PcepSrpObject {
|
||||
|
||||
srpObjHeader = PcepObjectHeader.read(cb);
|
||||
|
||||
if (SRP_OBJ_CLASS != srpObjHeader.getObjClass()) {
|
||||
if (srpObjHeader.getObjClass() != SRP_OBJ_CLASS) {
|
||||
throw new PcepParseException("SRP object expected. But received " + srpObjHeader.getObjClass());
|
||||
}
|
||||
|
||||
@ -258,7 +258,7 @@ public class PcepSrpObjectVer1 implements PcepSrpObject {
|
||||
while (listIterator.hasNext()) {
|
||||
PcepValueType tlv = listIterator.next();
|
||||
|
||||
if (null == tlv) {
|
||||
if (tlv == null) {
|
||||
log.debug("tlv is null from OptionalTlv list");
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -98,22 +98,22 @@ public class PcepStateReportVer1 implements PcepStateReport {
|
||||
this.attrList = attrList;
|
||||
this.rroObj = rroObj;
|
||||
this.bandwidth = bandwidth;
|
||||
if (null == rroObj) {
|
||||
if (rroObj == null) {
|
||||
this.isRroObjectSet = false;
|
||||
} else {
|
||||
this.isRroObjectSet = true;
|
||||
}
|
||||
if (null == eroObj) {
|
||||
if (eroObj == null) {
|
||||
this.isEroObjectSet = false;
|
||||
} else {
|
||||
this.isEroObjectSet = true;
|
||||
}
|
||||
if (null == attrList) {
|
||||
if (attrList == null) {
|
||||
this.isAttributeListSet = false;
|
||||
} else {
|
||||
this.isAttributeListSet = true;
|
||||
}
|
||||
if (null == bandwidth) {
|
||||
if (bandwidth == null) {
|
||||
this.isBandwidthObjectSet = false;
|
||||
} else {
|
||||
this.isBandwidthObjectSet = true;
|
||||
|
||||
@ -343,7 +343,7 @@ public class PcepTEObjectVer1 implements PcepTEObject {
|
||||
while (listIterator.hasNext()) {
|
||||
PcepValueType tlv = listIterator.next();
|
||||
|
||||
if (null == tlv) {
|
||||
if (tlv == null) {
|
||||
log.debug("TLV is null from OptionalTlv list");
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -152,7 +152,7 @@ public class LocalTENodeDescriptorsTLV implements PcepValueType {
|
||||
|
||||
while (listIterator.hasNext()) {
|
||||
PcepValueType tlv = listIterator.next();
|
||||
if (null == tlv) {
|
||||
if (tlv == null) {
|
||||
log.debug("TLV is null from subTlv list");
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -102,13 +102,13 @@ public class PcepRsvpUserErrorSpec implements PcepRsvpErrorSpec {
|
||||
cb.writeShort(userErrorValue);
|
||||
cb.writeBytes(errDesc);
|
||||
|
||||
if (null != llRsvpUserSpecSubObj) {
|
||||
if (llRsvpUserSpecSubObj != null) {
|
||||
|
||||
ListIterator<PcepValueType> listIterator = llRsvpUserSpecSubObj.listIterator();
|
||||
|
||||
while (listIterator.hasNext()) {
|
||||
PcepValueType tlv = listIterator.next();
|
||||
if (null == tlv) {
|
||||
if (tlv == null) {
|
||||
continue;
|
||||
}
|
||||
tlv.write(cb);
|
||||
@ -145,7 +145,7 @@ public class PcepRsvpUserErrorSpec implements PcepRsvpErrorSpec {
|
||||
|
||||
objHeader = PcepRsvpSpecObjHeader.read(cb);
|
||||
|
||||
if (CLASS_NUM != objHeader.getObjClassNum() || CLASS_TYPE != objHeader.getObjClassType()) {
|
||||
if (objHeader.getObjClassNum() != CLASS_NUM || objHeader.getObjClassType() != CLASS_TYPE) {
|
||||
throw new PcepParseException("Expected PcepRsvpUserErrorSpec object.");
|
||||
}
|
||||
enterpriseNum = cb.readInt();
|
||||
|
||||
@ -154,7 +154,7 @@ public class RemoteTENodeDescriptorsTLV implements PcepValueType {
|
||||
while (listIterator.hasNext()) {
|
||||
PcepValueType tlv = listIterator.next();
|
||||
|
||||
if (null == tlv) {
|
||||
if (tlv == null) {
|
||||
log.debug("TLV is null from subTlv list");
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -152,7 +152,7 @@ public class TELinkAttributesTlv implements PcepValueType {
|
||||
while (listIterator.hasNext()) {
|
||||
PcepValueType tlv = listIterator.next();
|
||||
|
||||
if (null == tlv) {
|
||||
if (tlv == null) {
|
||||
log.debug("TLV is null from subTlv list");
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -628,7 +628,7 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid
|
||||
PcepValueType tlv;
|
||||
LinkedList<PcepValueType> llSubObjects = createPcepPath(path);
|
||||
|
||||
if (null == llSubObjects || 0 == llSubObjects.size()) {
|
||||
if (llSubObjects == null || llSubObjects.size() == 0) {
|
||||
log.error("There is no link information to create tunnel");
|
||||
return null;
|
||||
}
|
||||
@ -661,7 +661,7 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid
|
||||
PcepEroObject eroobj = pc.factory().buildEroObject().setSubObjects(llSubObjects).build();
|
||||
|
||||
int iBandwidth = DEFAULT_BANDWIDTH_VALUE;
|
||||
if (null != tunnel.annotations().value("bandwidth")) {
|
||||
if (tunnel.annotations().value("bandwidth") != null) {
|
||||
iBandwidth = Integer.parseInt(tunnel.annotations().value("bandwidth"));
|
||||
}
|
||||
// build bandwidth object
|
||||
@ -692,7 +692,7 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid
|
||||
|
||||
LinkedList<PcInitiatedLspRequest> llPcInitiatedLspRequestList = createPcInitiatedLspReqList(tunnel, path,
|
||||
pc, srpId);
|
||||
if (null == llPcInitiatedLspRequestList || 0 == llPcInitiatedLspRequestList.size()) {
|
||||
if (llPcInitiatedLspRequestList == null || llPcInitiatedLspRequestList.size() == 0) {
|
||||
log.error("Failed to create PcInitiatedLspRequestList");
|
||||
return;
|
||||
}
|
||||
@ -740,7 +740,7 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid
|
||||
LinkedList<PcepValueType> llOptionalTlv = new LinkedList<PcepValueType>();
|
||||
LinkedList<PcInitiatedLspRequest> llPcInitiatedLspRequestList = new LinkedList<PcInitiatedLspRequest>();
|
||||
|
||||
if (null != statefulIpv4IndentifierTlv) {
|
||||
if (statefulIpv4IndentifierTlv != null) {
|
||||
tlv = statefulIpv4IndentifierTlv;
|
||||
} else {
|
||||
tlv = new StatefulIPv4LspIdentidiersTlv((
|
||||
@ -819,7 +819,7 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid
|
||||
PcepEroObject eroobj = pc.factory().buildEroObject().setSubObjects(llSubObjects).build();
|
||||
|
||||
int iBandwidth = DEFAULT_BANDWIDTH_VALUE;
|
||||
if (null != tunnel.annotations().value("bandwidth")) {
|
||||
if (tunnel.annotations().value("bandwidth") != null) {
|
||||
iBandwidth = Integer.parseInt(tunnel.annotations().value("bandwidth"));
|
||||
}
|
||||
// build bandwidth object
|
||||
@ -957,7 +957,7 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (null != ipv4LspTlv) {
|
||||
if (ipv4LspTlv != null) {
|
||||
pcepTunnelData.setStatefulIpv4IndentifierTlv(ipv4LspTlv);
|
||||
}
|
||||
|
||||
@ -1021,7 +1021,7 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid
|
||||
}
|
||||
log.debug("Sync report received");
|
||||
|
||||
if (null != msgPath.getBandwidthObject()) {
|
||||
if (msgPath.getBandwidthObject() != null) {
|
||||
bandwidth = msgPath.getBandwidthObject().getBandwidth();
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user