Yuta HIGUCHI

Avoid unnecessary boxing.

Change-Id: I8fce87e3b1ba1f65f0e379c60e5d71d637228b61
......@@ -156,7 +156,7 @@ public class NullDeviceProvider extends AbstractProvider implements DeviceProvid
newDevNum = getDevicesConfig(s);
}
s = (String) properties.get("numPorts");
newPortNum = isNullOrEmpty(s) ? DEF_NUMPORTS : Integer.valueOf(s.trim());
newPortNum = isNullOrEmpty(s) ? DEF_NUMPORTS : Integer.parseInt(s.trim());
} catch (Exception e) {
log.warn(e.getMessage());
newDevNum = numDevices;
......@@ -183,7 +183,7 @@ public class NullDeviceProvider extends AbstractProvider implements DeviceProvid
NodeId that = new NodeId(params[0].trim());
String nd = params[1];
if (clusterService.getLocalNode().id().equals(that)) {
return Integer.valueOf(nd.trim());
return Integer.parseInt(nd.trim());
}
continue;
}
......
......@@ -163,7 +163,7 @@ public class NullLinkProvider extends AbstractProvider implements LinkProvider {
String newNbor;
try {
String s = (String) properties.get("eventRate");
newRate = isNullOrEmpty(s) ? eventRate : Integer.valueOf(s.trim());
newRate = isNullOrEmpty(s) ? eventRate : Integer.parseInt(s.trim());
s = (String) properties.get("neighbors");
newNbor = isNullOrEmpty(s) ? neighbor : getNeighbor(s.trim());
} catch (Exception e) {
......@@ -239,7 +239,7 @@ public class NullLinkProvider extends AbstractProvider implements LinkProvider {
String part = part(did.toString());
String npart = nIdPart(did.toString());
if (part.equals("ffff") & npart.equals(neighbor)) {
if (part.equals("ffff") && npart.equals(neighbor)) {
// 'tail' of our neighboring island - link us <- tail
tails.add(new ConnectPoint(did, SRCPORT));
}
......
......@@ -122,7 +122,7 @@ public class NullPacketProvider extends AbstractProvider implements
int newRate;
try {
String s = String.valueOf(properties.get("pktRate"));
newRate = isNullOrEmpty(s) ? pktRate : Integer.valueOf(s.trim());
newRate = isNullOrEmpty(s) ? pktRate : Integer.parseInt(s.trim());
} catch (Exception e) {
log.warn(e.getMessage());
newRate = pktRate;
......