dsbenchmark: final parameters 04/56904/2
authorStephen Kitt <skitt@redhat.com>
Thu, 11 May 2017 15:25:21 +0000 (17:25 +0200)
committerTom Pantelis <tompantelis@gmail.com>
Mon, 15 May 2017 11:50:25 +0000 (11:50 +0000)
This automatically-generated patch flags all appropriate parameters as
final (including caught exceptions).

Change-Id: If18095c558eb8841e509421dc3d460c34272a03a
Signed-off-by: Stephen Kitt <skitt@redhat.com>
19 files changed:
benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/BaListBuilder.java
benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/DatastoreAbstractWriter.java
benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/DomListBuilder.java
benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/DsbenchmarkProvider.java
benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/listener/DsbenchmarkListener.java
benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/listener/DsbenchmarkListenerProvider.java
benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/simpletx/SimpletxBaDelete.java
benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/simpletx/SimpletxBaRead.java
benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/simpletx/SimpletxBaWrite.java
benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/simpletx/SimpletxDomDelete.java
benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/simpletx/SimpletxDomRead.java
benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/simpletx/SimpletxDomWrite.java
benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/txchain/TxchainBaDelete.java
benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/txchain/TxchainBaRead.java
benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/txchain/TxchainBaWrite.java
benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/txchain/TxchainDomDelete.java
benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/txchain/TxchainDomRead.java
benchmark/dsbenchmark/src/main/java/org/opendaylight/dsbenchmark/txchain/TxchainDomWrite.java
benchmark/dsbenchmark/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/dsbenchmark/impl/rev141210/DsbenchmarkImplModule.java

index 9d5aa51..018246e 100644 (file)
@@ -19,7 +19,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchm
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.rev150105.test.exec.outer.list.InnerListKey;
 
 public final class BaListBuilder {
-    public static List<OuterList> buildOuterList(int outerElements, int innerElements) {
+    public static List<OuterList> buildOuterList(final int outerElements, final int innerElements) {
         List<OuterList> outerList = new ArrayList<>(outerElements);
         for (int j = 0; j < outerElements; j++) {
             outerList.add(new OuterListBuilder()
@@ -31,7 +31,7 @@ public final class BaListBuilder {
         return outerList;
     }
 
-    private static List<InnerList> buildInnerList( int index, int elements ) {
+    private static List<InnerList> buildInnerList( final int index, final int elements ) {
         List<InnerList> innerList = new ArrayList<>( elements );
 
         final String itemStr = "Item-" + String.valueOf(index) + "-";
index fafcaad..a3466e3 100644 (file)
@@ -31,8 +31,8 @@ public abstract class DatastoreAbstractWriter {
     protected int txError = 0;
 
 
-    public DatastoreAbstractWriter(StartTestInput.Operation oper,
-                                   int outerListElem, int innerListElem, long writesPerTx, DataStore dataStore) {
+    public DatastoreAbstractWriter(final StartTestInput.Operation oper,
+                                   final int outerListElem, final int innerListElem, final long writesPerTx, final DataStore dataStore) {
         this.outerListElem = outerListElem;
         this.innerListElem = innerListElem;
         this.writesPerTx = writesPerTx;
index bac6b2b..cc4fc04 100644 (file)
@@ -28,7 +28,7 @@ public final class DomListBuilder {
     // Outer List Qname identifier for yang model's 'id'
     private static final org.opendaylight.yangtools.yang.common.QName OL_ID = QName.create(OuterList.QNAME, "id");
 
-    public static List<MapEntryNode> buildOuterList(int outerElements, int innerElements) {
+    public static List<MapEntryNode> buildOuterList(final int outerElements, final int innerElements) {
         List<MapEntryNode> outerList = new ArrayList<>(outerElements);
         for (int j = 0; j < outerElements; j++) {
             outerList.add(ImmutableNodes.mapEntryBuilder()
@@ -40,7 +40,7 @@ public final class DomListBuilder {
         return outerList;
     }
 
-    private static MapNode buildInnerList(int index, int elements ) {
+    private static MapNode buildInnerList(final int index, final int elements ) {
         CollectionNodeBuilder<MapEntryNode, MapNode> innerList = ImmutableNodes.mapNodeBuilder(InnerList.QNAME);
 
         final String itemStr = "Item-" + String.valueOf(index) + "-";
index e762d6d..8af7e15 100644 (file)
@@ -69,7 +69,7 @@ public class DsbenchmarkProvider implements BindingAwareProvider, DsbenchmarkSer
 
     private long testsCompleted = 0;
 
-    public DsbenchmarkProvider(DOMDataBroker domDataBroker, DataBroker bindingDataBroker) {
+    public DsbenchmarkProvider(final DOMDataBroker domDataBroker, final DataBroker bindingDataBroker) {
         // We have to get the DOMDataBroker via the constructor,
         // since we can't get it from the session
         this.domDataBroker = domDataBroker;
@@ -77,7 +77,7 @@ public class DsbenchmarkProvider implements BindingAwareProvider, DsbenchmarkSer
     }
 
     @Override
-    public void onSessionInitiated(ProviderContext session) {
+    public void onSessionInitiated(final ProviderContext session) {
         this.dataBroker = session.getSALService(DataBroker.class);
         this.dstReg = session.addRpcImplementation( DsbenchmarkService.class, this );
         listenerProvider.setDataBroker(dataBroker);
@@ -100,7 +100,7 @@ public class DsbenchmarkProvider implements BindingAwareProvider, DsbenchmarkSer
     }
 
     @Override
-    public Future<RpcResult<StartTestOutput>> startTest(StartTestInput input) {
+    public Future<RpcResult<StartTestOutput>> startTest(final StartTestInput input) {
         LOG.info("Starting the data store benchmark test, input: {}", input);
 
         // Check if there is a test in progress
@@ -136,7 +136,7 @@ public class DsbenchmarkProvider implements BindingAwareProvider, DsbenchmarkSer
 
             this.testsCompleted++;
 
-        } catch (Exception e) {
+        } catch (final Exception e) {
             LOG.error( "Test error: {}", e.toString());
             execStatus.set( ExecStatus.Idle );
             return RpcResultBuilder.success(new StartTestOutputBuilder()
@@ -165,7 +165,7 @@ public class DsbenchmarkProvider implements BindingAwareProvider, DsbenchmarkSer
         return RpcResultBuilder.success(output).buildFuture();
     }
 
-    private void setTestOperData( ExecStatus sts, long tstCompl ) {
+    private void setTestOperData( final ExecStatus sts, final long tstCompl ) {
         TestStatus status = new TestStatusBuilder()
                 .setExecStatus(sts)
                 .setTestsCompleted(tstCompl)
@@ -176,7 +176,7 @@ public class DsbenchmarkProvider implements BindingAwareProvider, DsbenchmarkSer
 
         try {
             tx.submit().checkedGet();
-        } catch (TransactionCommitFailedException e) {
+        } catch (final TransactionCommitFailedException e) {
             throw new IllegalStateException(e);
         }
 
@@ -193,7 +193,7 @@ public class DsbenchmarkProvider implements BindingAwareProvider, DsbenchmarkSer
         try {
             tx.submit().checkedGet();
             LOG.debug("DataStore config test data cleaned up");
-        } catch (TransactionCommitFailedException e) {
+        } catch (final TransactionCommitFailedException e) {
             LOG.info("Failed to cleanup DataStore configtest data");
             throw new IllegalStateException(e);
         }
@@ -203,14 +203,14 @@ public class DsbenchmarkProvider implements BindingAwareProvider, DsbenchmarkSer
         try {
             tx.submit().checkedGet();
             LOG.debug("DataStore operational test data cleaned up");
-        } catch (TransactionCommitFailedException e) {
+        } catch (final TransactionCommitFailedException e) {
             LOG.info("Failed to cleanup DataStore operational test data");
             throw new IllegalStateException(e);
         }
 
     }
 
-    private DatastoreAbstractWriter getDatastoreWriter(StartTestInput input) {
+    private DatastoreAbstractWriter getDatastoreWriter(final StartTestInput input) {
 
         final DatastoreAbstractWriter retVal;
 
index fcd2c11..14633c9 100644 (file)
@@ -28,7 +28,7 @@ public class DsbenchmarkListener implements DataTreeChangeListener<TestExec> {
 
     @Override
     public void onDataTreeChanged(
-            Collection<DataTreeModification<TestExec>> changes) {
+            final Collection<DataTreeModification<TestExec>> changes) {
         // Since we're registering the same DsbenchmarkListener object for both
         // OPERATIONAL and CONFIG, the onDataTreeChanged() method can be called
         // from different threads, and we need to use atomic counters.
@@ -41,8 +41,8 @@ public class DsbenchmarkListener implements DataTreeChangeListener<TestExec> {
         }
     }
 
-    private static synchronized void logDataTreeChangeEvent(int eventNum,
-            Collection<DataTreeModification<TestExec>> changes) {
+    private static synchronized void logDataTreeChangeEvent(final int eventNum,
+            final Collection<DataTreeModification<TestExec>> changes) {
         LOG.debug("DsbenchmarkListener-onDataTreeChanged: Event {}", eventNum);
 
         for (DataTreeModification<TestExec> change : changes) {
index 62b48ad..27d060b 100644 (file)
@@ -28,12 +28,12 @@ public class DsbenchmarkListenerProvider {
             new ArrayList<>();
     private DataBroker dataBroker;
 
-    public void setDataBroker(DataBroker dataBroker) {
+    public void setDataBroker(final DataBroker dataBroker) {
         this.dataBroker = dataBroker;
         LOG.debug("DsbenchmarkListenerProvider created");
     }
 
-    public void createAndRegisterListeners(int numListeners) {
+    public void createAndRegisterListeners(final int numListeners) {
         for (int i = 0; i < numListeners; i++) {
             DsbenchmarkListener listener = new DsbenchmarkListener();
             listeners.add(dataBroker.registerDataTreeChangeListener(
index cb44e8f..a165ea0 100644 (file)
@@ -65,7 +65,7 @@ public class SimpletxBaDelete extends DatastoreAbstractWriter {
                 try {
                     tx.submit().checkedGet();
                     txOk++;
-                } catch (TransactionCommitFailedException e) {
+                } catch (final TransactionCommitFailedException e) {
                     LOG.error("Transaction failed: {}", e);
                     txError++;
                 }
@@ -76,7 +76,7 @@ public class SimpletxBaDelete extends DatastoreAbstractWriter {
         if (putCnt != 0) {
             try {
                 tx.submit().checkedGet();
-            } catch (TransactionCommitFailedException e) {
+            } catch (final TransactionCommitFailedException e) {
                 LOG.error("Transaction failed: {}", e);
             }
         }
index afff73c..aa91b5d 100644 (file)
@@ -89,7 +89,7 @@ public class SimpletxBaRead extends DatastoreAbstractWriter {
                     } else {
                         txError++;
                     }
-                } catch (ReadFailedException e) {
+                } catch (final ReadFailedException e) {
                     LOG.warn("failed to ....", e);
                     txError++;
                 }
index ea373d1..9a3f27e 100644 (file)
@@ -62,7 +62,7 @@ public class SimpletxBaWrite extends DatastoreAbstractWriter {
                 try {
                     tx.submit().checkedGet();
                     txOk++;
-                } catch (TransactionCommitFailedException e) {
+                } catch (final TransactionCommitFailedException e) {
                     LOG.error("Transaction failed: {}", e);
                     txError++;
                 }
@@ -75,7 +75,7 @@ public class SimpletxBaWrite extends DatastoreAbstractWriter {
         if (writeCnt != 0) {
             try {
                 tx.submit().checkedGet();
-            } catch (TransactionCommitFailedException e) {
+            } catch (final TransactionCommitFailedException e) {
                 LOG.error("Transaction failed: {}", e);
             }
         }
index e7c6ffd..58baedb 100644 (file)
@@ -69,7 +69,7 @@ public class SimpletxDomDelete extends DatastoreAbstractWriter {
                 try {
                     tx.submit().checkedGet();
                     txOk++;
-                } catch (TransactionCommitFailedException e) {
+                } catch (final TransactionCommitFailedException e) {
                     LOG.error("Transaction failed: {}", e);
                     txError++;
                 }
@@ -80,7 +80,7 @@ public class SimpletxDomDelete extends DatastoreAbstractWriter {
         if (writeCnt != 0) {
             try {
                 tx.submit().checkedGet();
-            } catch (TransactionCommitFailedException e) {
+            } catch (final TransactionCommitFailedException e) {
                 LOG.error("Transaction failed: {}", e);
             }
         }
index f2b2799..536e77e 100644 (file)
@@ -76,7 +76,7 @@ public class SimpletxDomRead extends DatastoreAbstractWriter {
                         txError++;
                         LOG.warn("optionalDataObject is either null or .isPresent is false");
                     }
-                } catch (ReadFailedException e) {
+                } catch (final ReadFailedException e) {
                     LOG.warn("failed to ....", e);
                     txError++;
                 }
index 1ea66f2..e55724d 100644 (file)
@@ -67,7 +67,7 @@ public class SimpletxDomWrite extends DatastoreAbstractWriter {
                 try {
                     tx.submit().checkedGet();
                     txOk++;
-                } catch (TransactionCommitFailedException e) {
+                } catch (final TransactionCommitFailedException e) {
                     LOG.error("Transaction failed", e);
                     txError++;
                 }
@@ -79,7 +79,7 @@ public class SimpletxDomWrite extends DatastoreAbstractWriter {
         if (writeCnt != 0) {
             try {
                 tx.submit().checkedGet();
-            } catch (TransactionCommitFailedException e) {
+            } catch (final TransactionCommitFailedException e) {
                 LOG.error("Transaction failed", e);
             }
         }
index 74ba61c..a8363df 100644 (file)
@@ -97,12 +97,12 @@ public class TxchainBaDelete extends DatastoreAbstractWriter implements Transact
                 txSubmitted++;
             }
             tx.submit().checkedGet();
-        } catch (TransactionCommitFailedException e) {
+        } catch (final TransactionCommitFailedException e) {
             LOG.error("Transaction failed", e);
         }
         try {
             chain.close();
-        } catch (IllegalStateException e) {
+        } catch (final IllegalStateException e) {
             LOG.error("Transaction close failed,", e);
         }
         LOG.debug("Transactions: submitted {}, completed {}", txSubmitted, (txOk + txError));
index 9b2ec41..20694ca 100644 (file)
@@ -91,7 +91,7 @@ public class TxchainBaRead extends DatastoreAbstractWriter implements Transactio
                     } else {
                         txError++;
                     }
-                } catch (ReadFailedException e) {
+                } catch (final ReadFailedException e) {
                     LOG.warn("failed to ....", e);
                     txError++;
                 }
index e17ef98..a0327a9 100644 (file)
@@ -94,13 +94,13 @@ public class TxchainBaWrite extends DatastoreAbstractWriter implements Transacti
             txSubmitted++;
             tx.submit().checkedGet();
             txOk++;
-        } catch (TransactionCommitFailedException e) {
+        } catch (final TransactionCommitFailedException e) {
             LOG.error("Transaction failed", e);
             txError++;
         }
         try {
             chain.close();
-        } catch (IllegalStateException e) {
+        } catch (final IllegalStateException e) {
             LOG.error("Transaction close failed,", e);
         }
         LOG.debug("Transactions: submitted {}, completed {}", txSubmitted, (txOk + txError));
index 132ccbc..8e32897 100644 (file)
@@ -100,13 +100,13 @@ public class TxchainDomDelete extends DatastoreAbstractWriter implements Transac
             txSubmitted++;
             tx.submit().checkedGet();
             txOk++;
-        } catch (TransactionCommitFailedException e) {
+        } catch (final TransactionCommitFailedException e) {
             LOG.error("Transaction failed", e);
             txError++;
         }
         try {
             chain.close();
-        } catch (IllegalStateException e) {
+        } catch (final IllegalStateException e) {
             LOG.error("Transaction close failed,", e);
         }
         LOG.debug("Transactions: submitted {}, completed {}", txSubmitted, (txOk + txError));
index 359aff3..bb24f8b 100644 (file)
@@ -73,7 +73,7 @@ public class TxchainDomRead extends DatastoreAbstractWriter implements Transacti
                     if (optionalDataObject != null && optionalDataObject.isPresent()) {
                         txOk++;
                     }
-                } catch (ReadFailedException e) {
+                } catch (final ReadFailedException e) {
                     LOG.warn("failed to ....", e);
                     txError++;
                 }
index 2693fa9..52f574a 100644 (file)
@@ -99,13 +99,13 @@ public class TxchainDomWrite extends DatastoreAbstractWriter implements Transact
             txSubmitted++;
             tx.submit().checkedGet();
             txOk++;
-        } catch (TransactionCommitFailedException e) {
+        } catch (final TransactionCommitFailedException e) {
             LOG.error("Transaction failed", e);
             txError++;
         }
         try {
             chain.close();
-        } catch (IllegalStateException e) {
+        } catch (final IllegalStateException e) {
             LOG.error("Transaction close failed,", e);
         }
 
index 82d1270..2a38b6e 100644 (file)
@@ -10,11 +10,11 @@ package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbench
 import org.opendaylight.dsbenchmark.DsbenchmarkProvider;
 
 public class DsbenchmarkImplModule extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.impl.rev141210.AbstractDsbenchmarkImplModule {
-    public DsbenchmarkImplModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
+    public DsbenchmarkImplModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier, final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
         super(identifier, dependencyResolver);
     }
 
-    public DsbenchmarkImplModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.impl.rev141210.DsbenchmarkImplModule oldModule, java.lang.AutoCloseable oldInstance) {
+    public DsbenchmarkImplModule(final org.opendaylight.controller.config.api.ModuleIdentifier identifier, final org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.dsbenchmark.impl.rev141210.DsbenchmarkImplModule oldModule, final java.lang.AutoCloseable oldInstance) {
         super(identifier, dependencyResolver, oldModule, oldInstance);
     }
 

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.