Avoid unnecessary boxing.
Change-Id: I8fce87e3b1ba1f65f0e379c60e5d71d637228b61
Showing
3 changed files
with
5 additions
and
5 deletions
providers/null/device/src/main/java/org/onosproject/provider/nil/device/impl/NullDeviceProvider.java
... | @@ -156,7 +156,7 @@ public class NullDeviceProvider extends AbstractProvider implements DeviceProvid | ... | @@ -156,7 +156,7 @@ public class NullDeviceProvider extends AbstractProvider implements DeviceProvid |
156 | newDevNum = getDevicesConfig(s); | 156 | newDevNum = getDevicesConfig(s); |
157 | } | 157 | } |
158 | s = (String) properties.get("numPorts"); | 158 | s = (String) properties.get("numPorts"); |
159 | - newPortNum = isNullOrEmpty(s) ? DEF_NUMPORTS : Integer.valueOf(s.trim()); | 159 | + newPortNum = isNullOrEmpty(s) ? DEF_NUMPORTS : Integer.parseInt(s.trim()); |
160 | } catch (Exception e) { | 160 | } catch (Exception e) { |
161 | log.warn(e.getMessage()); | 161 | log.warn(e.getMessage()); |
162 | newDevNum = numDevices; | 162 | newDevNum = numDevices; |
... | @@ -183,7 +183,7 @@ public class NullDeviceProvider extends AbstractProvider implements DeviceProvid | ... | @@ -183,7 +183,7 @@ public class NullDeviceProvider extends AbstractProvider implements DeviceProvid |
183 | NodeId that = new NodeId(params[0].trim()); | 183 | NodeId that = new NodeId(params[0].trim()); |
184 | String nd = params[1]; | 184 | String nd = params[1]; |
185 | if (clusterService.getLocalNode().id().equals(that)) { | 185 | if (clusterService.getLocalNode().id().equals(that)) { |
186 | - return Integer.valueOf(nd.trim()); | 186 | + return Integer.parseInt(nd.trim()); |
187 | } | 187 | } |
188 | continue; | 188 | continue; |
189 | } | 189 | } | ... | ... |
... | @@ -163,7 +163,7 @@ public class NullLinkProvider extends AbstractProvider implements LinkProvider { | ... | @@ -163,7 +163,7 @@ public class NullLinkProvider extends AbstractProvider implements LinkProvider { |
163 | String newNbor; | 163 | String newNbor; |
164 | try { | 164 | try { |
165 | String s = (String) properties.get("eventRate"); | 165 | String s = (String) properties.get("eventRate"); |
166 | - newRate = isNullOrEmpty(s) ? eventRate : Integer.valueOf(s.trim()); | 166 | + newRate = isNullOrEmpty(s) ? eventRate : Integer.parseInt(s.trim()); |
167 | s = (String) properties.get("neighbors"); | 167 | s = (String) properties.get("neighbors"); |
168 | newNbor = isNullOrEmpty(s) ? neighbor : getNeighbor(s.trim()); | 168 | newNbor = isNullOrEmpty(s) ? neighbor : getNeighbor(s.trim()); |
169 | } catch (Exception e) { | 169 | } catch (Exception e) { |
... | @@ -239,7 +239,7 @@ public class NullLinkProvider extends AbstractProvider implements LinkProvider { | ... | @@ -239,7 +239,7 @@ public class NullLinkProvider extends AbstractProvider implements LinkProvider { |
239 | 239 | ||
240 | String part = part(did.toString()); | 240 | String part = part(did.toString()); |
241 | String npart = nIdPart(did.toString()); | 241 | String npart = nIdPart(did.toString()); |
242 | - if (part.equals("ffff") & npart.equals(neighbor)) { | 242 | + if (part.equals("ffff") && npart.equals(neighbor)) { |
243 | // 'tail' of our neighboring island - link us <- tail | 243 | // 'tail' of our neighboring island - link us <- tail |
244 | tails.add(new ConnectPoint(did, SRCPORT)); | 244 | tails.add(new ConnectPoint(did, SRCPORT)); |
245 | } | 245 | } | ... | ... |
providers/null/packet/src/main/java/org/onosproject/provider/nil/packet/impl/NullPacketProvider.java
... | @@ -122,7 +122,7 @@ public class NullPacketProvider extends AbstractProvider implements | ... | @@ -122,7 +122,7 @@ public class NullPacketProvider extends AbstractProvider implements |
122 | int newRate; | 122 | int newRate; |
123 | try { | 123 | try { |
124 | String s = String.valueOf(properties.get("pktRate")); | 124 | String s = String.valueOf(properties.get("pktRate")); |
125 | - newRate = isNullOrEmpty(s) ? pktRate : Integer.valueOf(s.trim()); | 125 | + newRate = isNullOrEmpty(s) ? pktRate : Integer.parseInt(s.trim()); |
126 | } catch (Exception e) { | 126 | } catch (Exception e) { |
127 | log.warn(e.getMessage()); | 127 | log.warn(e.getMessage()); |
128 | newRate = pktRate; | 128 | newRate = pktRate; | ... | ... |
-
Please register or login to post a comment