Eliminate implicit boxing 56/73756/4
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 4 Jul 2018 15:36:06 +0000 (17:36 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 4 Jul 2018 17:42:12 +0000 (19:42 +0200)
There is no need to box values, use Boolean.TRUE/FALSE as needed.

Change-Id: I2a71106d7281f5b22e5d14f893f5a67c913e49f3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 files changed:
netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/osgi/NetconfCapabilityMonitoringService.java
netconf/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/actors/ReadAdapter.java
netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/MountPointEndToEndTest.java
netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/NetconfNodeActorTest.java
netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/NetconfNodeManagerTest.java
netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/ProxyDOMDataBrokerTest.java
netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/actors/ReadTransactionActorTest.java
netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/actors/ReadTransactionActorTestAdapter.java
netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/actors/ReadWriteTransactionActorTest.java
netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/actors/WriteTransactionActorTest.java
netconf/netconf-topology-singleton/src/test/java/org/opendaylight/netconf/topology/singleton/impl/tx/ProxyReadWriteTransactionTest.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/TesttoolParameters.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/client/http/perf/Parameters.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/client/stress/Parameters.java
netconf/tools/netconf-testtool/src/main/java/org/opendaylight/netconf/test/tool/client/stress/StressClientCallable.java

index 4aafb58654ac5c432da48efa5dc54514f52eac30..c8dc4c3003fe092b603b858af8347bf037ba8ae6 100644 (file)
@@ -234,8 +234,8 @@ class NetconfCapabilityMonitoringService implements CapabilityListener, AutoClos
     private static NetconfCapabilityChange computeDiff(final Set<Capability> added, final Set<Capability> removed) {
         final NetconfCapabilityChangeBuilder netconfCapabilityChangeBuilder = new NetconfCapabilityChangeBuilder();
         netconfCapabilityChangeBuilder
-                .setChangedBy(new ChangedByBuilder().setServerOrUser(new ServerBuilder().setServer(true).build())
-                        .build());
+                .setChangedBy(new ChangedByBuilder().setServerOrUser(
+                    new ServerBuilder().setServer(Boolean.TRUE).build()).build());
         netconfCapabilityChangeBuilder.setDeletedCapability(Lists.newArrayList(Collections2
                 .transform(removed, CAPABILITY_TO_URI)));
         netconfCapabilityChangeBuilder.setAddedCapability(Lists.newArrayList(Collections2
index 22e60a3cb1607972c70c0d4474f9d230cd2d7847..c7a7d232c0c6329651d95f3961856dd125f363d9 100644 (file)
@@ -74,7 +74,7 @@ class ReadAdapter {
             @Override
             public void onSuccess(final Boolean result) {
                 if (result == null) {
-                    sender.tell(false, self);
+                    sender.tell(Boolean.FALSE, self);
                 } else {
                     sender.tell(result, self);
                 }
index 07e57539148366885cd21d88a03cb7e10b4154d2..500a97bced913c167f4cbbc2432df927c8e2022c 100644 (file)
@@ -238,8 +238,8 @@ public class MountPointEndToEndTest {
     @After
     public void tearDown() throws Exception {
         deleteCacheDir();
-        TestKit.shutdownActorSystem(slaveSystem, Boolean.TRUE);
-        TestKit.shutdownActorSystem(masterSystem, Boolean.TRUE);
+        TestKit.shutdownActorSystem(slaveSystem, true);
+        TestKit.shutdownActorSystem(masterSystem, true);
     }
 
     private void setupMaster() throws Exception {
index 09415d9c67fcf16d0b03f0efdc14f9601a12fa92..321f5817aacad67ea3db84a2dfec8a98d5596a5d 100644 (file)
@@ -189,7 +189,7 @@ public class NetconfNodeActorTest {
 
     @After
     public void teardown() {
-        TestKit.shutdownActorSystem(system, Boolean.TRUE);
+        TestKit.shutdownActorSystem(system, true);
         system = null;
     }
 
index 873038de33d716353a71c7dbd67698bc4f3d5dab..33c0b70525344aca04b7abd719d712314d74f35c 100644 (file)
@@ -186,8 +186,8 @@ public class NetconfNodeManagerTest {
 
     @After
     public void teardown() {
-        TestKit.shutdownActorSystem(slaveSystem, Boolean.TRUE);
-        TestKit.shutdownActorSystem(masterSystem, Boolean.TRUE);
+        TestKit.shutdownActorSystem(slaveSystem, true);
+        TestKit.shutdownActorSystem(masterSystem, true);
     }
 
     @SuppressWarnings("unchecked")
index b1bc972576ec55aebf39b1acd237e07006894987..9c5c5f4c239b437122540afc73c5964d5e600dce 100644 (file)
@@ -48,7 +48,7 @@ public class ProxyDOMDataBrokerTest {
 
     @AfterClass
     public static void staticTearDown() {
-        TestKit.shutdownActorSystem(system, Boolean.TRUE);
+        TestKit.shutdownActorSystem(system, true);
     }
 
     @Test
index d39a8ed8e3e17d253e6e272afec4350268d17cb0..7dc4faadcb9506ba2dded49acc92bb8151e2372d 100644 (file)
@@ -31,6 +31,6 @@ public class ReadTransactionActorTest extends ReadTransactionActorTestAdapter {
 
     @AfterClass
     public static void staticTearDown() {
-        TestKit.shutdownActorSystem(system, Boolean.TRUE);
+        TestKit.shutdownActorSystem(system, true);
     }
 }
index 3d7f2b7c5a26fc143ac672ac01adbb6568312b6f..456950a9f229842e4a35ba9fa7a7b5c846a2674c 100644 (file)
@@ -86,11 +86,11 @@ public abstract class ReadTransactionActorTestAdapter {
 
     @Test
     public void testExists() {
-        when(mockReadTx.exists(STORE, PATH)).thenReturn(Futures.immediateCheckedFuture(true));
+        when(mockReadTx.exists(STORE, PATH)).thenReturn(Futures.immediateCheckedFuture(Boolean.TRUE));
         actorRef.tell(new ExistsRequest(STORE, PATH), probe.ref());
 
         verify(mockReadTx).exists(STORE, PATH);
-        probe.expectMsg(true);
+        probe.expectMsg(Boolean.TRUE);
     }
 
     @Test
index dc4d81a8f6dd881a2c21651596bad8cade8f2378..e0dc49542ab188c3ebd930f77ddb8df74e8f0cf1 100644 (file)
@@ -40,7 +40,7 @@ public class ReadWriteTransactionActorTest {
 
     @AfterClass
     public static void staticTearDown() {
-        TestKit.shutdownActorSystem(system, Boolean.TRUE);
+        TestKit.shutdownActorSystem(system, true);
     }
 
     @Test
index 759c11209cfc1e3f5de56738816ca7fbe3be95f9..91a4756c6e552ab2ff386c345294b780458ae8b0 100644 (file)
@@ -34,6 +34,6 @@ public class WriteTransactionActorTest extends WriteTransactionActorTestAdapter
 
     @AfterClass
     public static void staticTearDown() {
-        TestKit.shutdownActorSystem(system, Boolean.TRUE);
+        TestKit.shutdownActorSystem(system, true);
     }
 }
index ca74457f3da054d4d914f451ac9c2619d0dd762e..1d82be370f30bf216cc3463defb0d34d8df11e19 100644 (file)
@@ -74,7 +74,7 @@ public class ProxyReadWriteTransactionTest {
 
     @AfterClass
     public static void staticTearDown() {
-        TestKit.shutdownActorSystem(system, Boolean.TRUE);
+        TestKit.shutdownActorSystem(system, true);
     }
 
     private ProxyReadWriteTransaction newSuccessfulProxyTx() {
index 6310eab644e398e7c4e8f85736c3599e561e177f..368c186fe5221476aaf23a1c519590f9f868dabf 100644 (file)
@@ -112,7 +112,7 @@ public class TesttoolParameters {
 
         parser.addArgument("--async-requests")
                 .type(Boolean.class)
-                .setDefault(false)
+                .setDefault(Boolean.FALSE)
                 .dest("async");
 
         parser.addArgument("--thread-amount")
@@ -199,25 +199,25 @@ public class TesttoolParameters {
 
         parser.addArgument("--ssh")
                 .type(Boolean.class)
-                .setDefault(true)
+                .setDefault(Boolean.TRUE)
                 .help("Whether to use ssh for transport or just pure tcp")
                 .dest("ssh");
 
         parser.addArgument("--exi")
                 .type(Boolean.class)
-                .setDefault(true)
+                .setDefault(Boolean.TRUE)
                 .help("Whether to use exi to transport xml content")
                 .dest("exi");
 
         parser.addArgument("--debug")
                 .type(Boolean.class)
-                .setDefault(false)
+                .setDefault(Boolean.FALSE)
                 .help("Whether to use debug log level instead of INFO")
                 .dest("debug");
 
         parser.addArgument("--md-sal")
                 .type(Boolean.class)
-                .setDefault(false)
+                .setDefault(Boolean.FALSE)
                 .help("Whether to use md-sal datastore instead of default simulated datastore.")
                 .dest("md-sal");
 
index 4814940f33c427ccc4b7ec40292da9ab652a8a02..78f3eafb37f59ffb784b9fa0ebf07f394ff1c11e 100644 (file)
@@ -94,7 +94,7 @@ public class Parameters {
 
         parser.addArgument("--async-requests")
                 .type(Boolean.class)
-                .setDefault(true)
+                .setDefault(Boolean.TRUE)
                 .dest("async");
 
         parser.addArgument("--thread-amount")
@@ -104,7 +104,7 @@ public class Parameters {
 
         parser.addArgument("--same-device")
                 .type(Boolean.class)
-                .setDefault(true)
+                .setDefault(Boolean.TRUE)
                 .help("If true, every thread edits the device at the first port. "
                     + "If false, n-th thread edits device at n-th port.")
                 .dest("same-device");
index 03e7ed988bc15e815fb139cdc3ea79353f95ab8d..d807da5412b3a67a72dbec3401dd20c53ea06835 100644 (file)
@@ -111,29 +111,29 @@ public class Parameters {
         parser.addArgument("--candidate-datastore")
                 .type(Boolean.class)
                 .required(false)
-                .setDefault(true)
+                .setDefault(Boolean.TRUE)
                 .help("Edit candidate or running datastore. Defaults to candidate.")
                 .dest("candidate-datastore");
 
         parser.addArgument("--debug")
                 .type(Boolean.class)
-                .setDefault(false)
+                .setDefault(Boolean.FALSE)
                 .help("Whether to use debug log level instead of INFO")
                 .dest("debug");
 
         parser.addArgument("--legacy-framing")
                 .type(Boolean.class)
-                .setDefault(false)
+                .setDefault(Boolean.FALSE)
                 .dest("legacy-framing");
 
         parser.addArgument("--exi")
                 .type(Boolean.class)
-                .setDefault(false)
+                .setDefault(Boolean.FALSE)
                 .dest("exi");
 
         parser.addArgument("--async-requests")
                 .type(Boolean.class)
-                .setDefault(true)
+                .setDefault(Boolean.TRUE)
                 .dest("async");
 
         parser.addArgument("--msg-timeout")
@@ -143,7 +143,7 @@ public class Parameters {
 
         parser.addArgument("--ssh")
                 .type(Boolean.class)
-                .setDefault(false)
+                .setDefault(Boolean.FALSE)
                 .dest("ssh");
 
         parser.addArgument("--username")
index db15bb2a02a301bcc6bdfabd70eee5cf990a0d94..c2868795c95ec66cae7a68023388282ecb932e3f 100644 (file)
@@ -32,7 +32,7 @@ public class StressClientCallable implements Callable<Boolean> {
 
     private static final Logger LOG = LoggerFactory.getLogger(StressClientCallable.class);
 
-    private Parameters params;
+    private final Parameters params;
     private final NetconfDeviceCommunicator sessionListener;
     private final NetconfClientDispatcherImpl netconfClientDispatcher;
     private final NetconfClientConfiguration cfg;
@@ -62,7 +62,7 @@ public class StressClientCallable implements Callable<Boolean> {
     public Boolean call() throws Exception {
         executionStrategy.invoke();
         netconfClientSession.close();
-        return true;
+        return Boolean.TRUE;
     }
 
     private static ExecutionStrategy getExecutionStrategy(final Parameters params,