Flip right hand side and left hand side of if-condition

Change-Id: Ic7574e645d0d6b5dc7a1e25ae2eb36212c96ab4b
This commit is contained in:
Sho SHIMIZU 2015-09-03 09:39:52 -07:00 committed by Thomas Vachuska
parent 1da61a2404
commit de09fa0bb0
19 changed files with 33 additions and 33 deletions

View File

@ -144,7 +144,7 @@ public class PcepAttributeVer1 implements PcepAttribute {
*/ */
public boolean parseMetricList(ChannelBuffer cb) throws PcepParseException { public boolean parseMetricList(ChannelBuffer cb) throws PcepParseException {
if (null == llMetricList) { if (llMetricList == null) {
llMetricList = new LinkedList<PcepMetricObject>(); llMetricList = new LinkedList<PcepMetricObject>();
} }

View File

@ -120,8 +120,8 @@ public class PcepEndPointsObjectVer1 implements PcepEndPointsObject {
int destIpAddress; int destIpAddress;
endPointsObjHeader = PcepObjectHeader.read(cb); endPointsObjHeader = PcepObjectHeader.read(cb);
if (END_POINTS_OBJ_TYPE == endPointsObjHeader.getObjType() if (endPointsObjHeader.getObjType() == END_POINTS_OBJ_TYPE
&& END_POINTS_OBJ_CLASS == endPointsObjHeader.getObjClass()) { && endPointsObjHeader.getObjClass() == END_POINTS_OBJ_CLASS) {
sourceIpAddress = cb.readInt(); sourceIpAddress = cb.readInt();
destIpAddress = cb.readInt(); destIpAddress = cb.readInt();
} else { } else {

View File

@ -212,7 +212,7 @@ public class PcepErrorObjectVer1 implements PcepErrorObject {
while (listIterator.hasNext()) { while (listIterator.hasNext()) {
PcepValueType tlv = listIterator.next(); PcepValueType tlv = listIterator.next();
if (null == tlv) { if (tlv == null) {
log.debug("TLV is null from OptionalTlv list"); log.debug("TLV is null from OptionalTlv list");
continue; continue;
} }

View File

@ -393,12 +393,12 @@ public class PcepErrorVer1 implements PcepError {
ToStringHelper toStrHelper = MoreObjects.toStringHelper(getClass()); ToStringHelper toStrHelper = MoreObjects.toStringHelper(getClass());
//RP Object list is optional //RP Object list is optional
if (null != llRPObjList) { if (llRPObjList != null) {
toStrHelper.add("RpObjectList", llRPObjList); toStrHelper.add("RpObjectList", llRPObjList);
} }
//TE Object list is optional //TE Object list is optional
if (null != llTEObjList) { if (llTEObjList != null) {
toStrHelper.add("TeObjectList", llTEObjList); toStrHelper.add("TeObjectList", llTEObjList);
} }

View File

@ -126,7 +126,7 @@ class PcepInitiateMsgVer1 implements PcepInitiateMsg {
boolean isDelLspRequest = false; boolean isDelLspRequest = false;
if (null == cb) { if (cb == null) {
throw new PcepParseException("Channel buffer is empty"); throw new PcepParseException("Channel buffer is empty");
} }

View File

@ -250,7 +250,7 @@ public class PcepLabelObjectVer1 implements PcepLabelObject {
while (listIterator.hasNext()) { while (listIterator.hasNext()) {
PcepValueType tlv = listIterator.next(); PcepValueType tlv = listIterator.next();
if (null == tlv) { if (tlv == null) {
log.debug("tlv is null from OptionalTlv list"); log.debug("tlv is null from OptionalTlv list");
continue; continue;
} }

View File

@ -235,7 +235,7 @@ public class PcepLabelRangeObjectVer1 implements PcepLabelRangeObject {
while (listIterator.hasNext()) { while (listIterator.hasNext()) {
PcepValueType tlv = listIterator.next(); PcepValueType tlv = listIterator.next();
if (null == tlv) { if (tlv == null) {
log.debug("tlv is null from OptionalTlv list"); log.debug("tlv is null from OptionalTlv list");
continue; continue;
} }

View File

@ -377,7 +377,7 @@ public class PcepLspObjectVer1 implements PcepLspObject {
while (listIterator.hasNext()) { while (listIterator.hasNext()) {
PcepValueType tlv = listIterator.next(); PcepValueType tlv = listIterator.next();
if (null == tlv) { if (tlv == null) {
log.debug("tlv is null from OptionalTlv list"); log.debug("tlv is null from OptionalTlv list");
continue; continue;
} }

View File

@ -308,7 +308,7 @@ public class PcepLspaObjectVer1 implements PcepLspaObject {
ListIterator<PcepValueType> listIterator = llOptionalTlv.listIterator(); ListIterator<PcepValueType> listIterator = llOptionalTlv.listIterator();
while (listIterator.hasNext()) { while (listIterator.hasNext()) {
PcepValueType tlv = listIterator.next(); PcepValueType tlv = listIterator.next();
if (null == tlv) { if (tlv == null) {
log.debug("Warning: tlv is null from OptionalTlv list"); log.debug("Warning: tlv is null from OptionalTlv list");
continue; continue;
} }

View File

@ -326,7 +326,7 @@ public class PcepOpenObjectVer1 implements PcepOpenObject {
ListIterator<PcepValueType> listIterator = llOptionalTlv.listIterator(); ListIterator<PcepValueType> listIterator = llOptionalTlv.listIterator();
while (listIterator.hasNext()) { while (listIterator.hasNext()) {
PcepValueType tlv = listIterator.next(); PcepValueType tlv = listIterator.next();
if (null == tlv) { if (tlv == null) {
log.debug("TLV is null from OptionalTlv list"); log.debug("TLV is null from OptionalTlv list");
continue; continue;
} }

View File

@ -253,7 +253,7 @@ class PcepReportMsgVer1 implements PcepReportMsg {
PcepSrpObject srpObj = stateRpt.getSrpObject(); PcepSrpObject srpObj = stateRpt.getSrpObject();
//SRP object is optional //SRP object is optional
if (null != srpObj) { if (srpObj != null) {
srpObj.write(cb); srpObj.write(cb);
} }

View File

@ -159,7 +159,7 @@ public class PcepSrpObjectVer1 implements PcepSrpObject {
srpObjHeader = PcepObjectHeader.read(cb); 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()); throw new PcepParseException("SRP object expected. But received " + srpObjHeader.getObjClass());
} }
@ -258,7 +258,7 @@ public class PcepSrpObjectVer1 implements PcepSrpObject {
while (listIterator.hasNext()) { while (listIterator.hasNext()) {
PcepValueType tlv = listIterator.next(); PcepValueType tlv = listIterator.next();
if (null == tlv) { if (tlv == null) {
log.debug("tlv is null from OptionalTlv list"); log.debug("tlv is null from OptionalTlv list");
continue; continue;
} }

View File

@ -98,22 +98,22 @@ public class PcepStateReportVer1 implements PcepStateReport {
this.attrList = attrList; this.attrList = attrList;
this.rroObj = rroObj; this.rroObj = rroObj;
this.bandwidth = bandwidth; this.bandwidth = bandwidth;
if (null == rroObj) { if (rroObj == null) {
this.isRroObjectSet = false; this.isRroObjectSet = false;
} else { } else {
this.isRroObjectSet = true; this.isRroObjectSet = true;
} }
if (null == eroObj) { if (eroObj == null) {
this.isEroObjectSet = false; this.isEroObjectSet = false;
} else { } else {
this.isEroObjectSet = true; this.isEroObjectSet = true;
} }
if (null == attrList) { if (attrList == null) {
this.isAttributeListSet = false; this.isAttributeListSet = false;
} else { } else {
this.isAttributeListSet = true; this.isAttributeListSet = true;
} }
if (null == bandwidth) { if (bandwidth == null) {
this.isBandwidthObjectSet = false; this.isBandwidthObjectSet = false;
} else { } else {
this.isBandwidthObjectSet = true; this.isBandwidthObjectSet = true;

View File

@ -343,7 +343,7 @@ public class PcepTEObjectVer1 implements PcepTEObject {
while (listIterator.hasNext()) { while (listIterator.hasNext()) {
PcepValueType tlv = listIterator.next(); PcepValueType tlv = listIterator.next();
if (null == tlv) { if (tlv == null) {
log.debug("TLV is null from OptionalTlv list"); log.debug("TLV is null from OptionalTlv list");
continue; continue;
} }

View File

@ -152,7 +152,7 @@ public class LocalTENodeDescriptorsTLV implements PcepValueType {
while (listIterator.hasNext()) { while (listIterator.hasNext()) {
PcepValueType tlv = listIterator.next(); PcepValueType tlv = listIterator.next();
if (null == tlv) { if (tlv == null) {
log.debug("TLV is null from subTlv list"); log.debug("TLV is null from subTlv list");
continue; continue;
} }

View File

@ -102,13 +102,13 @@ public class PcepRsvpUserErrorSpec implements PcepRsvpErrorSpec {
cb.writeShort(userErrorValue); cb.writeShort(userErrorValue);
cb.writeBytes(errDesc); cb.writeBytes(errDesc);
if (null != llRsvpUserSpecSubObj) { if (llRsvpUserSpecSubObj != null) {
ListIterator<PcepValueType> listIterator = llRsvpUserSpecSubObj.listIterator(); ListIterator<PcepValueType> listIterator = llRsvpUserSpecSubObj.listIterator();
while (listIterator.hasNext()) { while (listIterator.hasNext()) {
PcepValueType tlv = listIterator.next(); PcepValueType tlv = listIterator.next();
if (null == tlv) { if (tlv == null) {
continue; continue;
} }
tlv.write(cb); tlv.write(cb);
@ -145,7 +145,7 @@ public class PcepRsvpUserErrorSpec implements PcepRsvpErrorSpec {
objHeader = PcepRsvpSpecObjHeader.read(cb); 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."); throw new PcepParseException("Expected PcepRsvpUserErrorSpec object.");
} }
enterpriseNum = cb.readInt(); enterpriseNum = cb.readInt();

View File

@ -154,7 +154,7 @@ public class RemoteTENodeDescriptorsTLV implements PcepValueType {
while (listIterator.hasNext()) { while (listIterator.hasNext()) {
PcepValueType tlv = listIterator.next(); PcepValueType tlv = listIterator.next();
if (null == tlv) { if (tlv == null) {
log.debug("TLV is null from subTlv list"); log.debug("TLV is null from subTlv list");
continue; continue;
} }

View File

@ -152,7 +152,7 @@ public class TELinkAttributesTlv implements PcepValueType {
while (listIterator.hasNext()) { while (listIterator.hasNext()) {
PcepValueType tlv = listIterator.next(); PcepValueType tlv = listIterator.next();
if (null == tlv) { if (tlv == null) {
log.debug("TLV is null from subTlv list"); log.debug("TLV is null from subTlv list");
continue; continue;
} }

View File

@ -628,7 +628,7 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid
PcepValueType tlv; PcepValueType tlv;
LinkedList<PcepValueType> llSubObjects = createPcepPath(path); 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"); log.error("There is no link information to create tunnel");
return null; return null;
} }
@ -661,7 +661,7 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid
PcepEroObject eroobj = pc.factory().buildEroObject().setSubObjects(llSubObjects).build(); PcepEroObject eroobj = pc.factory().buildEroObject().setSubObjects(llSubObjects).build();
int iBandwidth = DEFAULT_BANDWIDTH_VALUE; int iBandwidth = DEFAULT_BANDWIDTH_VALUE;
if (null != tunnel.annotations().value("bandwidth")) { if (tunnel.annotations().value("bandwidth") != null) {
iBandwidth = Integer.parseInt(tunnel.annotations().value("bandwidth")); iBandwidth = Integer.parseInt(tunnel.annotations().value("bandwidth"));
} }
// build bandwidth object // build bandwidth object
@ -692,7 +692,7 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid
LinkedList<PcInitiatedLspRequest> llPcInitiatedLspRequestList = createPcInitiatedLspReqList(tunnel, path, LinkedList<PcInitiatedLspRequest> llPcInitiatedLspRequestList = createPcInitiatedLspReqList(tunnel, path,
pc, srpId); pc, srpId);
if (null == llPcInitiatedLspRequestList || 0 == llPcInitiatedLspRequestList.size()) { if (llPcInitiatedLspRequestList == null || llPcInitiatedLspRequestList.size() == 0) {
log.error("Failed to create PcInitiatedLspRequestList"); log.error("Failed to create PcInitiatedLspRequestList");
return; return;
} }
@ -740,7 +740,7 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid
LinkedList<PcepValueType> llOptionalTlv = new LinkedList<PcepValueType>(); LinkedList<PcepValueType> llOptionalTlv = new LinkedList<PcepValueType>();
LinkedList<PcInitiatedLspRequest> llPcInitiatedLspRequestList = new LinkedList<PcInitiatedLspRequest>(); LinkedList<PcInitiatedLspRequest> llPcInitiatedLspRequestList = new LinkedList<PcInitiatedLspRequest>();
if (null != statefulIpv4IndentifierTlv) { if (statefulIpv4IndentifierTlv != null) {
tlv = statefulIpv4IndentifierTlv; tlv = statefulIpv4IndentifierTlv;
} else { } else {
tlv = new StatefulIPv4LspIdentidiersTlv(( tlv = new StatefulIPv4LspIdentidiersTlv((
@ -819,7 +819,7 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid
PcepEroObject eroobj = pc.factory().buildEroObject().setSubObjects(llSubObjects).build(); PcepEroObject eroobj = pc.factory().buildEroObject().setSubObjects(llSubObjects).build();
int iBandwidth = DEFAULT_BANDWIDTH_VALUE; int iBandwidth = DEFAULT_BANDWIDTH_VALUE;
if (null != tunnel.annotations().value("bandwidth")) { if (tunnel.annotations().value("bandwidth") != null) {
iBandwidth = Integer.parseInt(tunnel.annotations().value("bandwidth")); iBandwidth = Integer.parseInt(tunnel.annotations().value("bandwidth"));
} }
// build bandwidth object // build bandwidth object
@ -957,7 +957,7 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid
break; break;
} }
} }
if (null != ipv4LspTlv) { if (ipv4LspTlv != null) {
pcepTunnelData.setStatefulIpv4IndentifierTlv(ipv4LspTlv); pcepTunnelData.setStatefulIpv4IndentifierTlv(ipv4LspTlv);
} }
@ -1021,7 +1021,7 @@ public class PcepTunnelProvider extends AbstractProvider implements TunnelProvid
} }
log.debug("Sync report received"); log.debug("Sync report received");
if (null != msgPath.getBandwidthObject()) { if (msgPath.getBandwidthObject() != null) {
bandwidth = msgPath.getBandwidthObject().getBandwidth(); bandwidth = msgPath.getBandwidthObject().getBandwidth();
} }