Avoid unnecessary boxing.
Change-Id: I8fce87e3b1ba1f65f0e379c60e5d71d637228b61
diff --git a/providers/null/device/src/main/java/org/onosproject/provider/nil/device/impl/NullDeviceProvider.java b/providers/null/device/src/main/java/org/onosproject/provider/nil/device/impl/NullDeviceProvider.java
index d6be465..b2b0b51 100644
--- a/providers/null/device/src/main/java/org/onosproject/provider/nil/device/impl/NullDeviceProvider.java
+++ b/providers/null/device/src/main/java/org/onosproject/provider/nil/device/impl/NullDeviceProvider.java
@@ -156,7 +156,7 @@
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 @@
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;
}
diff --git a/providers/null/link/src/main/java/org/onosproject/provider/nil/link/impl/NullLinkProvider.java b/providers/null/link/src/main/java/org/onosproject/provider/nil/link/impl/NullLinkProvider.java
index 514f42e..d369d02 100644
--- a/providers/null/link/src/main/java/org/onosproject/provider/nil/link/impl/NullLinkProvider.java
+++ b/providers/null/link/src/main/java/org/onosproject/provider/nil/link/impl/NullLinkProvider.java
@@ -163,7 +163,7 @@
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 @@
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));
}
diff --git a/providers/null/packet/src/main/java/org/onosproject/provider/nil/packet/impl/NullPacketProvider.java b/providers/null/packet/src/main/java/org/onosproject/provider/nil/packet/impl/NullPacketProvider.java
index 1b41d55..ea8d53d 100644
--- a/providers/null/packet/src/main/java/org/onosproject/provider/nil/packet/impl/NullPacketProvider.java
+++ b/providers/null/packet/src/main/java/org/onosproject/provider/nil/packet/impl/NullPacketProvider.java
@@ -122,7 +122,7 @@
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;