checkStyleViolationSeverity=error implemented for mdsal-dom-broker 28/45828/1
authorjanab <brinda.jana@nexusis.com>
Tue, 23 Aug 2016 21:03:32 +0000 (14:03 -0700)
committerRobert Varga <rovarga@cisco.com>
Mon, 19 Sep 2016 15:07:08 +0000 (17:07 +0200)
Resolved the merge conflicts.
Implemented code review comments.
Implemented another set of code review comments.

Change-Id: I3eecb17342e4fd7f4736ca67bc57f01f91115c0f
Signed-off-by: Brinda Jana <brinda.jana@nexusis.com>
(cherry picked from commit f2910f31928b7f29c7e3593065ba35460052c38f)

47 files changed:
dom/mdsal-dom-broker/pom.xml
dom/mdsal-dom-broker/src/main/java/org/opendaylight/mdsal/dom/broker/AbstractDOMDataBroker.java
dom/mdsal-dom-broker/src/main/java/org/opendaylight/mdsal/dom/broker/AbstractDOMForwardedCompositeTransaction.java
dom/mdsal-dom-broker/src/main/java/org/opendaylight/mdsal/dom/broker/AbstractDOMForwardedTransactionFactory.java
dom/mdsal-dom-broker/src/main/java/org/opendaylight/mdsal/dom/broker/AbstractDOMRpcRoutingTableEntry.java
dom/mdsal-dom-broker/src/main/java/org/opendaylight/mdsal/dom/broker/CommitCoordinationTask.java
dom/mdsal-dom-broker/src/main/java/org/opendaylight/mdsal/dom/broker/DOMDataBrokerTransactionChainImpl.java
dom/mdsal-dom-broker/src/main/java/org/opendaylight/mdsal/dom/broker/DOMForwardedReadOnlyTransaction.java
dom/mdsal-dom-broker/src/main/java/org/opendaylight/mdsal/dom/broker/DOMForwardedWriteTransaction.java
dom/mdsal-dom-broker/src/main/java/org/opendaylight/mdsal/dom/broker/DOMMountPointServiceImpl.java
dom/mdsal-dom-broker/src/main/java/org/opendaylight/mdsal/dom/broker/DOMNotificationRouter.java
dom/mdsal-dom-broker/src/main/java/org/opendaylight/mdsal/dom/broker/DOMNotificationRouterEvent.java
dom/mdsal-dom-broker/src/main/java/org/opendaylight/mdsal/dom/broker/DOMRpcRouter.java
dom/mdsal-dom-broker/src/main/java/org/opendaylight/mdsal/dom/broker/DOMRpcRoutingTable.java
dom/mdsal-dom-broker/src/main/java/org/opendaylight/mdsal/dom/broker/GlobalDOMRpcRoutingTableEntry.java
dom/mdsal-dom-broker/src/main/java/org/opendaylight/mdsal/dom/broker/RoutedDOMRpcRoutingTableEntry.java
dom/mdsal-dom-broker/src/main/java/org/opendaylight/mdsal/dom/broker/SerializedDOMDataBroker.java
dom/mdsal-dom-broker/src/main/java/org/opendaylight/mdsal/dom/broker/ShardRegistration.java
dom/mdsal-dom-broker/src/main/java/org/opendaylight/mdsal/dom/broker/ShardedDOMDataTree.java
dom/mdsal-dom-broker/src/main/java/org/opendaylight/mdsal/dom/broker/ShardedDOMDataTreeListenerContext.java
dom/mdsal-dom-broker/src/main/java/org/opendaylight/mdsal/dom/broker/ShardedDOMDataTreeProducer.java
dom/mdsal-dom-broker/src/main/java/org/opendaylight/mdsal/dom/broker/ShardedDOMDataTreeWriteTransaction.java
dom/mdsal-dom-broker/src/main/java/org/opendaylight/mdsal/dom/broker/ShardedDOMReadTransactionAdapter.java
dom/mdsal-dom-broker/src/main/java/org/opendaylight/mdsal/dom/broker/ShardedDOMTransactionChainAdapter.java
dom/mdsal-dom-broker/src/main/java/org/opendaylight/mdsal/dom/broker/ShardedDOMWriteTransactionAdapter.java
dom/mdsal-dom-broker/src/main/java/org/opendaylight/mdsal/dom/broker/TransactionChainReadTransaction.java
dom/mdsal-dom-broker/src/main/java/org/opendaylight/mdsal/dom/broker/TransactionChainWriteTransaction.java
dom/mdsal-dom-broker/src/main/java/org/opendaylight/mdsal/dom/broker/TransactionCommitFailedExceptionMapper.java
dom/mdsal-dom-broker/src/main/java/org/opendaylight/mdsal/dom/broker/UnknownDOMRpcRoutingTableEntry.java
dom/mdsal-dom-broker/src/main/java/org/opendaylight/mdsal/dom/broker/osgi/OsgiBundleScanningSchemaService.java
dom/mdsal-dom-broker/src/main/java/org/opendaylight/mdsal/dom/broker/osgi/SchemaServiceActivator.java
dom/mdsal-dom-broker/src/test/java/org/opendaylight/mdsal/dom/broker/BlockingTransactionChainListener.java
dom/mdsal-dom-broker/src/test/java/org/opendaylight/mdsal/dom/broker/DOMBrokerTest.java
dom/mdsal-dom-broker/src/test/java/org/opendaylight/mdsal/dom/broker/DOMDataTreeListenerTest.java
dom/mdsal-dom-broker/src/test/java/org/opendaylight/mdsal/dom/broker/DOMNotificationRouterTest.java
dom/mdsal-dom-broker/src/test/java/org/opendaylight/mdsal/dom/broker/DOMTransactionChainTest.java
dom/mdsal-dom-broker/src/test/java/org/opendaylight/mdsal/dom/broker/GlobalDOMRpcRoutingTableEntryTest.java
dom/mdsal-dom-broker/src/test/java/org/opendaylight/mdsal/dom/broker/RoutedDOMRpcRoutingTableEntryTest.java
dom/mdsal-dom-broker/src/test/java/org/opendaylight/mdsal/dom/broker/ShardedDOMDataTreeProducerMultiShardTest.java
dom/mdsal-dom-broker/src/test/java/org/opendaylight/mdsal/dom/broker/ShardedDOMDataTreeShardTest.java
dom/mdsal-dom-broker/src/test/java/org/opendaylight/mdsal/dom/broker/ShardedDOMDataTreeTest.java
dom/mdsal-dom-broker/src/test/java/org/opendaylight/mdsal/dom/broker/ShardedDOMDataWriteTransactionTest.java
dom/mdsal-dom-broker/src/test/java/org/opendaylight/mdsal/dom/broker/ShardedDOMReadTransactionAdapterTest.java
dom/mdsal-dom-broker/src/test/java/org/opendaylight/mdsal/dom/broker/TestCommitCohort.java
dom/mdsal-dom-broker/src/test/java/org/opendaylight/mdsal/dom/broker/TestUtils.java
dom/mdsal-dom-broker/src/test/java/org/opendaylight/mdsal/dom/broker/osgi/OsgiBundleScanningSchemaServiceTest.java
dom/mdsal-dom-broker/src/test/java/org/opendaylight/mdsal/dom/broker/osgi/SchemaServiceActivatorTest.java

index 8fa80c37e4a1fd1ce4711fd3a59d4746a03d21d5..5db13ac39a5891b146f01a0a5e74e8ba900ad827 100644 (file)
           </instructions>
         </configuration>
       </plugin>
+      <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-checkstyle-plugin</artifactId>
+          <configuration>
+              <propertyExpansion>checkstyle.violationSeverity=error</propertyExpansion>
+          </configuration>
+      </plugin>
     </plugins>
   </build>
   <scm>
index 67ec1e1206133ed484b0c6a1a012e012801f4a32..115cb9805aa05e7da7ac672fc94c784cefedf0cd 100644 (file)
@@ -9,10 +9,12 @@ package org.opendaylight.mdsal.dom.broker;
 
 import static com.google.common.base.Preconditions.checkState;
 
-import org.opendaylight.mdsal.dom.spi.store.DOMStore;
-import org.opendaylight.mdsal.dom.spi.store.DOMStoreTransactionChain;
-import org.opendaylight.mdsal.dom.spi.store.DOMStoreTreeChangePublisher;
-
+import com.google.common.collect.ImmutableMap;
+import java.util.Collections;
+import java.util.EnumMap;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.concurrent.atomic.AtomicLong;
 import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.mdsal.common.api.TransactionChainListener;
 import org.opendaylight.mdsal.dom.api.DOMDataBroker;
@@ -21,17 +23,15 @@ import org.opendaylight.mdsal.dom.api.DOMDataTreeChangeListener;
 import org.opendaylight.mdsal.dom.api.DOMDataTreeChangeService;
 import org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier;
 import org.opendaylight.mdsal.dom.api.DOMTransactionChain;
-import com.google.common.collect.ImmutableMap;
-import java.util.Collections;
-import java.util.EnumMap;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.concurrent.atomic.AtomicLong;
+import org.opendaylight.mdsal.dom.spi.store.DOMStore;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreTransactionChain;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreTreeChangePublisher;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public abstract class AbstractDOMDataBroker extends AbstractDOMForwardedTransactionFactory<DOMStore> implements DOMDataBroker, AutoCloseable {
+public abstract class AbstractDOMDataBroker extends AbstractDOMForwardedTransactionFactory<DOMStore>
+        implements DOMDataBroker, AutoCloseable {
     private static final Logger LOG = LoggerFactory.getLogger(AbstractDOMDataBroker.class);
 
     private final AtomicLong txNum = new AtomicLong();
@@ -51,15 +51,18 @@ public abstract class AbstractDOMDataBroker extends AbstractDOMForwardedTransact
         }
 
         if (treeChange) {
-            extensions = ImmutableMap.<Class<? extends DOMDataBrokerExtension>, DOMDataBrokerExtension>of(DOMDataTreeChangeService.class, new DOMDataTreeChangeService() {
-                @Override
-                public <L extends DOMDataTreeChangeListener> ListenerRegistration<L> registerDataTreeChangeListener(final DOMDataTreeIdentifier treeId, final L listener) {
-                    DOMStore publisher = getTxFactories().get(treeId.getDatastoreType());
-                    checkState(publisher != null, "Requested logical data store is not available.");
-
-                    return ((DOMStoreTreeChangePublisher)publisher).registerTreeChangeListener(treeId.getRootIdentifier(), listener);
-                }
-            });
+            extensions = ImmutableMap.<Class<? extends DOMDataBrokerExtension>, DOMDataBrokerExtension>of(
+                    DOMDataTreeChangeService.class, new DOMDataTreeChangeService() {
+                        @Override
+                        public <L extends DOMDataTreeChangeListener> ListenerRegistration<L>
+                                registerDataTreeChangeListener(final DOMDataTreeIdentifier treeId, final L listener) {
+                            DOMStore publisher = getTxFactories().get(treeId.getDatastoreType());
+                            checkState(publisher != null, "Requested logical data store is not available.");
+
+                            return ((DOMStoreTreeChangePublisher)publisher).registerTreeChangeListener(
+                                    treeId.getRootIdentifier(), listener);
+                            }
+                        });
         } else {
             extensions = Collections.emptyMap();
         }
@@ -69,14 +72,15 @@ public abstract class AbstractDOMDataBroker extends AbstractDOMForwardedTransact
         this.closeable = closeable;
     }
 
+    @SuppressWarnings("checkstyle:IllegalCatch")
     @Override
     public void close() {
         super.close();
 
-        if(closeable != null) {
+        if (closeable != null) {
             try {
                 closeable.close();
-            } catch(Exception e) {
+            } catch (Exception e) {
                 LOG.debug("Error closing instance", e);
             }
         }
@@ -96,7 +100,8 @@ public abstract class AbstractDOMDataBroker extends AbstractDOMForwardedTransact
     public DOMTransactionChain createTransactionChain(final TransactionChainListener listener) {
         checkNotClosed();
 
-        final Map<LogicalDatastoreType, DOMStoreTransactionChain> backingChains = new EnumMap<>(LogicalDatastoreType.class);
+        final Map<LogicalDatastoreType, DOMStoreTransactionChain> backingChains =
+                new EnumMap<>(LogicalDatastoreType.class);
         for (Entry<LogicalDatastoreType, DOMStore> entry : getTxFactories().entrySet()) {
             backingChains.put(entry.getKey(), entry.getValue().createTransactionChain());
         }
index d2b809369ef81a4bdf45e12f2a1d2886a197f619..747ef3f4bfe4f0a9d2d71e8206fd9fc88f053dfd 100644 (file)
@@ -8,18 +8,18 @@
 
 package org.opendaylight.mdsal.dom.broker;
 
-import org.opendaylight.mdsal.dom.spi.store.DOMStoreTransaction;
-
-import org.opendaylight.mdsal.common.api.AsyncTransaction;
 import com.google.common.base.Preconditions;
 import java.util.Collection;
 import java.util.Map;
+import org.opendaylight.mdsal.common.api.AsyncTransaction;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreTransaction;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 
 /**
  * Composite DOM Transaction backed by {@link DOMStoreTransaction}.
  *
+ *<p>
  * Abstract base for composite transaction, which provides access only to common
  * functionality as retrieval of subtransaction, close method and retrieval of
  * identifier.
@@ -36,7 +36,6 @@ abstract class AbstractDOMForwardedCompositeTransaction<K, T extends DOMStoreTra
     private final Object identifier;
 
     /**
-     *
      * Creates new composite Transactions.
      *
      * @param identifier
@@ -52,8 +51,8 @@ abstract class AbstractDOMForwardedCompositeTransaction<K, T extends DOMStoreTra
     /**
      * Returns subtransaction associated with supplied key.
      *
-     * @param key
-     * @return
+     * @param key is used to retrieve subtransaction object
+     * @return the subtransaction object
      * @throws NullPointerException
      *             if key is null
      * @throws IllegalArgumentException
@@ -80,6 +79,7 @@ abstract class AbstractDOMForwardedCompositeTransaction<K, T extends DOMStoreTra
         return identifier;
     }
 
+    @SuppressWarnings("checkstyle:IllegalCatch")
     protected void closeSubtransactions() {
         /*
          * We share one exception for all failures, which are added
index a09da38734e03c070a76f6a359356993985c6f17..c2b1ccb4d8de61b4fe24b4acbf67d908dd5b3ca7 100644 (file)
@@ -19,15 +19,14 @@ import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
 import org.opendaylight.mdsal.dom.api.DOMDataTreeReadTransaction;
 import org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction;
 import org.opendaylight.mdsal.dom.spi.store.DOMStoreReadTransaction;
-import org.opendaylight.mdsal.dom.spi.store.DOMStoreReadWriteTransaction;
 import org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort;
 import org.opendaylight.mdsal.dom.spi.store.DOMStoreTransactionFactory;
 import org.opendaylight.mdsal.dom.spi.store.DOMStoreWriteTransaction;
 
 /**
- *
  * Abstract composite transaction factory.
  *
+ *<p>
  * Provides an convenience common implementation for composite DOM Transactions,
  * where subtransaction is identified by {@link LogicalDatastoreType} type and
  * implementation of subtransaction is provided by
@@ -53,7 +52,7 @@ abstract class AbstractDOMForwardedTransactionFactory<T extends DOMStoreTransact
 
     /**
      * Implementations must return unique identifier for each and every call of
-     * this method;
+     * this method.
      *
      * @return new Unique transaction identifier.
      */
@@ -62,6 +61,7 @@ abstract class AbstractDOMForwardedTransactionFactory<T extends DOMStoreTransact
     /**
      * User-supplied implementation of {@link DOMDataTreeWriteTransaction#submit()} for transaction.
      *
+     *<p>
      * Callback invoked when {@link DOMDataTreeWriteTransaction#submit()} is invoked on transaction
      * created by this factory.
      *
@@ -72,20 +72,24 @@ abstract class AbstractDOMForwardedTransactionFactory<T extends DOMStoreTransact
      *         returned from the Future, On failure, the Future fails with a
      *         {@link TransactionCommitFailedException}.
      */
-    protected abstract CheckedFuture<Void,TransactionCommitFailedException> submit(final DOMDataTreeWriteTransaction transaction,
+    protected abstract CheckedFuture<Void,TransactionCommitFailedException> submit(
+            final DOMDataTreeWriteTransaction transaction,
             final Collection<DOMStoreThreePhaseCommitCohort> cohorts);
 
     /**
-     * Creates a new composite read-only transaction
+     * Creates a new composite read-only transaction.
      *
+     *<p>
      * Creates a new composite read-only transaction backed by one transaction per factory in
      * {@link #getTxFactories()}.
      *
+     *<p>
      * Subtransaction for reading is selected by supplied {@link LogicalDatastoreType} as parameter
      * for
-     * {@link DOMDataTreeReadTransaction#read(LogicalDatastoreType, org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier)}
-     * .
+     * {@link DOMDataTreeReadTransaction#read(LogicalDatastoreType,
+     * org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier)}
      *
+     *<p>
      * Id of returned transaction is retrieved via {@link #newTransactionIdentifier()}.
      *
      * @return New composite read-only transaction.
@@ -112,17 +116,24 @@ abstract class AbstractDOMForwardedTransactionFactory<T extends DOMStoreTransact
      *
      * <ul>
      * <li>
-     * {@link DOMDataTreeWriteTransaction#put(LogicalDatastoreType, org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier, org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode)}
+     * {@link DOMDataTreeWriteTransaction#put(LogicalDatastoreType,
+     * org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier,
+     * org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode)}
      * - backing subtransaction is selected by {@link LogicalDatastoreType},
-     * {@link DOMStoreWriteTransaction#write(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier, org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode)}
+     * {@link DOMStoreWriteTransaction#write(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier,
+     * org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode)}
      * is invoked on selected subtransaction.</li>
      * <li>
-     * {@link DOMDataTreeWriteTransaction#merge(LogicalDatastoreType, org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier, org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode)}
+     * {@link DOMDataTreeWriteTransaction#merge(LogicalDatastoreType,
+     * org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier,
+     * org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode)}
      * - backing subtransaction is selected by {@link LogicalDatastoreType},
-     * {@link DOMStoreWriteTransaction#merge(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier, org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode)}
+     * {@link DOMStoreWriteTransaction#merge(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier,
+     * org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode)}
      * is invoked on selected subtransaction.</li>
      * <li>
-     * {@link DOMDataTreeWriteTransaction#delete(LogicalDatastoreType, org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier)}
+     * {@link DOMDataTreeWriteTransaction#delete(LogicalDatastoreType,
+     * org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier)}
      * - backing subtransaction is selected by {@link LogicalDatastoreType},
      * {@link DOMStoreWriteTransaction#delete(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier)}
      * is invoked on selected subtransaction.
@@ -132,6 +143,7 @@ abstract class AbstractDOMForwardedTransactionFactory<T extends DOMStoreTransact
      * transaction which was commited and gathered results.</li>
      * </ul>
      *
+     * <p>
      * Id of returned transaction is generated via {@link #newTransactionIdentifier()}.
      *
      * @return New composite write-only transaction associated with this factory.
index 1daf52d4db9fb18b2d401b7650b95eb363b87723..021dd96b1177a66fcb80aac378fcd9fa99cf26dd 100644 (file)
@@ -7,10 +7,6 @@
  */
 package org.opendaylight.mdsal.dom.broker;
 
-import org.opendaylight.mdsal.dom.api.DOMRpcException;
-import org.opendaylight.mdsal.dom.api.DOMRpcImplementation;
-import org.opendaylight.mdsal.dom.api.DOMRpcResult;
-
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.ImmutableMap.Builder;
@@ -20,6 +16,9 @@ import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
+import org.opendaylight.mdsal.dom.api.DOMRpcException;
+import org.opendaylight.mdsal.dom.api.DOMRpcImplementation;
+import org.opendaylight.mdsal.dom.api.DOMRpcResult;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
@@ -28,7 +27,8 @@ abstract class AbstractDOMRpcRoutingTableEntry {
     private final Map<YangInstanceIdentifier, List<DOMRpcImplementation>> impls;
     private final SchemaPath schemaPath;
 
-    protected AbstractDOMRpcRoutingTableEntry(final SchemaPath schemaPath, final Map<YangInstanceIdentifier, List<DOMRpcImplementation>> impls) {
+    protected AbstractDOMRpcRoutingTableEntry(final SchemaPath schemaPath, final Map<YangInstanceIdentifier,
+            List<DOMRpcImplementation>> impls) {
         this.schemaPath = Preconditions.checkNotNull(schemaPath);
         this.impls = Preconditions.checkNotNull(impls);
     }
@@ -54,12 +54,14 @@ abstract class AbstractDOMRpcRoutingTableEntry {
     }
 
     /**
+     * This method adds the given DOMRpcImplementation instance for the given list RPC identifiers.
      *
-     * @param implementation
-     * @param newRpcs List of new RPCs, must be mutable
-     * @return
+     * @param implementation the DOMRpcImplementation instance to add
+     * @param newRpcs the List of new RPCs that the DOMRpcImplementation provides, must be mutable
+     * @return a new instance of AbstractDOMRpcRoutingTableEntry with the additions
      */
-    final AbstractDOMRpcRoutingTableEntry add(final DOMRpcImplementation implementation, final List<YangInstanceIdentifier> newRpcs) {
+    final AbstractDOMRpcRoutingTableEntry add(
+            final DOMRpcImplementation implementation, final List<YangInstanceIdentifier> newRpcs) {
         final Builder<YangInstanceIdentifier, List<DOMRpcImplementation>> vb = ImmutableMap.builder();
         for (final Entry<YangInstanceIdentifier, List<DOMRpcImplementation>> ve : impls.entrySet()) {
             if (newRpcs.remove(ve.getKey())) {
@@ -71,7 +73,7 @@ abstract class AbstractDOMRpcRoutingTableEntry {
                 vb.put(ve);
             }
         }
-        for(final YangInstanceIdentifier ii : newRpcs) {
+        for (final YangInstanceIdentifier ii : newRpcs) {
             final ArrayList<DOMRpcImplementation> impl = new ArrayList<>(1);
             impl.add(implementation);
             vb.put(ii,impl);
@@ -80,7 +82,8 @@ abstract class AbstractDOMRpcRoutingTableEntry {
         return newInstance(vb.build());
     }
 
-    final AbstractDOMRpcRoutingTableEntry remove(final DOMRpcImplementation implementation, final List<YangInstanceIdentifier> removed) {
+    final AbstractDOMRpcRoutingTableEntry remove(
+            final DOMRpcImplementation implementation, final List<YangInstanceIdentifier> removed) {
         final Builder<YangInstanceIdentifier, List<DOMRpcImplementation>> vb = ImmutableMap.builder();
         for (final Entry<YangInstanceIdentifier, List<DOMRpcImplementation>> ve : impls.entrySet()) {
             if (removed.remove(ve.getKey())) {
@@ -101,5 +104,7 @@ abstract class AbstractDOMRpcRoutingTableEntry {
     }
 
     protected abstract CheckedFuture<DOMRpcResult, DOMRpcException> invokeRpc(final NormalizedNode<?, ?> input);
-    protected abstract AbstractDOMRpcRoutingTableEntry newInstance(final Map<YangInstanceIdentifier, List<DOMRpcImplementation>> impls);
+
+    protected abstract AbstractDOMRpcRoutingTableEntry newInstance(
+            final Map<YangInstanceIdentifier, List<DOMRpcImplementation>> impls);
 }
index 694b8411a81f082eb533d2e2598359d875a018b6..385697b9c2d6ad27ec6e24b5d188c95a9ebb8255 100644 (file)
@@ -8,10 +8,6 @@
 
 package org.opendaylight.mdsal.dom.broker;
 
-import org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort;
-
-import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
-import org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction;
 import com.google.common.base.Preconditions;
 import com.google.common.base.Throwables;
 import com.google.common.util.concurrent.Futures;
@@ -19,6 +15,9 @@ import com.google.common.util.concurrent.ListenableFuture;
 import java.util.Collection;
 import java.util.concurrent.Callable;
 import java.util.concurrent.ExecutionException;
+import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort;
 import org.opendaylight.yangtools.util.DurationStatisticsTracker;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -28,7 +27,7 @@ import org.slf4j.LoggerFactory;
  * support of cancellation.
  */
 final class CommitCoordinationTask implements Callable<Void> {
-    private static enum Phase {
+    private enum Phase {
         canCommit,
         preCommit,
         doCommit,
@@ -39,7 +38,7 @@ final class CommitCoordinationTask implements Callable<Void> {
     private final DurationStatisticsTracker commitStatTracker;
     private final DOMDataTreeWriteTransaction tx;
 
-    public CommitCoordinationTask(final DOMDataTreeWriteTransaction transaction,
+    CommitCoordinationTask(final DOMDataTreeWriteTransaction transaction,
             final Collection<DOMStoreThreePhaseCommitCohort> cohorts,
             final DurationStatisticsTracker commitStatTracker) {
         this.tx = Preconditions.checkNotNull(transaction, "transaction must not be null");
@@ -79,10 +78,10 @@ final class CommitCoordinationTask implements Callable<Void> {
     }
 
     /**
-     *
      * Invokes canCommit on underlying cohorts and blocks till
      * all results are returned.
      *
+     *<p>
      * Valid state transition is from SUBMITTED to CAN_COMMIT,
      * if currentPhase is not SUBMITTED throws IllegalStateException.
      *
@@ -104,11 +103,11 @@ final class CommitCoordinationTask implements Callable<Void> {
     }
 
     /**
-     *
      * Invokes canCommit on underlying cohorts and returns composite future
      * which will contains {@link Boolean#TRUE} only and only if
      * all cohorts returned true.
      *
+     *<p>
      * Valid state transition is from SUBMITTED to CAN_COMMIT,
      * if currentPhase is not SUBMITTED throws IllegalStateException.
      *
@@ -117,18 +116,18 @@ final class CommitCoordinationTask implements Callable<Void> {
      */
     private ListenableFuture<?>[] canCommitAll() {
         final ListenableFuture<?>[] ops = new ListenableFuture<?>[cohorts.size()];
-        int i = 0;
+        int index = 0;
         for (final DOMStoreThreePhaseCommitCohort cohort : cohorts) {
-            ops[i++] = cohort.canCommit();
+            ops[index++] = cohort.canCommit();
         }
         return ops;
     }
 
     /**
-     *
      * Invokes preCommit on underlying cohorts and blocks till
      * all results are returned.
      *
+     *<p>
      * Valid state transition is from CAN_COMMIT to PRE_COMMIT, if current
      * state is not CAN_COMMIT
      * throws IllegalStateException.
@@ -140,7 +139,7 @@ final class CommitCoordinationTask implements Callable<Void> {
     private void preCommitBlocking() throws TransactionCommitFailedException {
         final ListenableFuture<?>[] preCommitFutures = preCommitAll();
         try {
-            for(final ListenableFuture<?> future : preCommitFutures) {
+            for (final ListenableFuture<?> future : preCommitFutures) {
                 future.get();
             }
         } catch (InterruptedException | ExecutionException e) {
@@ -149,12 +148,11 @@ final class CommitCoordinationTask implements Callable<Void> {
     }
 
     /**
-     *
      * Invokes preCommit on underlying cohorts and returns future
      * which will complete once all preCommit on cohorts completed or
      * failed.
      *
-     *
+     *<p>
      * Valid state transition is from CAN_COMMIT to PRE_COMMIT, if current
      * state is not CAN_COMMIT
      * throws IllegalStateException.
@@ -164,18 +162,18 @@ final class CommitCoordinationTask implements Callable<Void> {
      */
     private ListenableFuture<?>[] preCommitAll() {
         final ListenableFuture<?>[] ops = new ListenableFuture<?>[cohorts.size()];
-        int i = 0;
+        int index = 0;
         for (final DOMStoreThreePhaseCommitCohort cohort : cohorts) {
-            ops[i++] = cohort.preCommit();
+            ops[index++] = cohort.preCommit();
         }
         return ops;
     }
 
     /**
-     *
      * Invokes commit on underlying cohorts and blocks till
      * all results are returned.
      *
+     *<p>
      * Valid state transition is from PRE_COMMIT to COMMIT, if not throws
      * IllegalStateException.
      *
@@ -186,7 +184,7 @@ final class CommitCoordinationTask implements Callable<Void> {
     private void commitBlocking() throws TransactionCommitFailedException {
         final ListenableFuture<?>[] commitFutures = commitAll();
         try {
-            for(final ListenableFuture<?> future : commitFutures) {
+            for (final ListenableFuture<?> future : commitFutures) {
                 future.get();
             }
         } catch (InterruptedException | ExecutionException e) {
@@ -195,11 +193,11 @@ final class CommitCoordinationTask implements Callable<Void> {
     }
 
     /**
-     *
      * Invokes commit on underlying cohorts and returns future which
      * completes
      * once all commits on cohorts are completed.
      *
+     *<p>
      * Valid state transition is from PRE_COMMIT to COMMIT, if not throws
      * IllegalStateException
      *
@@ -207,9 +205,9 @@ final class CommitCoordinationTask implements Callable<Void> {
      */
     private ListenableFuture<?>[] commitAll() {
         final ListenableFuture<?>[] ops = new ListenableFuture<?>[cohorts.size()];
-        int i = 0;
+        int index = 0;
         for (final DOMStoreThreePhaseCommitCohort cohort : cohorts) {
-            ops[i++] = cohort.commit();
+            ops[index++] = cohort.commit();
         }
         return ops;
     }
@@ -217,12 +215,14 @@ final class CommitCoordinationTask implements Callable<Void> {
     /**
      * Aborts transaction.
      *
+     *<p>
      * Invokes {@link DOMStoreThreePhaseCommitCohort#abort()} on all
      * cohorts, blocks
      * for all results. If any of the abort failed throws
      * IllegalStateException,
      * which will contains originalCause as suppressed Exception.
      *
+     *<p>
      * If aborts we're successful throws supplied exception
      *
      * @param originalCause
@@ -236,7 +236,8 @@ final class CommitCoordinationTask implements Callable<Void> {
      * @throws IllegalStateException
      *             if abort failed.
      */
-    private void abortBlocking(final TransactionCommitFailedException originalCause) throws TransactionCommitFailedException {
+    private void abortBlocking(final TransactionCommitFailedException originalCause)
+            throws TransactionCommitFailedException {
         Exception cause = originalCause;
         try {
             abortAsyncAll().get();
@@ -259,9 +260,9 @@ final class CommitCoordinationTask implements Callable<Void> {
     private ListenableFuture<Void> abortAsyncAll() {
 
         final ListenableFuture<?>[] ops = new ListenableFuture<?>[cohorts.size()];
-        int i = 0;
+        int index = 0;
         for (final DOMStoreThreePhaseCommitCohort cohort : cohorts) {
-            ops[i++] = cohort.abort();
+            ops[index++] = cohort.abort();
         }
 
         /*
index ce3c203ea10eb911e7cf5d43efe113a64f855698..e30d39d6ec451bdca3f21fd7dc912dbd9c21b18a 100644 (file)
@@ -8,14 +8,6 @@
 
 package org.opendaylight.mdsal.dom.broker;
 
-import org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort;
-import org.opendaylight.mdsal.dom.spi.store.DOMStoreTransactionChain;
-
-import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
-import org.opendaylight.mdsal.common.api.TransactionChainListener;
-import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
-import org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction;
-import org.opendaylight.mdsal.dom.api.DOMTransactionChain;
 import com.google.common.base.Preconditions;
 import com.google.common.util.concurrent.CheckedFuture;
 import com.google.common.util.concurrent.FutureCallback;
@@ -25,6 +17,13 @@ import java.util.Map;
 import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.TransactionChainListener;
+import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction;
+import org.opendaylight.mdsal.dom.api.DOMTransactionChain;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreTransactionChain;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -36,7 +35,7 @@ import org.slf4j.LoggerFactory;
  */
 final class DOMDataBrokerTransactionChainImpl extends AbstractDOMForwardedTransactionFactory<DOMStoreTransactionChain>
         implements DOMTransactionChain {
-    private static enum State {
+    private enum State {
         RUNNING,
         CLOSING,
         CLOSED,
@@ -57,6 +56,7 @@ final class DOMDataBrokerTransactionChainImpl extends AbstractDOMForwardedTransa
     private volatile int counter = 0;
 
     /**
+     *Constructor with args.
      *
      * @param chainId
      *            ID of transaction chain
@@ -71,7 +71,7 @@ final class DOMDataBrokerTransactionChainImpl extends AbstractDOMForwardedTransa
      * @throws NullPointerException
      *             If any of arguments is null.
      */
-    public DOMDataBrokerTransactionChainImpl(final long chainId,
+    DOMDataBrokerTransactionChainImpl(final long chainId,
             final Map<LogicalDatastoreType, DOMStoreTransactionChain> chains,
             final AbstractDOMDataBroker broker, final TransactionChainListener listener) {
         super(chains);
@@ -105,8 +105,8 @@ final class DOMDataBrokerTransactionChainImpl extends AbstractDOMForwardedTransa
             }
 
             @Override
-            public void onFailure(final Throwable t) {
-                transactionFailed(transaction, t);
+            public void onFailure(final Throwable throwable) {
+                transactionFailed(transaction, throwable);
             }
         });
 
index 7f44782628aeba1e822b2d198cbebabdbea4dd4a..09777a23face3b64b79a23f52c2c2b387de79ddb 100644 (file)
@@ -7,14 +7,13 @@
  */
 package org.opendaylight.mdsal.dom.broker;
 
-import org.opendaylight.mdsal.dom.spi.store.DOMStoreReadTransaction;
-
-import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
-import org.opendaylight.mdsal.common.api.ReadFailedException;
-import org.opendaylight.mdsal.dom.api.DOMDataTreeReadTransaction;
 import com.google.common.base.Optional;
 import com.google.common.util.concurrent.CheckedFuture;
 import java.util.Map;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.ReadFailedException;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeReadTransaction;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreReadTransaction;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 
index 2295f5a3141c3c718c13c9ad7f0ccae51a65ba78..6292f82e3add44f7fe31f24de44eba68ba09b2fc 100644 (file)
@@ -7,11 +7,6 @@
  */
 package org.opendaylight.mdsal.dom.broker;
 
-import org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort;
-import org.opendaylight.mdsal.dom.spi.store.DOMStoreWriteTransaction;
-
-import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
-import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
 import com.google.common.base.Preconditions;
 import com.google.common.util.concurrent.CheckedFuture;
 import com.google.common.util.concurrent.Futures;
@@ -20,7 +15,11 @@ import java.util.Collection;
 import java.util.Map;
 import java.util.concurrent.Future;
 import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
 import org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreWriteTransaction;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.slf4j.Logger;
@@ -36,6 +35,7 @@ import org.slf4j.LoggerFactory;
  * <li>{@link #delete(LogicalDatastoreType, YangInstanceIdentifier)}
  * <li>{@link #merge(LogicalDatastoreType, YangInstanceIdentifier, NormalizedNode)}
  * </ul>
+ *
  * <p>
  * {@link #submit()} will result in invocation of
  * {@link DOMDataCommitImplementation#submit(org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction, Iterable)}
@@ -48,8 +48,9 @@ import org.slf4j.LoggerFactory;
 class DOMForwardedWriteTransaction<T extends DOMStoreWriteTransaction> extends
         AbstractDOMForwardedCompositeTransaction<LogicalDatastoreType, T> implements DOMDataTreeWriteTransaction {
     @SuppressWarnings("rawtypes")
-    private static final AtomicReferenceFieldUpdater<DOMForwardedWriteTransaction, AbstractDOMForwardedTransactionFactory> IMPL_UPDATER =
-            AtomicReferenceFieldUpdater.newUpdater(DOMForwardedWriteTransaction.class, AbstractDOMForwardedTransactionFactory.class, "commitImpl");
+    private static final AtomicReferenceFieldUpdater<DOMForwardedWriteTransaction,
+        AbstractDOMForwardedTransactionFactory> IMPL_UPDATER = AtomicReferenceFieldUpdater.newUpdater(
+                DOMForwardedWriteTransaction.class, AbstractDOMForwardedTransactionFactory.class, "commitImpl");
     @SuppressWarnings("rawtypes")
     private static final AtomicReferenceFieldUpdater<DOMForwardedWriteTransaction, Future> FUTURE_UPDATER =
             AtomicReferenceFieldUpdater.newUpdater(DOMForwardedWriteTransaction.class, Future.class, "commitFuture");
@@ -68,6 +69,7 @@ class DOMForwardedWriteTransaction<T extends DOMStoreWriteTransaction> extends
      * set appropriately on {@link #submit()} and {@link #cancel()} via
      * {@link AtomicReferenceFieldUpdater#lazySet(Object, Object)}.
      *
+     *<p>
      * Lazy set is safe for use because it is only referenced to in the
      * {@link #cancel()} slow path, where we will busy-wait for it. The
      * fast path gets the benefit of a store-store barrier instead of the
@@ -82,7 +84,8 @@ class DOMForwardedWriteTransaction<T extends DOMStoreWriteTransaction> extends
     }
 
     @Override
-    public void put(final LogicalDatastoreType store, final YangInstanceIdentifier path, final NormalizedNode<?, ?> data) {
+    public void put(final LogicalDatastoreType store, final YangInstanceIdentifier path,
+            final NormalizedNode<?, ?> data) {
         checkRunning(commitImpl);
         getSubtransaction(store).write(path, data);
     }
@@ -94,7 +97,8 @@ class DOMForwardedWriteTransaction<T extends DOMStoreWriteTransaction> extends
     }
 
     @Override
-    public void merge(final LogicalDatastoreType store, final YangInstanceIdentifier path, final NormalizedNode<?, ?> data) {
+    public void merge(final LogicalDatastoreType store, final YangInstanceIdentifier path,
+            final NormalizedNode<?, ?> data) {
         checkRunning(commitImpl);
         getSubtransaction(store).merge(path, data);
     }
index 2888a2a07fed02bbc1d41a54de6f6fb6269e5897..0968b1884a19c8db736ffa5d7f4f6b5a20b0bcb4 100644 (file)
@@ -8,18 +8,17 @@
 
 package org.opendaylight.mdsal.dom.broker;
 
-import org.opendaylight.mdsal.dom.spi.SimpleDOMMountPoint;
-
-import org.opendaylight.mdsal.dom.api.DOMMountPointListener;
-import org.opendaylight.mdsal.dom.api.DOMMountPoint;
-import org.opendaylight.mdsal.dom.api.DOMMountPointService;
-import org.opendaylight.mdsal.dom.api.DOMService;
 import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ClassToInstanceMap;
 import com.google.common.collect.MutableClassToInstanceMap;
 import java.util.HashMap;
 import java.util.Map;
+import org.opendaylight.mdsal.dom.api.DOMMountPoint;
+import org.opendaylight.mdsal.dom.api.DOMMountPointListener;
+import org.opendaylight.mdsal.dom.api.DOMMountPointService;
+import org.opendaylight.mdsal.dom.api.DOMService;
+import org.opendaylight.mdsal.dom.spi.SimpleDOMMountPoint;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.concepts.ObjectRegistration;
 import org.opendaylight.yangtools.util.ListenerRegistry;
@@ -65,7 +64,8 @@ public class DOMMountPointServiceImpl implements DOMMountPointService {
 
     public ObjectRegistration<DOMMountPoint> registerMountPoint(final DOMMountPoint mountPoint) {
         synchronized (mountPoints) {
-            Preconditions.checkState(!mountPoints.containsKey(mountPoint.getIdentifier()), "Mount point already exists");
+            Preconditions.checkState(!mountPoints.containsKey(mountPoint.getIdentifier()),
+                    "Mount point already exists");
             mountPoints.put(mountPoint.getIdentifier(), mountPoint);
         }
         notifyMountCreated(mountPoint.getIdentifier());
@@ -115,7 +115,7 @@ public class DOMMountPointServiceImpl implements DOMMountPointService {
     private final class MountRegistration implements ObjectRegistration<DOMMountPoint> {
         private final DOMMountPoint mountPoint;
 
-        public MountRegistration(final DOMMountPoint mountPoint) {
+        MountRegistration(final DOMMountPoint mountPoint) {
             this.mountPoint = mountPoint;
         }
 
index 5d6010d6e2bae892a3a171a357034a433173c7d9..c1e4ac6a9a8f7f5f672836ceb941392d05f682d5 100644 (file)
@@ -7,13 +7,6 @@
  */
 package org.opendaylight.mdsal.dom.broker;
 
-import org.opendaylight.mdsal.dom.spi.DOMNotificationSubscriptionListener;
-import org.opendaylight.mdsal.dom.spi.DOMNotificationSubscriptionListenerRegistry;
-
-import org.opendaylight.mdsal.dom.api.DOMNotification;
-import org.opendaylight.mdsal.dom.api.DOMNotificationListener;
-import org.opendaylight.mdsal.dom.api.DOMNotificationPublishService;
-import org.opendaylight.mdsal.dom.api.DOMNotificationService;
 import com.google.common.base.Preconditions;
 import com.google.common.base.Predicate;
 import com.google.common.collect.ImmutableList;
@@ -36,6 +29,12 @@ import java.util.Set;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.TimeUnit;
+import org.opendaylight.mdsal.dom.api.DOMNotification;
+import org.opendaylight.mdsal.dom.api.DOMNotificationListener;
+import org.opendaylight.mdsal.dom.api.DOMNotificationPublishService;
+import org.opendaylight.mdsal.dom.api.DOMNotificationService;
+import org.opendaylight.mdsal.dom.spi.DOMNotificationSubscriptionListener;
+import org.opendaylight.mdsal.dom.spi.DOMNotificationSubscriptionListenerRegistry;
 import org.opendaylight.yangtools.concepts.AbstractListenerRegistration;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.util.ListenerRegistry;
@@ -47,14 +46,18 @@ import org.slf4j.LoggerFactory;
  * Joint implementation of {@link DOMNotificationPublishService} and {@link DOMNotificationService}. Provides
  * routing of notifications from publishers to subscribers.
  *
+ *<p>
  * Internal implementation works by allocating a two-handler Disruptor. The first handler delivers notifications
  * to subscribed listeners and the second one notifies whoever may be listening on the returned future. Registration
  * state tracking is performed by a simple immutable multimap -- when a registration or unregistration occurs we
  * re-generate the entire map from scratch and set it atomically. While registrations/unregistrations synchronize
  * on this instance, notifications do not take any locks here.
  *
- * The fully-blocking {@link #publish(long, DOMNotification, Collection)} and non-blocking {@link #offerNotification(DOMNotification)}
- * are realized using the Disruptor's native operations. The bounded-blocking {@link #offerNotification(DOMNotification, long, TimeUnit)}
+ *<p>
+ * The fully-blocking {@link #publish(long, DOMNotification, Collection)}
+ * and non-blocking {@link #offerNotification(DOMNotification)}
+ * are realized using the Disruptor's native operations. The bounded-blocking {@link
+ * #offerNotification(DOMNotification, long, TimeUnit)}
  * is realized by arming a background wakeup interrupt.
  */
 public final class DOMNotificationRouter implements AutoCloseable, DOMNotificationPublishService,
@@ -62,15 +65,19 @@ public final class DOMNotificationRouter implements AutoCloseable, DOMNotificati
 
     private static final Logger LOG = LoggerFactory.getLogger(DOMNotificationRouter.class);
     private static final ListenableFuture<Void> NO_LISTENERS = Futures.immediateFuture(null);
-    private static final WaitStrategy DEFAULT_STRATEGY = PhasedBackoffWaitStrategy.withLock(1L, 30L, TimeUnit.MILLISECONDS);
-    private static final EventHandler<DOMNotificationRouterEvent> DISPATCH_NOTIFICATIONS = new EventHandler<DOMNotificationRouterEvent>() {
+    private static final WaitStrategy DEFAULT_STRATEGY = PhasedBackoffWaitStrategy.withLock(
+            1L, 30L, TimeUnit.MILLISECONDS);
+    private static final EventHandler<DOMNotificationRouterEvent> DISPATCH_NOTIFICATIONS =
+            new EventHandler<DOMNotificationRouterEvent>() {
         @Override
-        public void onEvent(final DOMNotificationRouterEvent event, final long sequence, final boolean endOfBatch) throws Exception {
+        public void onEvent(final DOMNotificationRouterEvent event, final long sequence,
+                final boolean endOfBatch) throws Exception {
             event.deliverNotification();
 
         }
     };
-    private static final EventHandler<DOMNotificationRouterEvent> NOTIFY_FUTURE = new EventHandler<DOMNotificationRouterEvent>() {
+    private static final EventHandler<DOMNotificationRouterEvent> NOTIFY_FUTURE =
+            new EventHandler<DOMNotificationRouterEvent>() {
         @Override
         public void onEvent(final DOMNotificationRouterEvent event, final long sequence, final boolean endOfBatch) {
             event.setFuture();
@@ -79,14 +86,17 @@ public final class DOMNotificationRouter implements AutoCloseable, DOMNotificati
 
     private final Disruptor<DOMNotificationRouterEvent> disruptor;
     private final ExecutorService executor;
-    private volatile Multimap<SchemaPath, ListenerRegistration<? extends DOMNotificationListener>> listeners = ImmutableMultimap.of();
-    private final ListenerRegistry<DOMNotificationSubscriptionListener> subscriptionListeners = ListenerRegistry.create();
+    private volatile Multimap<SchemaPath, ListenerRegistration<? extends
+            DOMNotificationListener>> listeners = ImmutableMultimap.of();
+    private final ListenerRegistry<DOMNotificationSubscriptionListener> subscriptionListeners =
+            ListenerRegistry.create();
 
     @SuppressWarnings("unchecked")
     private DOMNotificationRouter(final ExecutorService executor, final int queueDepth, final WaitStrategy strategy) {
         this.executor = Preconditions.checkNotNull(executor);
 
-        disruptor = new Disruptor<>(DOMNotificationRouterEvent.FACTORY, queueDepth, executor, ProducerType.MULTI, strategy);
+        disruptor = new Disruptor<>(DOMNotificationRouterEvent.FACTORY,
+                queueDepth, executor, ProducerType.MULTI, strategy);
         disruptor.handleEventsWith(DISPATCH_NOTIFICATIONS);
         disruptor.after(DISPATCH_NOTIFICATIONS).handleEventsWith(NOTIFY_FUTURE);
         disruptor.start();
@@ -98,7 +108,8 @@ public final class DOMNotificationRouter implements AutoCloseable, DOMNotificati
         return new DOMNotificationRouter(executor, queueDepth, DEFAULT_STRATEGY);
     }
 
-    public static DOMNotificationRouter create(final int queueDepth, final long spinTime, final long parkTime, final TimeUnit unit) {
+    public static DOMNotificationRouter create(final int queueDepth, final long spinTime,
+            final long parkTime, final TimeUnit unit) {
         final ExecutorService executor = Executors.newCachedThreadPool();
         final WaitStrategy strategy = PhasedBackoffWaitStrategy.withLock(spinTime, parkTime, unit);
 
@@ -106,25 +117,28 @@ public final class DOMNotificationRouter implements AutoCloseable, DOMNotificati
     }
 
     @Override
-    public synchronized <T extends DOMNotificationListener> ListenerRegistration<T> registerNotificationListener(final T listener, final Collection<SchemaPath> types) {
+    public synchronized <T extends DOMNotificationListener> ListenerRegistration<T> registerNotificationListener(
+            final T listener, final Collection<SchemaPath> types) {
         final ListenerRegistration<T> reg = new AbstractListenerRegistration<T>(listener) {
             @Override
             protected void removeRegistration() {
                 final ListenerRegistration<T> me = this;
 
                 synchronized (DOMNotificationRouter.this) {
-                    replaceListeners(ImmutableMultimap.copyOf(Multimaps.filterValues(listeners, new Predicate<ListenerRegistration<? extends DOMNotificationListener>>() {
-                        @Override
-                        public boolean apply(final ListenerRegistration<? extends DOMNotificationListener> input) {
-                            return input != me;
-                        }
-                    })));
+                    replaceListeners(ImmutableMultimap.copyOf(Multimaps.filterValues(listeners,
+                            new Predicate<ListenerRegistration<? extends DOMNotificationListener>>() {
+                            @Override
+                            public boolean apply(final ListenerRegistration<? extends DOMNotificationListener> input) {
+                                return input != me;
+                            }
+                        })));
                 }
             }
         };
 
         if (!types.isEmpty()) {
-            final Builder<SchemaPath, ListenerRegistration<? extends DOMNotificationListener>> b = ImmutableMultimap.builder();
+            final Builder<SchemaPath, ListenerRegistration<? extends DOMNotificationListener>> b =
+                    ImmutableMultimap.builder();
             b.putAll(listeners);
 
             for (final SchemaPath t : types) {
@@ -138,14 +152,15 @@ public final class DOMNotificationRouter implements AutoCloseable, DOMNotificati
     }
 
     @Override
-    public <T extends DOMNotificationListener> ListenerRegistration<T> registerNotificationListener(final T listener, final SchemaPath... types) {
+    public <T extends DOMNotificationListener> ListenerRegistration<T> registerNotificationListener(
+            final T listener, final SchemaPath... types) {
         return registerNotificationListener(listener, Arrays.asList(types));
     }
 
     /**
-     * Swaps registered listeners and triggers notification update
+     * Swaps registered listeners and triggers notification update.
      *
-     * @param newListeners
+     * @param newListeners is used to notify listenerTypes changed
      */
     private void replaceListeners(
             final Multimap<SchemaPath, ListenerRegistration<? extends DOMNotificationListener>> newListeners) {
@@ -153,8 +168,10 @@ public final class DOMNotificationRouter implements AutoCloseable, DOMNotificati
         notifyListenerTypesChanged(newListeners.keySet());
     }
 
+    @SuppressWarnings("checkstyle:IllegalCatch")
     private void notifyListenerTypesChanged(final Set<SchemaPath> typesAfter) {
-        final List<ListenerRegistration<DOMNotificationSubscriptionListener>> listenersAfter =ImmutableList.copyOf(subscriptionListeners.getListeners());
+        final List<ListenerRegistration<DOMNotificationSubscriptionListener>> listenersAfter =
+                ImmutableList.copyOf(subscriptionListeners.getListeners());
         executor.submit(new Runnable() {
 
             @Override
@@ -184,7 +201,8 @@ public final class DOMNotificationRouter implements AutoCloseable, DOMNotificati
         return subscriptionListeners.registerWithType(listener);
     }
 
-    private ListenableFuture<Void> publish(final long seq, final DOMNotification notification, final Collection<ListenerRegistration<? extends DOMNotificationListener>> subscribers) {
+    private ListenableFuture<Void> publish(final long seq, final DOMNotification notification,
+            final Collection<ListenerRegistration<? extends DOMNotificationListener>> subscribers) {
         final DOMNotificationRouterEvent event = disruptor.get(seq);
         final ListenableFuture<Void> future = event.initialize(notification, subscribers);
         disruptor.getRingBuffer().publish(seq);
@@ -192,8 +210,10 @@ public final class DOMNotificationRouter implements AutoCloseable, DOMNotificati
     }
 
     @Override
-    public ListenableFuture<? extends Object> putNotification(final DOMNotification notification) throws InterruptedException {
-        final Collection<ListenerRegistration<? extends DOMNotificationListener>> subscribers = listeners.get(notification.getType());
+    public ListenableFuture<? extends Object> putNotification(final DOMNotification notification)
+            throws InterruptedException {
+        final Collection<ListenerRegistration<? extends DOMNotificationListener>> subscribers =
+                listeners.get(notification.getType());
         if (subscribers.isEmpty()) {
             return NO_LISTENERS;
         }
@@ -202,10 +222,12 @@ public final class DOMNotificationRouter implements AutoCloseable, DOMNotificati
         return publish(seq, notification, subscribers);
     }
 
-    private ListenableFuture<? extends Object> tryPublish(final DOMNotification notification, final Collection<ListenerRegistration<? extends DOMNotificationListener>> subscribers) {
+    @SuppressWarnings("checkstyle:IllegalCatch")
+    private ListenableFuture<? extends Object> tryPublish(final DOMNotification notification,
+            final Collection<ListenerRegistration<? extends DOMNotificationListener>> subscribers) {
         final long seq;
         try {
-             seq = disruptor.getRingBuffer().tryNext();
+            seq = disruptor.getRingBuffer().tryNext();
         } catch (final InsufficientCapacityException e) {
             return DOMNotificationPublishService.REJECTED;
         }
@@ -215,7 +237,8 @@ public final class DOMNotificationRouter implements AutoCloseable, DOMNotificati
 
     @Override
     public ListenableFuture<? extends Object> offerNotification(final DOMNotification notification) {
-        final Collection<ListenerRegistration<? extends DOMNotificationListener>> subscribers = listeners.get(notification.getType());
+        final Collection<ListenerRegistration<? extends DOMNotificationListener>> subscribers =
+                listeners.get(notification.getType());
         if (subscribers.isEmpty()) {
             return NO_LISTENERS;
         }
@@ -226,7 +249,8 @@ public final class DOMNotificationRouter implements AutoCloseable, DOMNotificati
     @Override
     public ListenableFuture<? extends Object> offerNotification(final DOMNotification notification, final long timeout,
             final TimeUnit unit) throws InterruptedException {
-        final Collection<ListenerRegistration<? extends DOMNotificationListener>> subscribers = listeners.get(notification.getType());
+        final Collection<ListenerRegistration<? extends DOMNotificationListener>> subscribers =
+                listeners.get(notification.getType());
         if (subscribers.isEmpty()) {
             return NO_LISTENERS;
         }
index 4f95770df0717b065da64f4ee77955e44b02d926..e75adebfd29384971da0a9b696d427096268ba45 100644 (file)
@@ -7,14 +7,13 @@
  */
 package org.opendaylight.mdsal.dom.broker;
 
-import org.opendaylight.mdsal.dom.api.DOMNotification;
-import org.opendaylight.mdsal.dom.api.DOMNotificationListener;
-
 import com.google.common.base.Preconditions;
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.SettableFuture;
 import com.lmax.disruptor.EventFactory;
 import java.util.Collection;
+import org.opendaylight.mdsal.dom.api.DOMNotification;
+import org.opendaylight.mdsal.dom.api.DOMNotificationListener;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 
 /**
@@ -22,7 +21,8 @@ import org.opendaylight.yangtools.concepts.ListenerRegistration;
  * so they do have mutable state.
  */
 final class DOMNotificationRouterEvent {
-    public static final EventFactory<DOMNotificationRouterEvent> FACTORY = new EventFactory<DOMNotificationRouterEvent>() {
+    public static final EventFactory<DOMNotificationRouterEvent> FACTORY =
+            new EventFactory<DOMNotificationRouterEvent>() {
         @Override
         public DOMNotificationRouterEvent newInstance() {
             return new DOMNotificationRouterEvent();
@@ -37,7 +37,8 @@ final class DOMNotificationRouterEvent {
         // Hidden on purpose, initialized in initialize()
     }
 
-    ListenableFuture<Void> initialize(final DOMNotification notification, final Collection<ListenerRegistration<? extends DOMNotificationListener>> subscribers) {
+    ListenableFuture<Void> initialize(final DOMNotification notification,
+            final Collection<ListenerRegistration<? extends DOMNotificationListener>> subscribers) {
         this.notification = Preconditions.checkNotNull(notification);
         this.subscribers = Preconditions.checkNotNull(subscribers);
         this.future = SettableFuture.create();
index d3a1af2a2f40220db54776379f74675b3b5e318e..8cf276faa79cee6b1aa28c2187863ba0fee8ea71 100644 (file)
@@ -17,12 +17,12 @@ import com.google.common.util.concurrent.CheckedFuture;
 import com.google.common.util.concurrent.ThreadFactoryBuilder;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.ThreadFactory;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ThreadFactory;
 import javax.annotation.concurrent.GuardedBy;
 import org.opendaylight.mdsal.dom.api.DOMRpcAvailabilityListener;
 import org.opendaylight.mdsal.dom.api.DOMRpcException;
@@ -35,25 +35,22 @@ import org.opendaylight.mdsal.dom.api.DOMRpcService;
 import org.opendaylight.mdsal.dom.spi.AbstractDOMRpcImplementationRegistration;
 import org.opendaylight.yangtools.concepts.AbstractListenerRegistration;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
-import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
+import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.opendaylight.yangtools.yang.model.api.SchemaContextListener;
 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
 
 public final class DOMRpcRouter implements AutoCloseable, DOMRpcService, DOMRpcProviderService, SchemaContextListener {
-    private static final ThreadFactory THREAD_FACTORY = new ThreadFactoryBuilder().setNameFormat("DOMRpcRouter-listener-%s").setDaemon(true).build();
+    private static final ThreadFactory THREAD_FACTORY = new ThreadFactoryBuilder().setNameFormat(
+            "DOMRpcRouter-listener-%s").setDaemon(true).build();
     private final ExecutorService listenerNotifier = Executors.newSingleThreadExecutor(THREAD_FACTORY);
     @GuardedBy("this")
     private Collection<ListenerRegistration<? extends DOMRpcAvailabilityListener>> listeners = Collections.emptyList();
     private volatile DOMRpcRoutingTable routingTable = DOMRpcRoutingTable.EMPTY;
 
-    @Override
-    public <T extends DOMRpcImplementation> DOMRpcImplementationRegistration<T> registerRpcImplementation(final T implementation, final DOMRpcIdentifier... rpcs) {
-        return registerRpcImplementation(implementation, ImmutableSet.copyOf(rpcs));
-    }
-
-    private static Collection<DOMRpcIdentifier> notPresentRpcs(final DOMRpcRoutingTable table, final Collection<DOMRpcIdentifier> candidates) {
+    private static Collection<DOMRpcIdentifier> notPresentRpcs(final DOMRpcRoutingTable table,
+            final Collection<DOMRpcIdentifier> candidates) {
         return ImmutableSet.copyOf(Collections2.filter(candidates, new Predicate<DOMRpcIdentifier>() {
             @Override
             public boolean apply(final DOMRpcIdentifier input) {
@@ -62,7 +59,8 @@ public final class DOMRpcRouter implements AutoCloseable, DOMRpcService, DOMRpcP
         }));
     }
 
-    private synchronized void removeRpcImplementation(final DOMRpcImplementation implementation, final Set<DOMRpcIdentifier> rpcs) {
+    private synchronized void removeRpcImplementation(final DOMRpcImplementation implementation,
+            final Set<DOMRpcIdentifier> rpcs) {
         final DOMRpcRoutingTable oldTable = routingTable;
         final DOMRpcRoutingTable newTable = oldTable.remove(implementation, rpcs);
 
@@ -87,7 +85,14 @@ public final class DOMRpcRouter implements AutoCloseable, DOMRpcService, DOMRpcP
     }
 
     @Override
-    public synchronized <T extends DOMRpcImplementation> DOMRpcImplementationRegistration<T> registerRpcImplementation(final T implementation, final Set<DOMRpcIdentifier> rpcs) {
+    public <T extends DOMRpcImplementation> DOMRpcImplementationRegistration<T> registerRpcImplementation(
+            final T implementation, final DOMRpcIdentifier... rpcs) {
+        return registerRpcImplementation(implementation, ImmutableSet.copyOf(rpcs));
+    }
+
+    @Override
+    public synchronized <T extends DOMRpcImplementation> DOMRpcImplementationRegistration<T>
+            registerRpcImplementation(final T implementation, final Set<DOMRpcIdentifier> rpcs) {
         final DOMRpcRoutingTable oldTable = routingTable;
         final DOMRpcRoutingTable newTable = oldTable.add(implementation, rpcs);
 
@@ -120,7 +125,8 @@ public final class DOMRpcRouter implements AutoCloseable, DOMRpcService, DOMRpcP
     }
 
     @Override
-    public CheckedFuture<DOMRpcResult, DOMRpcException> invokeRpc(final SchemaPath type, final NormalizedNode<?, ?> input) {
+    public CheckedFuture<DOMRpcResult, DOMRpcException> invokeRpc(final SchemaPath type,
+            final NormalizedNode<?, ?> input) {
         return routingTable.invokeRpc(type, input);
     }
 
@@ -134,7 +140,8 @@ public final class DOMRpcRouter implements AutoCloseable, DOMRpcService, DOMRpcP
     }
 
     @Override
-    public synchronized <T extends DOMRpcAvailabilityListener> ListenerRegistration<T> registerRpcListener(final T listener) {
+    public synchronized <T extends DOMRpcAvailabilityListener> ListenerRegistration<T> registerRpcListener(
+            final T listener) {
         final ListenerRegistration<T> ret = new AbstractListenerRegistration<T>(listener) {
             @Override
             protected void removeRegistration() {
@@ -152,12 +159,13 @@ public final class DOMRpcRouter implements AutoCloseable, DOMRpcService, DOMRpcP
             @Override
             public void run() {
                 for (final Entry<SchemaPath, Set<YangInstanceIdentifier>> e : capturedRpcs.entrySet()) {
-                    listener.onRpcAvailable(Collections2.transform(e.getValue(), new Function<YangInstanceIdentifier, DOMRpcIdentifier>() {
-                        @Override
-                        public DOMRpcIdentifier apply(final YangInstanceIdentifier input) {
-                            return DOMRpcIdentifier.create(e.getKey(), input);
-                        }
-                    }));
+                    listener.onRpcAvailable(Collections2.transform(e.getValue(),
+                            new Function<YangInstanceIdentifier, DOMRpcIdentifier>() {
+                            @Override
+                            public DOMRpcIdentifier apply(final YangInstanceIdentifier input) {
+                                return DOMRpcIdentifier.create(e.getKey(), input);
+                            }
+                        }));
                 }
             }
         });
index 795a3f83ecc357102b237d50c0e91862e7cbdfb7..b25ababfc8f3f95acd7dc9eb6800996f3ec9084b 100644 (file)
@@ -7,12 +7,6 @@
  */
 package org.opendaylight.mdsal.dom.broker;
 
-import org.opendaylight.mdsal.dom.api.DOMRpcException;
-import org.opendaylight.mdsal.dom.api.DOMRpcIdentifier;
-import org.opendaylight.mdsal.dom.api.DOMRpcImplementation;
-import org.opendaylight.mdsal.dom.api.DOMRpcImplementationNotAvailableException;
-import org.opendaylight.mdsal.dom.api.DOMRpcResult;
-
 import com.google.common.base.Function;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableMap;
@@ -29,6 +23,11 @@ import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
+import org.opendaylight.mdsal.dom.api.DOMRpcException;
+import org.opendaylight.mdsal.dom.api.DOMRpcIdentifier;
+import org.opendaylight.mdsal.dom.api.DOMRpcImplementation;
+import org.opendaylight.mdsal.dom.api.DOMRpcImplementationNotAvailableException;
+import org.opendaylight.mdsal.dom.api.DOMRpcResult;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
@@ -41,15 +40,16 @@ import org.opendaylight.yangtools.yang.model.api.SchemaPath;
 import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
 
 final class DOMRpcRoutingTable {
-    private static final QName CONTEXT_REFERENCE = QName.create("urn:opendaylight:yang:extension:yang-ext", "2013-07-09", "context-reference").intern();
+    private static final QName CONTEXT_REFERENCE = QName.create("urn:opendaylight:yang:extension:yang-ext",
+            "2013-07-09", "context-reference").intern();
 
     static final DOMRpcRoutingTable EMPTY = new DOMRpcRoutingTable();
     private static final Function<AbstractDOMRpcRoutingTableEntry, Set<YangInstanceIdentifier>> EXTRACT_IDENTIFIERS =
             new Function<AbstractDOMRpcRoutingTableEntry, Set<YangInstanceIdentifier>>() {
-                @Override
-                public Set<YangInstanceIdentifier> apply(final AbstractDOMRpcRoutingTableEntry input) {
-                    return input.registeredIdentifiers();
-                }
+        @Override
+        public Set<YangInstanceIdentifier> apply(final AbstractDOMRpcRoutingTableEntry input) {
+            return input.registeredIdentifiers();
+        }
     };
     private final Map<SchemaPath, AbstractDOMRpcRoutingTableEntry> rpcs;
     private final SchemaContext schemaContext;
@@ -59,12 +59,14 @@ final class DOMRpcRoutingTable {
         schemaContext = null;
     }
 
-    private DOMRpcRoutingTable(final Map<SchemaPath, AbstractDOMRpcRoutingTableEntry> rpcs, final SchemaContext schemaContext) {
+    private DOMRpcRoutingTable(final Map<SchemaPath, AbstractDOMRpcRoutingTableEntry> rpcs,
+            final SchemaContext schemaContext) {
         this.rpcs = Preconditions.checkNotNull(rpcs);
         this.schemaContext = schemaContext;
     }
 
-    private static ListMultimap<SchemaPath, YangInstanceIdentifier> decomposeIdentifiers(final Set<DOMRpcIdentifier> rpcs) {
+    private static ListMultimap<SchemaPath, YangInstanceIdentifier> decomposeIdentifiers(
+            final Set<DOMRpcIdentifier> rpcs) {
         final ListMultimap<SchemaPath, YangInstanceIdentifier> ret = LinkedListMultimap.create();
         for (DOMRpcIdentifier i : rpcs) {
             ret.put(i.getType(), i.getContextReference());
@@ -157,7 +159,8 @@ final class DOMRpcRoutingTable {
         return null;
     }
 
-    private static AbstractDOMRpcRoutingTableEntry createRpcEntry(final SchemaContext context, final SchemaPath key, final Map<YangInstanceIdentifier, List<DOMRpcImplementation>> implementations) {
+    private static AbstractDOMRpcRoutingTableEntry createRpcEntry(final SchemaContext context, final SchemaPath key,
+            final Map<YangInstanceIdentifier, List<DOMRpcImplementation>> implementations) {
         final RpcDefinition rpcDef = findRpcDefinition(context, key);
         if (rpcDef != null) {
             final ContainerSchemaNode input = rpcDef.getInput();
@@ -165,7 +168,8 @@ final class DOMRpcRoutingTable {
                 for (DataSchemaNode c : input.getChildNodes()) {
                     for (UnknownSchemaNode extension : c.getUnknownSchemaNodes()) {
                         if (CONTEXT_REFERENCE.equals(extension.getNodeType())) {
-                            final YangInstanceIdentifier keyId = YangInstanceIdentifier.builder().node(c.getQName()).build();
+                            final YangInstanceIdentifier keyId =
+                                    YangInstanceIdentifier.builder().node(c.getQName()).build();
                             return new RoutedDOMRpcRoutingTableEntry(rpcDef, keyId, implementations);
                         }
                     }
@@ -181,7 +185,8 @@ final class DOMRpcRoutingTable {
     CheckedFuture<DOMRpcResult, DOMRpcException> invokeRpc(final SchemaPath type, final NormalizedNode<?, ?> input) {
         final AbstractDOMRpcRoutingTableEntry entry = rpcs.get(type);
         if (entry == null) {
-            return Futures.<DOMRpcResult, DOMRpcException>immediateFailedCheckedFuture(new DOMRpcImplementationNotAvailableException("No implementation of RPC %s available", type));
+            return Futures.<DOMRpcResult, DOMRpcException>immediateFailedCheckedFuture(
+                    new DOMRpcImplementationNotAvailableException("No implementation of RPC %s available", type));
         }
 
         return entry.invokeRpc(input);
index b63f2563b4ae0bee27f6ea545192bbd99f55ba6d..b6dda99a3bbeaffcc1bfbcf1d5159f9cea8f9ac7 100644 (file)
@@ -7,15 +7,14 @@
  */
 package org.opendaylight.mdsal.dom.broker;
 
-import org.opendaylight.mdsal.dom.api.DOMRpcException;
-import org.opendaylight.mdsal.dom.api.DOMRpcIdentifier;
-import org.opendaylight.mdsal.dom.api.DOMRpcImplementation;
-import org.opendaylight.mdsal.dom.api.DOMRpcResult;
-
 import com.google.common.base.Preconditions;
 import com.google.common.util.concurrent.CheckedFuture;
 import java.util.List;
 import java.util.Map;
+import org.opendaylight.mdsal.dom.api.DOMRpcException;
+import org.opendaylight.mdsal.dom.api.DOMRpcIdentifier;
+import org.opendaylight.mdsal.dom.api.DOMRpcImplementation;
+import org.opendaylight.mdsal.dom.api.DOMRpcResult;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.opendaylight.yangtools.yang.model.api.RpcDefinition;
@@ -24,14 +23,16 @@ final class GlobalDOMRpcRoutingTableEntry extends AbstractDOMRpcRoutingTableEntr
     private static final YangInstanceIdentifier ROOT = YangInstanceIdentifier.builder().build();
     private final DOMRpcIdentifier rpcId;
 
-    private GlobalDOMRpcRoutingTableEntry(final DOMRpcIdentifier rpcId, final Map<YangInstanceIdentifier, List<DOMRpcImplementation>> impls) {
+    private GlobalDOMRpcRoutingTableEntry(final DOMRpcIdentifier rpcId, final Map<YangInstanceIdentifier,
+            List<DOMRpcImplementation>> impls) {
         super(rpcId.getType(), impls);
         this.rpcId = Preconditions.checkNotNull(rpcId);
     }
 
     // We do not need the RpcDefinition, but this makes sure we do not
     // forward something we don't know to be an RPC.
-    GlobalDOMRpcRoutingTableEntry(final RpcDefinition def, final Map<YangInstanceIdentifier, List<DOMRpcImplementation>> impls) {
+    GlobalDOMRpcRoutingTableEntry(final RpcDefinition def, final Map<YangInstanceIdentifier,
+            List<DOMRpcImplementation>> impls) {
         super(def.getPath(), impls);
         this.rpcId = DOMRpcIdentifier.create(def.getPath());
     }
@@ -42,7 +43,8 @@ final class GlobalDOMRpcRoutingTableEntry extends AbstractDOMRpcRoutingTableEntr
     }
 
     @Override
-    protected GlobalDOMRpcRoutingTableEntry newInstance(final Map<YangInstanceIdentifier, List<DOMRpcImplementation>> impls) {
+    protected GlobalDOMRpcRoutingTableEntry newInstance(final Map<YangInstanceIdentifier,
+            List<DOMRpcImplementation>> impls) {
         return new GlobalDOMRpcRoutingTableEntry(rpcId, impls);
     }
 }
\ No newline at end of file
index f5fbf27d93f56580c42ffbffeeb98e8084aa3b19..040be370ad6d614a0d35fd2d1a63b42efcfb0302 100644 (file)
@@ -18,9 +18,9 @@ import org.opendaylight.mdsal.dom.api.DOMRpcIdentifier;
 import org.opendaylight.mdsal.dom.api.DOMRpcImplementation;
 import org.opendaylight.mdsal.dom.api.DOMRpcImplementationNotAvailableException;
 import org.opendaylight.mdsal.dom.api.DOMRpcResult;
+import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNodes;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.model.api.RpcDefinition;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -30,13 +30,16 @@ final class RoutedDOMRpcRoutingTableEntry extends AbstractDOMRpcRoutingTableEntr
     private final DOMRpcIdentifier globalRpcId;
     private final YangInstanceIdentifier keyId;
 
-    private RoutedDOMRpcRoutingTableEntry(final DOMRpcIdentifier globalRpcId, final YangInstanceIdentifier keyId, final Map<YangInstanceIdentifier, List<DOMRpcImplementation>> impls) {
+    private RoutedDOMRpcRoutingTableEntry(final DOMRpcIdentifier globalRpcId,
+            final YangInstanceIdentifier keyId,
+            final Map<YangInstanceIdentifier, List<DOMRpcImplementation>> impls) {
         super(globalRpcId.getType(), impls);
         this.keyId = Preconditions.checkNotNull(keyId);
         this.globalRpcId = Preconditions.checkNotNull(globalRpcId);
     }
 
-    RoutedDOMRpcRoutingTableEntry(final RpcDefinition def, final YangInstanceIdentifier keyId, final Map<YangInstanceIdentifier, List<DOMRpcImplementation>> impls) {
+    RoutedDOMRpcRoutingTableEntry(final RpcDefinition def, final YangInstanceIdentifier keyId,
+            final Map<YangInstanceIdentifier, List<DOMRpcImplementation>> impls) {
         super(def.getPath(), impls);
         this.keyId = Preconditions.checkNotNull(keyId);
         this.globalRpcId = DOMRpcIdentifier.create(def.getPath());
@@ -78,12 +81,15 @@ final class RoutedDOMRpcRoutingTableEntry extends AbstractDOMRpcRoutingTableEntr
         if (impls != null) {
             return impls.get(0).invokeRpc(globalRpcId, input);
         } else {
-            return Futures.<DOMRpcResult, DOMRpcException>immediateFailedCheckedFuture(new DOMRpcImplementationNotAvailableException("No implementation of RPC %s available", getSchemaPath()));
+            return Futures.<DOMRpcResult, DOMRpcException>immediateFailedCheckedFuture(
+                    new DOMRpcImplementationNotAvailableException("No implementation of RPC %s available",
+                            getSchemaPath()));
         }
     }
 
     @Override
-    protected RoutedDOMRpcRoutingTableEntry newInstance(final Map<YangInstanceIdentifier, List<DOMRpcImplementation>> impls) {
+    protected RoutedDOMRpcRoutingTableEntry newInstance(final Map<YangInstanceIdentifier,
+            List<DOMRpcImplementation>> impls) {
         return new RoutedDOMRpcRoutingTableEntry(globalRpcId, keyId, impls);
     }
 }
index 29ac230e790310ba2dce1dca5579ee78cb36750e..b3a3a55be23dea3bd51072096160103df7f976e4 100644 (file)
@@ -8,12 +8,6 @@
 
 package org.opendaylight.mdsal.dom.broker;
 
-import org.opendaylight.mdsal.dom.spi.store.DOMStore;
-import org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort;
-
-import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
-import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
-import org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction;
 import com.google.common.base.Preconditions;
 import com.google.common.util.concurrent.CheckedFuture;
 import com.google.common.util.concurrent.Futures;
@@ -22,6 +16,11 @@ import com.google.common.util.concurrent.ListeningExecutorService;
 import java.util.Collection;
 import java.util.Map;
 import java.util.concurrent.RejectedExecutionException;
+import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
+import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeWriteTransaction;
+import org.opendaylight.mdsal.dom.spi.store.DOMStore;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort;
 import org.opendaylight.yangtools.util.DurationStatisticsTracker;
 import org.opendaylight.yangtools.util.concurrent.MappingCheckedFuture;
 import org.slf4j.Logger;
@@ -31,11 +30,14 @@ import org.slf4j.LoggerFactory;
  * Implementation of blocking three phase commit coordinator, which which
  * supports coordination on multiple {@link DOMStoreThreePhaseCommitCohort}.
  *
+ *<p>
  * This implementation does not support cancellation of commit,
  *
+ *<p>
  * In order to advance to next phase of three phase commit all subtasks of
  * previous step must be finish.
  *
+ *<p>
  * This executor does not have an upper bound on subtask timeout.
  */
 public class SerializedDOMDataBroker extends AbstractDOMDataBroker {
@@ -44,13 +46,14 @@ public class SerializedDOMDataBroker extends AbstractDOMDataBroker {
     private final ListeningExecutorService executor;
 
     /**
-     *
      * Construct DOMDataCommitCoordinator which uses supplied executor to
      * process commit coordinations.
      *
-     * @param executor
+     * @param datastores the Map of backing DOMStore instances
+     * @param executor the ListeningExecutorService to use
      */
-    public SerializedDOMDataBroker(final Map<LogicalDatastoreType, DOMStore> datastores, final ListeningExecutorService executor) {
+    public SerializedDOMDataBroker(final Map<LogicalDatastoreType, DOMStore> datastores,
+            final ListeningExecutorService executor) {
         super(datastores);
         this.executor = Preconditions.checkNotNull(executor, "executor must not be null.");
     }
@@ -60,7 +63,8 @@ public class SerializedDOMDataBroker extends AbstractDOMDataBroker {
     }
 
     @Override
-    protected CheckedFuture<Void,TransactionCommitFailedException> submit(final DOMDataTreeWriteTransaction transaction,
+    protected CheckedFuture<Void,TransactionCommitFailedException> submit(
+            final DOMDataTreeWriteTransaction transaction,
             final Collection<DOMStoreThreePhaseCommitCohort> cohorts) {
         Preconditions.checkArgument(transaction != null, "Transaction must not be null.");
         Preconditions.checkArgument(cohorts != null, "Cohorts must not be null.");
@@ -70,9 +74,9 @@ public class SerializedDOMDataBroker extends AbstractDOMDataBroker {
         try {
             commitFuture = executor.submit(new CommitCoordinationTask(transaction, cohorts,
                     commitStatsTracker));
-        } catch(RejectedExecutionException e) {
-            LOG.error("The commit executor's queue is full - submit task was rejected. \n" +
-                      executor, e);
+        } catch (RejectedExecutionException e) {
+            LOG.error("The commit executor's queue is full - submit task was rejected. \n"
+                    + executor, e);
             return Futures.immediateFailedCheckedFuture(
                     new TransactionCommitFailedException(
                         "Could not submit the commit task - the commit queue capacity has been exceeded.", e));
index 384f55e18e68e32b50c0f9da430a7fa99c321ac0..82b730808e44bac5b4a1e6978f071265ccb31746 100644 (file)
@@ -7,10 +7,9 @@
  */
 package org.opendaylight.mdsal.dom.broker;
 
+import com.google.common.base.Preconditions;
 import org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier;
 import org.opendaylight.mdsal.dom.api.DOMDataTreeShard;
-
-import com.google.common.base.Preconditions;
 import org.opendaylight.yangtools.concepts.AbstractListenerRegistration;
 
 final class ShardRegistration<T extends DOMDataTreeShard> extends AbstractListenerRegistration<T> {
index 5ea7378fea5ffc26a3e465b80e673b6d80f02521..6f30d207f8bc7a525648d14f991f3bc60f68be6a 100644 (file)
@@ -60,11 +60,16 @@ public final class ShardedDOMDataTree implements DOMDataTreeService, DOMDataTree
     }
 
     @Override
-    public <T extends DOMDataTreeShard> ListenerRegistration<T> registerDataTreeShard(final DOMDataTreeIdentifier prefix, final T shard, final DOMDataTreeProducer producer) throws DOMDataTreeShardingConflictException {
+    public <T extends DOMDataTreeShard> ListenerRegistration<T> registerDataTreeShard(
+            final DOMDataTreeIdentifier prefix, final T shard, final DOMDataTreeProducer producer)
+                    throws DOMDataTreeShardingConflictException {
 
-        final DOMDataTreeIdentifier firstSubtree = Iterables.getOnlyElement(((ShardedDOMDataTreeProducer) producer).getSubtrees());
-        Preconditions.checkArgument(firstSubtree != null, "Producer that is used to verify namespace claim can only claim a single namespace");
-        Preconditions.checkArgument(prefix.equals(firstSubtree), "Trying to register shard to a different namespace than the producer has claimed");
+        final DOMDataTreeIdentifier firstSubtree = Iterables.getOnlyElement(((
+                ShardedDOMDataTreeProducer) producer).getSubtrees());
+        Preconditions.checkArgument(firstSubtree != null, "Producer that is used to verify namespace claim can"
+                + " only claim a single namespace");
+        Preconditions.checkArgument(prefix.equals(firstSubtree), "Trying to register shard to a different namespace"
+                + " than the producer has claimed");
 
         final ShardRegistration<T> reg;
         final ShardRegistration<?> parentReg;
@@ -120,7 +125,8 @@ public final class ShardedDOMDataTree implements DOMDataTreeService, DOMDataTree
     }
 
     @GuardedBy("this")
-    private DOMDataTreeProducer createProducer(final Collection<DOMDataTreeIdentifier> subtrees, final Map<DOMDataTreeIdentifier, DOMDataTreeShard> shardMap) {
+    private DOMDataTreeProducer createProducer(final Collection<DOMDataTreeIdentifier> subtrees,
+            final Map<DOMDataTreeIdentifier, DOMDataTreeShard> shardMap) {
         // Record the producer's attachment points
         final DOMDataTreeProducer ret = ShardedDOMDataTreeProducer.create(this, subtrees, shardMap);
         for (final DOMDataTreeIdentifier subtree : subtrees) {
@@ -149,7 +155,8 @@ public final class ShardedDOMDataTree implements DOMDataTreeService, DOMDataTree
         return createProducer(subtrees, shardMap);
     }
 
-    synchronized DOMDataTreeProducer createProducer(final ShardedDOMDataTreeProducer parent, final Collection<DOMDataTreeIdentifier> subtrees) {
+    synchronized DOMDataTreeProducer createProducer(final ShardedDOMDataTreeProducer parent,
+            final Collection<DOMDataTreeIdentifier> subtrees) {
         Preconditions.checkNotNull(parent);
 
         final Map<DOMDataTreeIdentifier, DOMDataTreeShard> shardMap = new HashMap<>();
@@ -160,6 +167,7 @@ public final class ShardedDOMDataTree implements DOMDataTreeService, DOMDataTree
         return createProducer(subtrees, shardMap);
     }
 
+    @SuppressWarnings("checkstyle:IllegalCatch")
     @Override
     public synchronized <T extends DOMDataTreeListener> ListenerRegistration<T> registerListener(final T listener,
             final Collection<DOMDataTreeIdentifier> subtrees, final boolean allowRxMerges,
@@ -199,9 +207,9 @@ public final class ShardedDOMDataTree implements DOMDataTreeService, DOMDataTree
         };
     }
 
-    private static void simpleLoopCheck(final Collection<DOMDataTreeIdentifier> listen, final Set<DOMDataTreeIdentifier> writes)
-            throws DOMDataTreeLoopException {
-        for(final DOMDataTreeIdentifier listenPath : listen) {
+    private static void simpleLoopCheck(final Collection<DOMDataTreeIdentifier> listen,
+            final Set<DOMDataTreeIdentifier> writes) throws DOMDataTreeLoopException {
+        for (final DOMDataTreeIdentifier listenPath : listen) {
             for (final DOMDataTreeIdentifier writePath : writes) {
                 if (listenPath.contains(writePath)) {
                     throw new DOMDataTreeLoopException(String.format(
index 0c0b337f26f047cd9141687dc8796699801ed3cf..34a4f0b924565731e36f6d70442e7e09799bf88a 100644 (file)
@@ -68,7 +68,7 @@ class ShardedDOMDataTreeListenerContext<T extends DOMDataTreeListener> implement
 
         private final LogicalDatastoreType type;
 
-        public StoreListener(LogicalDatastoreType type) {
+        StoreListener(LogicalDatastoreType type) {
             this.type = type;
         }
 
index 241f3d993127d48af696c2fb32195322bc0c74c0..029721b1a3caed8e036450e5923342bd19a958f8 100644 (file)
@@ -85,12 +85,14 @@ class ShardedDOMDataTreeProducer implements DOMDataTreeProducer {
         idToShard = ImmutableMap.copyOf(shardMap);
     }
 
-    private BiMap<DOMDataTreeIdentifier, DOMDataTreeShardProducer> mapIdsToProducer(final Multimap<DOMDataTreeShard, DOMDataTreeIdentifier> shardToId) {
+    private BiMap<DOMDataTreeIdentifier, DOMDataTreeShardProducer> mapIdsToProducer(final Multimap<DOMDataTreeShard,
+            DOMDataTreeIdentifier> shardToId) {
         final Builder<DOMDataTreeIdentifier, DOMDataTreeShardProducer> idToProducerBuilder = ImmutableBiMap.builder();
         for (final Entry<DOMDataTreeShard, Collection<DOMDataTreeIdentifier>> entry : shardToId.asMap().entrySet()) {
             if (entry.getKey() instanceof WriteableDOMDataTreeShard) {
                 //create a single producer for all prefixes in a single shard
-                final DOMDataTreeShardProducer producer = ((WriteableDOMDataTreeShard) entry.getKey()).createProducer(entry.getValue());
+                final DOMDataTreeShardProducer producer = ((WriteableDOMDataTreeShard) entry.getKey())
+                        .createProducer(entry.getValue());
                 // id mapped to producers
                 for (final DOMDataTreeIdentifier id : entry.getValue()) {
                     idToProducerBuilder.put(id, producer);
@@ -125,9 +127,9 @@ class ShardedDOMDataTreeProducer implements DOMDataTreeProducer {
     }
 
     @GuardedBy("this")
-    private DOMDataTreeProducer lookupChild(final DOMDataTreeIdentifier s) {
+    private DOMDataTreeProducer lookupChild(final DOMDataTreeIdentifier domDataTreeIdentifier) {
         for (final Entry<DOMDataTreeIdentifier, DOMDataTreeProducer> e : children.entrySet()) {
-            if (e.getKey().contains(s)) {
+            if (e.getKey().contains(domDataTreeIdentifier)) {
                 return e.getValue();
             }
         }
@@ -150,7 +152,8 @@ class ShardedDOMDataTreeProducer implements DOMDataTreeProducer {
             // Check if part of the requested subtree is not delegated to a child.
             for (final DOMDataTreeIdentifier c : children.keySet()) {
                 if (s.contains(c)) {
-                    throw new IllegalArgumentException(String.format("Subtree %s cannot be delegated as it is superset of already-delegated %s", s, c));
+                    throw new IllegalArgumentException(String.format("Subtree %s cannot be delegated as it is"
+                            + " superset of already-delegated %s", s, c));
                 }
             }
         }
index e1ad2f9795654578b6657e82717d386a9b1eb22d..fb5c1315fecfa15cebe80ad357fbe052dd7e639d 100644 (file)
@@ -59,7 +59,8 @@ final class ShardedDOMDataTreeWriteTransaction implements DOMDataTreeCursorAware
                                        final Map<DOMDataTreeIdentifier, DOMDataTreeProducer> childProducers) {
         this.producer = Preconditions.checkNotNull(producer);
         idToTransaction = new HashMap<>();
-        Preconditions.checkNotNull(idToProducer).forEach((id, prod) -> idToTransaction.put(id, prod.createTransaction()));
+        Preconditions.checkNotNull(idToProducer).forEach((id, prod) -> idToTransaction.put(
+                id, prod.createTransaction()));
         this.identifier = "SHARDED-DOM-" + COUNTER.getAndIncrement();
         childProducers.forEach((id, prod) -> childBoundaries.add(id.getRootIdentifier()));
     }
@@ -75,7 +76,8 @@ final class ShardedDOMDataTreeWriteTransaction implements DOMDataTreeCursorAware
                 return e.getValue();
             }
         }
-        throw new IllegalArgumentException(String.format("Path %s is not accessible from transaction %s", prefix, this));
+        throw new IllegalArgumentException(String.format("Path %s is not accessible from transaction %s",
+                prefix, this));
     }
 
     @Override
@@ -131,8 +133,8 @@ final class ShardedDOMDataTreeWriteTransaction implements DOMDataTreeCursorAware
             }
 
             @Override
-            public void onFailure(final Throwable t) {
-                ret.setException(t);
+            public void onFailure(final Throwable exp) {
+                ret.setException(exp);
             }
         });
 
@@ -149,7 +151,7 @@ final class ShardedDOMDataTreeWriteTransaction implements DOMDataTreeCursorAware
         private final DOMDataTreeWriteCursor delegate;
         private final Deque<PathArgument> path = new LinkedList<>();
 
-        public DelegatingCursor(final DOMDataTreeWriteCursor delegate, final DOMDataTreeIdentifier rootPosition) {
+        DelegatingCursor(final DOMDataTreeWriteCursor delegate, final DOMDataTreeIdentifier rootPosition) {
             this.delegate = delegate;
             path.addAll(rootPosition.getRootIdentifier().getPathArguments());
         }
@@ -219,7 +221,8 @@ final class ShardedDOMDataTreeWriteTransaction implements DOMDataTreeCursorAware
             childBoundaries.forEach(id -> {
                 if (id.contains(yid)) {
                     path.removeLast();
-                    throw new IllegalArgumentException("Path {" + yid + "} is not available to this cursor since it's already claimed by a child producer");
+                    throw new IllegalArgumentException("Path {" + yid + "} is not available to this cursor"
+                            + " since it's already claimed by a child producer");
                 }
             });
             path.removeLast();
index c0f7ae187576697d3908afd9ca7645c1f6ad64ba..e04a0828ef28cd61a4548d7e3dab2a5140e6b3c1 100644 (file)
@@ -95,7 +95,7 @@ public class ShardedDOMReadTransactionAdapter implements DOMDataTreeReadTransact
             }
 
             @Override
-            public void onFailure(final Throwable t) {
+            public void onFailure(final Throwable throwable) {
                 reg.close();
             }
         });
@@ -109,7 +109,7 @@ public class ShardedDOMReadTransactionAdapter implements DOMDataTreeReadTransact
         checkRunning();
         LOG.debug("{}: Invoking exists at {}:{}", txIdentifier, store, path);
         final Function<Optional<NormalizedNode<?, ?>>, Boolean> transform =
-                optionalNode -> optionalNode.isPresent() ? Boolean.TRUE : Boolean.FALSE;
+            optionalNode -> optionalNode.isPresent() ? Boolean.TRUE : Boolean.FALSE;
         final ListenableFuture<Boolean> existsResult = Futures.transform(read(store, path), transform);
         return Futures.makeChecked(existsResult, ReadFailedException.MAPPER);
     }
@@ -122,7 +122,7 @@ public class ShardedDOMReadTransactionAdapter implements DOMDataTreeReadTransact
 
         private final SettableFuture<Optional<NormalizedNode<?, ?>>> readResultFuture;
 
-        public ReadShardedListener(final SettableFuture<Optional<NormalizedNode<?, ?>>> future) {
+        ReadShardedListener(final SettableFuture<Optional<NormalizedNode<?, ?>>> future) {
             this.readResultFuture = Preconditions.checkNotNull(future);
         }
 
@@ -151,8 +151,7 @@ public class ShardedDOMReadTransactionAdapter implements DOMDataTreeReadTransact
 
             // We chain all exceptions and return aggregated one
             readResultFuture.setException(new DOMDataTreeListeningException("Aggregated DOMDataTreeListening exception",
-                    causes.stream().reduce((e1, e2) ->
-                    {
+                    causes.stream().reduce((e1, e2) -> {
                         e1.addSuppressed(e2);
                         return e1;
                     }).get()));
index e6fa8bce3fc6da20cddab070b73c2768c1febb75..4ac02aad07c0a223f288c02c167b0bc32f673333 100644 (file)
@@ -97,7 +97,7 @@ public class ShardedDOMTransactionChainAdapter implements DOMTransactionChain {
             }
 
             @Override
-            public void onFailure(final Throwable t) {
+            public void onFailure(final Throwable throwable) {
                 // We don't have to do nothing here,
                 // tx should take car of it
             }
@@ -160,8 +160,8 @@ public class ShardedDOMTransactionChainAdapter implements DOMTransactionChain {
 
         @Nonnull
         @Override
-        public <T extends DOMDataTreeListener> ListenerRegistration<T>
-        registerListener(@Nonnull final T listener, @Nonnull final Collection<DOMDataTreeIdentifier> subtrees,
+        public <T extends DOMDataTreeListener> ListenerRegistration<T> registerListener(
+                @Nonnull final T listener, @Nonnull final Collection<DOMDataTreeIdentifier> subtrees,
                          final boolean allowRxMerges, @Nonnull final Collection<DOMDataTreeProducer> producers)
                 throws DOMDataTreeLoopException {
             return delegateTreeService.registerListener(listener, subtrees, allowRxMerges, producers);
index 2e610c4560d56f708127e384eb21f652099244e4..c12f49f18e291ab5735f81f02e90cdcf70c06b1f 100644 (file)
@@ -173,8 +173,7 @@ public class ShardedDOMWriteTransactionAdapter implements DOMDataTreeWriteTransa
     }
 
     private void closeProducers() {
-        producerMap.values().forEach(domDataTreeProducer ->
-        {
+        producerMap.values().forEach(domDataTreeProducer -> {
             try {
                 domDataTreeProducer.close();
             } catch (final DOMDataTreeProducerException e) {
index 30e0235ff6c4b90a79283dad5ec99b77894a3011..9afd26b3f42c7f9eb3a80172f17e9738f32534ba 100644 (file)
@@ -40,7 +40,7 @@ public class TransactionChainReadTransaction implements DOMDataTreeReadTransacti
 
     @Override
     public CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> read(final LogicalDatastoreType store,
-                                                                                   final YangInstanceIdentifier path) {
+            final YangInstanceIdentifier path) {
         final SettableFuture<Optional<NormalizedNode<?, ?>>> readResult = SettableFuture.create();
 
         Futures.addCallback(previousWriteTxFuture, new FutureCallback<Void>() {
@@ -55,18 +55,18 @@ public class TransactionChainReadTransaction implements DOMDataTreeReadTransacti
                             }
 
                             @Override
-                            public void onFailure(final Throwable t) {
-                                txChain.transactionFailed(TransactionChainReadTransaction.this, t);
-                                readResult.setException(t);
+                            public void onFailure(final Throwable throwable) {
+                                txChain.transactionFailed(TransactionChainReadTransaction.this, throwable);
+                                readResult.setException(throwable);
                             }
                         });
             }
 
             @Override
-            public void onFailure(final Throwable t) {
+            public void onFailure(final Throwable throwable) {
                 // we don't have to notify txchain about this failure
                 // failed write transaction should do this
-                readResult.setException(t);
+                readResult.setException(throwable);
             }
         });
 
@@ -77,7 +77,7 @@ public class TransactionChainReadTransaction implements DOMDataTreeReadTransacti
     public CheckedFuture<Boolean, ReadFailedException> exists(final LogicalDatastoreType store,
                                                               final YangInstanceIdentifier path) {
         final Function<Optional<NormalizedNode<?, ?>>, Boolean> transform =
-                optionalNode -> optionalNode.isPresent() ? Boolean.TRUE : Boolean.FALSE;
+            optionalNode -> optionalNode.isPresent() ? Boolean.TRUE : Boolean.FALSE;
         final ListenableFuture<Boolean> existsResult = Futures.transform(read(store, path), transform);
         return Futures.makeChecked(existsResult, ReadFailedException.MAPPER);
     }
index 187bb426903a84eab8154c4645f2c98534d0a036..cbf4fe30a505c0285eb37f9e06526da015ee446c 100644 (file)
@@ -33,12 +33,14 @@ public class TransactionChainWriteTransaction implements DOMDataTreeWriteTransac
 
 
     @Override
-    public void put(final LogicalDatastoreType store, final YangInstanceIdentifier path, final NormalizedNode<?, ?> data) {
+    public void put(final LogicalDatastoreType store, final YangInstanceIdentifier path,
+            final NormalizedNode<?, ?> data) {
         delegateTx.put(store, path, data);
     }
 
     @Override
-    public void merge(final LogicalDatastoreType store, final YangInstanceIdentifier path, final NormalizedNode<?, ?> data) {
+    public void merge(final LogicalDatastoreType store, final YangInstanceIdentifier path,
+            final NormalizedNode<?, ?> data) {
         delegateTx.merge(store, path, data);
     }
 
@@ -63,8 +65,8 @@ public class TransactionChainWriteTransaction implements DOMDataTreeWriteTransac
             }
 
             @Override
-            public void onFailure(final Throwable t) {
-                txChain.transactionFailed(TransactionChainWriteTransaction.this, t);
+            public void onFailure(final Throwable throwable) {
+                txChain.transactionFailed(TransactionChainWriteTransaction.this, throwable);
             }
         });
 
index 8ed5eb2fe7c671c83d280eccc8b995aaa3049dec..4818d8a847d2345475284a38235a78fc9817e888 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.mdsal.dom.broker;
 
 import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
-
 import org.opendaylight.yangtools.util.concurrent.ExceptionMapper;
 
 /**
index 38c76bc28469ebac188890324daed061531366c3..0fae746b2c8d74c409cebe2262dd60c4563fc021 100644 (file)
@@ -7,15 +7,14 @@
  */
 package org.opendaylight.mdsal.dom.broker;
 
-import org.opendaylight.mdsal.dom.api.DOMRpcException;
-import org.opendaylight.mdsal.dom.api.DOMRpcImplementation;
-import org.opendaylight.mdsal.dom.api.DOMRpcImplementationNotAvailableException;
-import org.opendaylight.mdsal.dom.api.DOMRpcResult;
-
 import com.google.common.util.concurrent.CheckedFuture;
 import com.google.common.util.concurrent.Futures;
 import java.util.List;
 import java.util.Map;
+import org.opendaylight.mdsal.dom.api.DOMRpcException;
+import org.opendaylight.mdsal.dom.api.DOMRpcImplementation;
+import org.opendaylight.mdsal.dom.api.DOMRpcImplementationNotAvailableException;
+import org.opendaylight.mdsal.dom.api.DOMRpcResult;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
@@ -23,7 +22,8 @@ import org.opendaylight.yangtools.yang.model.api.SchemaPath;
 final class UnknownDOMRpcRoutingTableEntry extends AbstractDOMRpcRoutingTableEntry {
     private final CheckedFuture<DOMRpcResult, DOMRpcException> unknownRpc;
 
-    UnknownDOMRpcRoutingTableEntry(final SchemaPath schemaPath, final Map<YangInstanceIdentifier, List<DOMRpcImplementation>> impls) {
+    UnknownDOMRpcRoutingTableEntry(final SchemaPath schemaPath, final Map<YangInstanceIdentifier,
+            List<DOMRpcImplementation>> impls) {
         super(schemaPath, impls);
         unknownRpc = Futures.<DOMRpcResult, DOMRpcException>immediateFailedCheckedFuture(
             new DOMRpcImplementationNotAvailableException("SchemaPath %s is not resolved to an RPC", schemaPath));
@@ -35,7 +35,8 @@ final class UnknownDOMRpcRoutingTableEntry extends AbstractDOMRpcRoutingTableEnt
     }
 
     @Override
-    protected UnknownDOMRpcRoutingTableEntry newInstance(final Map<YangInstanceIdentifier, List<DOMRpcImplementation>> impls) {
+    protected UnknownDOMRpcRoutingTableEntry newInstance(final Map<YangInstanceIdentifier,
+            List<DOMRpcImplementation>> impls) {
         return new UnknownDOMRpcRoutingTableEntry(getSchemaPath(), impls);
     }
 }
\ No newline at end of file
index 540a5d8239c6b7eb48c610e153e9e75de761ffec..0e544a84017efef9cdc13bee70ea19653bde66bc 100644 (file)
@@ -8,6 +8,7 @@
 package org.opendaylight.mdsal.dom.broker.osgi;
 
 import static com.google.common.base.Preconditions.checkState;
+
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
@@ -37,7 +38,8 @@ import org.osgi.util.tracker.ServiceTrackerCustomizer;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class OsgiBundleScanningSchemaService implements SchemaContextProvider, DOMSchemaService, ServiceTrackerCustomizer<SchemaContextListener, SchemaContextListener>, AutoCloseable {
+public class OsgiBundleScanningSchemaService implements SchemaContextProvider, DOMSchemaService,
+        ServiceTrackerCustomizer<SchemaContextListener, SchemaContextListener>, AutoCloseable {
     private static final Logger LOG = LoggerFactory.getLogger(OsgiBundleScanningSchemaService.class);
 
     private final ListenerRegistry<SchemaContextListener> listeners = new ListenerRegistry<>();
@@ -54,14 +56,14 @@ public class OsgiBundleScanningSchemaService implements SchemaContextProvider, D
         this.context = Preconditions.checkNotNull(context);
     }
 
-    public synchronized static OsgiBundleScanningSchemaService createInstance(final BundleContext ctx) {
+    public static synchronized OsgiBundleScanningSchemaService createInstance(final BundleContext ctx) {
         Preconditions.checkState(instance == null);
         instance = new OsgiBundleScanningSchemaService(ctx);
         instance.start();
         return instance;
     }
 
-    public synchronized static OsgiBundleScanningSchemaService getInstance() {
+    public static synchronized OsgiBundleScanningSchemaService getInstance() {
         Preconditions.checkState(instance != null, "Global Instance was not instantiated");
         return instance;
     }
@@ -83,8 +85,10 @@ public class OsgiBundleScanningSchemaService implements SchemaContextProvider, D
         checkState(context != null);
         LOG.debug("start() starting");
 
-        listenerTracker = new ServiceTracker<>(context, SchemaContextListener.class, OsgiBundleScanningSchemaService.this);
-        bundleTracker = new BundleTracker<>(context, Bundle.RESOLVED | Bundle.STARTING |
+        listenerTracker = new ServiceTracker<>(context, SchemaContextListener.class,
+                OsgiBundleScanningSchemaService.this);
+        bundleTracker = new BundleTracker<>(context, Bundle.RESOLVED | Bundle.STARTING
+                |
                 Bundle.STOPPING | Bundle.ACTIVE, scanner);
         bundleTracker.open();
 
@@ -113,9 +117,10 @@ public class OsgiBundleScanningSchemaService implements SchemaContextProvider, D
     }
 
     @Override
-    public synchronized ListenerRegistration<SchemaContextListener> registerSchemaContextListener(final SchemaContextListener listener) {
+    public synchronized ListenerRegistration<SchemaContextListener>
+        registerSchemaContextListener(final SchemaContextListener listener) {
         final Optional<SchemaContext> potentialCtx = contextResolver.getSchemaContext();
-        if(potentialCtx.isPresent()) {
+        if (potentialCtx.isPresent()) {
             listener.onGlobalContextUpdated(potentialCtx.get());
         }
         return listeners.register(listener);
@@ -135,6 +140,7 @@ public class OsgiBundleScanningSchemaService implements SchemaContextProvider, D
         }
     }
 
+    @SuppressWarnings("checkstyle:IllegalCatch")
     private synchronized void updateContext(final SchemaContext snapshot) {
         final Object[] services = listenerTracker.getServices();
         for (final ListenerRegistration<SchemaContextListener> listener : listeners) {
@@ -156,6 +162,7 @@ public class OsgiBundleScanningSchemaService implements SchemaContextProvider, D
         }
     }
 
+    @SuppressWarnings("checkstyle:IllegalCatch")
     private class BundleScanner implements BundleTrackerCustomizer<Iterable<Registration>> {
         @Override
         public Iterable<Registration> addingBundle(final Bundle bundle, final BundleEvent event) {
@@ -198,9 +205,10 @@ public class OsgiBundleScanningSchemaService implements SchemaContextProvider, D
          * {@link #getYangStoreSnapshot()} will throw exception. There is no
          * rollback.
          */
-
+        @SuppressWarnings("checkstyle:IllegalCatch")
         @Override
-        public synchronized void removedBundle(final Bundle bundle, final BundleEvent event, final Iterable<Registration> urls) {
+        public synchronized void removedBundle(final Bundle bundle, final BundleEvent event,
+                final Iterable<Registration> urls) {
             for (final Registration url : urls) {
                 try {
                     url.close();
@@ -210,9 +218,10 @@ public class OsgiBundleScanningSchemaService implements SchemaContextProvider, D
             }
 
             final int numUrls = Iterables.size(urls);
-            if(numUrls > 0 ) {
-                if(LOG.isDebugEnabled()) {
-                    LOG.debug("removedBundle: {}, state: {}, # urls: {}", bundle.getSymbolicName(), bundle.getState(), numUrls);
+            if (numUrls > 0 ) {
+                if (LOG.isDebugEnabled()) {
+                    LOG.debug("removedBundle: {}, state: {}, # urls: {}", bundle.getSymbolicName(),
+                            bundle.getState(), numUrls);
                 }
 
                 tryToUpdateSchemaContext();
@@ -236,8 +245,8 @@ public class OsgiBundleScanningSchemaService implements SchemaContextProvider, D
             return;
         }
         final Optional<SchemaContext> schema = contextResolver.getSchemaContext();
-        if(schema.isPresent()) {
-            if(LOG.isDebugEnabled()) {
+        if (schema.isPresent()) {
+            if (LOG.isDebugEnabled()) {
                 LOG.debug("Got new SchemaContext: # of modules {}", schema.get().getAllModuleIdentifiers().size());
             }
 
@@ -246,12 +255,14 @@ public class OsgiBundleScanningSchemaService implements SchemaContextProvider, D
     }
 
     @Override
-    public void modifiedService(final ServiceReference<SchemaContextListener> reference, final SchemaContextListener service) {
+    public void modifiedService(final ServiceReference<SchemaContextListener> reference,
+            final SchemaContextListener service) {
         // NOOP
     }
 
     @Override
-    public void removedService(final ServiceReference<SchemaContextListener> reference, final SchemaContextListener service) {
+    public void removedService(final ServiceReference<SchemaContextListener> reference,
+            final SchemaContextListener service) {
         context.ungetService(reference);
     }
 }
index 438ad76ac0d9238e7e06e67786c67f7e70fa8b05..52af5814faa6a9dc05e837e78c9194a5781e25b6 100644 (file)
@@ -7,8 +7,8 @@
  */
 package org.opendaylight.mdsal.dom.broker.osgi;
 
-import org.opendaylight.mdsal.dom.api.DOMSchemaService;
 import java.util.Hashtable;
+import org.opendaylight.mdsal.dom.api.DOMSchemaService;
 import org.osgi.framework.BundleActivator;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.ServiceRegistration;
@@ -22,7 +22,8 @@ public class SchemaServiceActivator implements BundleActivator {
     @Override
     public void start(final BundleContext context) {
         schemaService = OsgiBundleScanningSchemaService.createInstance(context);
-        schemaServiceReg = context.registerService(DOMSchemaService.class, schemaService, new Hashtable<String,String>());
+        schemaServiceReg = context.registerService(DOMSchemaService.class,
+                schemaService, new Hashtable<String,String>());
     }
 
     @Override
index fbca99adaaa56d6c830358ec350dcf9707bddd45..1529d3073415f1578b8fc5a9050ad690f5882379 100644 (file)
@@ -15,6 +15,7 @@ import org.opendaylight.mdsal.common.api.TransactionChainListener;
 /**
  * Simple implementation of {@link TransactionChainListener} for testing.
  *
+ *<p>
  * This transaction chain listener does not contain any logic, only update
  * futures ({@link #getFailFuture()} and {@link #getSuccessFuture()} when
  * transaction chain event is retrieved.
index 4a82645974e2d845f408ec88691c0d3fa5f7d83b..ae5d6c098ebf3bef9d98266acfbb92b949e371c5 100644 (file)
@@ -68,7 +68,8 @@ public class DOMBrokerTest {
         operStore.onGlobalContextUpdated(schemaContext);
         configStore.onGlobalContextUpdated(schemaContext);
 
-        final ImmutableMap<LogicalDatastoreType, DOMStore> stores = ImmutableMap.<LogicalDatastoreType, DOMStore> builder()
+        final ImmutableMap<LogicalDatastoreType, DOMStore> stores =
+                ImmutableMap.<LogicalDatastoreType, DOMStore>builder()
                 .put(CONFIGURATION, configStore)
                 .put(OPERATIONAL, operStore)
                 .build();
@@ -82,16 +83,16 @@ public class DOMBrokerTest {
 
     @After
     public void tearDown() {
-        ifexecutor != null ) {
+        if (executor != null ) {
             executor.shutdownNow();
         }
 
-        if(futureExecutor != null) {
+        if (futureExecutor != null) {
             futureExecutor.shutdownNow();
         }
     }
 
-    @Test(timeout=10000)
+    @Test(timeout = 10000)
     public void testTransactionIsolation() throws InterruptedException, ExecutionException {
         assertNotNull(domBroker);
 
@@ -102,14 +103,12 @@ public class DOMBrokerTest {
         assertNotNull(writeTx);
 
         /**
-         *
-         * Writes /test in writeTx
+         * Writes /test in writeTx.
          *
          */
         writeTx.put(OPERATIONAL, TestModel.TEST_PATH, ImmutableNodes.containerNode(TestModel.TEST_QNAME));
 
         /**
-         *
          * Reads /test from readTx Read should return Absent.
          *
          */
@@ -118,12 +117,11 @@ public class DOMBrokerTest {
         assertFalse(readTxContainer.get().isPresent());
     }
 
-    @Test(timeout=10000)
+    @Test(timeout = 10000)
     public void testTransactionCommit() throws InterruptedException, ExecutionException {
         final DOMDataTreeWriteTransaction writeTx = domBroker.newWriteOnlyTransaction();
         assertNotNull(writeTx);
         /**
-         *
          * Writes /test in writeTx
          *
          */
@@ -136,7 +134,7 @@ public class DOMBrokerTest {
         assertTrue(afterCommitRead.isPresent());
     }
 
-    @Test(expected=TransactionCommitFailedException.class)
+    @Test(expected = TransactionCommitFailedException.class)
     public void testRejectedCommit() throws Exception {
         commitExecutor.delegate = Mockito.mock( ExecutorService.class );
         Mockito.doThrow( new RejectedExecutionException( "mock" ) )
@@ -153,6 +151,7 @@ public class DOMBrokerTest {
         writeTx.submit().checkedGet( 5, TimeUnit.SECONDS );
     }
 
+    @SuppressWarnings("checkstyle:IllegalCatch")
     AtomicReference<Throwable> submitTxAsync( final DOMDataTreeWriteTransaction writeTx ) {
         final AtomicReference<Throwable> caughtEx = new AtomicReference<>();
         new Thread() {
@@ -161,7 +160,7 @@ public class DOMBrokerTest {
 
                 try {
                     writeTx.submit();
-                } catch( final Throwable e ) {
+                } catch ( final Throwable e ) {
                     caughtEx.set( e );
                 }
             }
@@ -214,15 +213,19 @@ public class DOMBrokerTest {
         readRx.read(OPERATIONAL, TestModel.TEST_PATH).checkedGet();
     }
 
+    @SuppressWarnings({"checkstyle:IllegalThrows", "checkstyle:IllegalCatch"})
     @Test
     public void closeTest() throws Exception {
-        final String TEST_EXCEPTION = "TestException";
+        final String testException = "TestException";
+
+        domBroker.setCloseable(() -> {
+            throw new Exception(testException);
+        });
 
-        domBroker.setCloseable(() -> { throw new Exception(TEST_EXCEPTION); });
-        try{
+        try {
             domBroker.close();
-        }catch(final Exception e){
-            assertTrue(e.getMessage().contains(TEST_EXCEPTION));
+        } catch (final Exception e) {
+            assertTrue(e.getMessage().contains(testException));
         }
     }
 
@@ -230,7 +233,7 @@ public class DOMBrokerTest {
 
         ExecutorService delegate;
 
-        public CommitExecutorService( final ExecutorService delegate ) {
+        CommitExecutorService( final ExecutorService delegate ) {
             this.delegate = delegate;
         }
 
index 6e734567aadc35c529ae01ae977c497bb4a167e7..7e7150bf6d09b5479a23358f9fdd09dea8c8d84f 100644 (file)
@@ -101,7 +101,8 @@ public class DOMDataTreeListenerTest {
         operStore.onGlobalContextUpdated(schemaContext);
         configStore.onGlobalContextUpdated(schemaContext);
 
-        final ImmutableMap<LogicalDatastoreType, DOMStore> stores = ImmutableMap.<LogicalDatastoreType, DOMStore>builder()
+        final ImmutableMap<LogicalDatastoreType, DOMStore> stores = ImmutableMap.<LogicalDatastoreType,
+                DOMStore>builder()
                 .put(CONFIGURATION, configStore)
                 .put(OPERATIONAL, operStore)
                 .build();
@@ -428,7 +429,7 @@ public class DOMDataTreeListenerTest {
 
         ExecutorService delegate;
 
-        public CommitExecutorService(final ExecutorService delegate) {
+        CommitExecutorService(final ExecutorService delegate) {
             this.delegate = delegate;
         }
 
@@ -443,7 +444,7 @@ public class DOMDataTreeListenerTest {
         private final List<Collection<DataTreeCandidate>> receivedChanges = new ArrayList<>();
         private final CountDownLatch latch;
 
-        public TestDataTreeListener(final CountDownLatch latch) {
+        TestDataTreeListener(final CountDownLatch latch) {
             this.latch = latch;
         }
 
index 929aed96c97e9156712f7d3832e330033f1945c1..90d2043ac6e52acc9d5d77cdf20a72adc729f0d3 100644 (file)
@@ -34,6 +34,7 @@ public class DOMNotificationRouterTest extends TestUtils {
         assertNotNull(DOMNotificationRouter.create(1));
     }
 
+    @SuppressWarnings("checkstyle:IllegalCatch")
     @Test
     public void complexTest() throws Exception {
         final DOMNotificationSubscriptionListener domNotificationSubscriptionListener =
index 44f746c761110f776d1e3e92f9e1a04229935ae3..f957bab004690d58fe0c02f25be2be42103afb77 100644 (file)
@@ -41,20 +41,24 @@ public class DOMTransactionChainTest {
     private AbstractDOMDataBroker domBroker;
 
     @Before
-    public void setupStore() throws Exception{
-        final InMemoryDOMDataStore operStore = new InMemoryDOMDataStore("OPER", MoreExecutors.newDirectExecutorService());
-        final InMemoryDOMDataStore configStore = new InMemoryDOMDataStore("CFG", MoreExecutors.newDirectExecutorService());
+    public void setupStore() throws Exception {
+        final InMemoryDOMDataStore operStore = new InMemoryDOMDataStore("OPER",
+                MoreExecutors.newDirectExecutorService());
+        final InMemoryDOMDataStore configStore = new InMemoryDOMDataStore("CFG",
+                MoreExecutors.newDirectExecutorService());
         schemaContext = TestModel.createTestContext();
 
         operStore.onGlobalContextUpdated(schemaContext);
         configStore.onGlobalContextUpdated(schemaContext);
 
-        final ImmutableMap<LogicalDatastoreType, DOMStore> stores = ImmutableMap.<LogicalDatastoreType, DOMStore> builder() //
-                .put(CONFIGURATION, configStore) //
-                .put(OPERATIONAL, operStore) //
+        final ImmutableMap<LogicalDatastoreType, DOMStore> stores =
+                ImmutableMap.<LogicalDatastoreType, DOMStore>builder()
+                .put(CONFIGURATION, configStore)
+                .put(OPERATIONAL, operStore)
                 .build();
 
-        final ListeningExecutorService executor = MoreExecutors.listeningDecorator(Executors.newSingleThreadExecutor());
+        final ListeningExecutorService executor = MoreExecutors.listeningDecorator(
+                Executors.newSingleThreadExecutor());
         domBroker = new SerializedDOMDataBroker(stores, executor);
     }
 
@@ -65,15 +69,13 @@ public class DOMTransactionChainTest {
         assertNotNull(txChain);
 
         /**
-         * We alocate new read-write transaction and write /test
-         *
-         *
+         * We alocate new read-write transaction and write /test.
          */
         final DOMDataTreeWriteTransaction firstTx = allocateAndWrite(txChain);
 
         /**
          * First transaction is marked as ready, we are able to allocate chained
-         * transactions
+         * transactions.
          */
         final ListenableFuture<Void> firstWriteTxFuture = firstTx.submit();
 
@@ -92,7 +94,6 @@ public class DOMTransactionChainTest {
         assertTestContainerExists(secondReadTx);
 
         /**
-         *
          * We alocate next transaction, which is still based on first one, but
          * is read-write.
          *
@@ -106,7 +107,6 @@ public class DOMTransactionChainTest {
         assertCommitSuccessful(firstWriteTxFuture);
 
         /**
-         *
          * Allocates transaction from data store.
          *
          */
@@ -119,7 +119,7 @@ public class DOMTransactionChainTest {
         assertTestContainerExists(storeReadTx);
 
         /**
-         * third transaction is sealed and commited
+         * third transaction is sealed and commited.
          */
         final ListenableFuture<Void> thirdDeleteTxFuture = thirdDeleteTx.submit();
         assertCommitSuccessful(thirdDeleteTxFuture);
@@ -132,6 +132,7 @@ public class DOMTransactionChainTest {
         listener.getSuccessFuture().get(1000, TimeUnit.MILLISECONDS);
     }
 
+    @SuppressWarnings("checkstyle:IllegalCatch")
     @Test
     public void testTransactionChainNotSealed() throws InterruptedException, ExecutionException, TimeoutException {
         final BlockingTransactionChainListener listener = new BlockingTransactionChainListener();
@@ -140,8 +141,6 @@ public class DOMTransactionChainTest {
 
         /**
          * We alocate new read-write transaction and write /test
-         *
-         *
          */
         allocateAndWrite(txChain);
 
@@ -180,9 +179,10 @@ public class DOMTransactionChainTest {
         future.get();
     }
 
-    private static void assertTestContainerExists(final DOMDataTreeReadTransaction readTx) throws InterruptedException,
-            ExecutionException {
-        final ListenableFuture<Optional<NormalizedNode<?, ?>>> readFuture = readTx.read(OPERATIONAL, TestModel.TEST_PATH);
+    private static void assertTestContainerExists(final DOMDataTreeReadTransaction readTx)
+            throws InterruptedException, ExecutionException {
+        final ListenableFuture<Optional<NormalizedNode<?, ?>>> readFuture =
+                readTx.read(OPERATIONAL, TestModel.TEST_PATH);
         final Optional<NormalizedNode<?, ?>> readedData = readFuture.get();
         assertTrue(readedData.isPresent());
     }
index 0536cb620c522445cbfc7a77c53df422c318957b..f155f97bde3eb0b9267625a69a3d41a3d377a953 100644 (file)
@@ -45,11 +45,11 @@ public class GlobalDOMRpcRoutingTableEntryTest extends TestUtils {
         assertTrue(globalDOMRpcRoutingTableEntry.newInstance(rpcImplementations).getImplementations().containsValue(
                 rpcImplementation));
 
-        try{
+        try {
             globalDOMRpcRoutingTableEntry.newInstance(rpcImplementations)
                     .invokeRpc(TEST_CONTAINER).checkedGet();
             fail("Expected DOMRpcImplementationNotAvailableException");
-        }catch(DOMRpcImplementationNotAvailableException e){
+        } catch (DOMRpcImplementationNotAvailableException e) {
             assertTrue(e.getMessage().contains(EXCEPTION_TEXT));
         }
     }
index 67194f9505a2667644bc4b09b8dfed681244c497..02c04ad785af39e9c014e4cad02ab642fbf72acd 100644 (file)
@@ -22,6 +22,7 @@ import org.opendaylight.yangtools.yang.model.api.SchemaPath;
 
 public class RoutedDOMRpcRoutingTableEntryTest extends TestUtils {
 
+    @SuppressWarnings("checkstyle:IllegalCatch")
     @Test
     public void basicTest() throws Exception {
         final RpcDefinition rpcDefinition = mock(RpcDefinition.class);
index 83996f6cf1188e90376f98d087d7f3f6c1c16302..46ab94cc36795f0cd4fe4e8f84fb26c30db2e6a3 100644 (file)
@@ -117,7 +117,7 @@ public class ShardedDOMDataTreeProducerMultiShardTest {
         dataTreeService = dataTree;
     }
 
-    @Test(expected=IllegalStateException.class)
+    @Test(expected = IllegalStateException.class)
     public void testTxReadyMultiples() throws Exception {
         final DOMDataTreeShardProducer producer = rootShard.createProducer(Collections.singletonList(TEST_ID));
         final DOMDataTreeShardWriteTransaction transaction = producer.createTransaction();
@@ -132,7 +132,7 @@ public class ShardedDOMDataTreeProducerMultiShardTest {
         transaction.ready();
     }
 
-    @Test(expected=IllegalStateException.class)
+    @Test(expected = IllegalStateException.class)
     public void testSubmitUnclosedCursor() throws Exception {
         final DOMDataTreeShardProducer producer = rootShard.createProducer(Collections.singletonList(TEST_ID));
         final DOMDataTreeShardWriteTransaction transaction = producer.createTransaction();
@@ -151,7 +151,8 @@ public class ShardedDOMDataTreeProducerMultiShardTest {
         final DOMDataTreeListener mockedDataTreeListener = Mockito.mock(DOMDataTreeListener.class);
         doNothing().when(mockedDataTreeListener).onDataTreeChanged(anyCollection(), anyMap());
 
-        dataTreeService.registerListener(mockedDataTreeListener, Collections.singletonList(INNER_CONTAINER_ID), true, Collections.emptyList());
+        dataTreeService.registerListener(mockedDataTreeListener, Collections.singletonList(INNER_CONTAINER_ID),
+                true, Collections.emptyList());
 
         final DOMDataTreeShardProducer producer = rootShard.createProducer(Collections.singletonList(TEST_ID));
         final DOMDataTreeShardWriteTransaction transaction = producer.createTransaction();
@@ -179,11 +180,13 @@ public class ShardedDOMDataTreeProducerMultiShardTest {
         transaction.ready();
         transaction.submit();
 
-        verify(mockedDataTreeListener, timeout(1000).times(2)).onDataTreeChanged(captorForChanges.capture(), captorForSubtrees.capture());
+        verify(mockedDataTreeListener, timeout(1000).times(2)).onDataTreeChanged(
+                captorForChanges.capture(), captorForSubtrees.capture());
         final Collection<DataTreeCandidate> capturedValue = captorForChanges.getValue();
         assertTrue(capturedValue.size() == 1);
 
-        final ContainerNode dataAfter = (ContainerNode) capturedValue.iterator().next().getRootNode().getDataAfter().get();
+        final ContainerNode dataAfter =
+                (ContainerNode) capturedValue.iterator().next().getRootNode().getDataAfter().get();
         assertEquals(innerContainer, dataAfter);
         verifyNoMoreInteractions(mockedDataTreeListener);
     }
@@ -193,23 +196,28 @@ public class ShardedDOMDataTreeProducerMultiShardTest {
         final DOMDataTreeListener mockedDataTreeListener = Mockito.mock(DOMDataTreeListener.class);
         doNothing().when(mockedDataTreeListener).onDataTreeChanged(anyCollection(), anyMap());
 
-        dataTreeService.registerListener(mockedDataTreeListener, Collections.singletonList(INNER_CONTAINER_ID), true, Collections.emptyList());
+        dataTreeService.registerListener(mockedDataTreeListener, Collections.singletonList(INNER_CONTAINER_ID), true,
+                Collections.emptyList());
 
         final DOMDataTreeShardProducer producer = rootShard.createProducer(Collections.singletonList(TEST_ID));
         final DOMDataTreeShardWriteTransaction transaction = producer.createTransaction();
         writeCrossShardContainer(transaction);
 
-        verify(mockedDataTreeListener, timeout(1000).times(2)).onDataTreeChanged(captorForChanges.capture(), captorForSubtrees.capture());
+        verify(mockedDataTreeListener, timeout(1000).times(2)).onDataTreeChanged(
+                captorForChanges.capture(), captorForSubtrees.capture());
         final Collection<DataTreeCandidate> capturedValue = captorForChanges.getValue();
         assertTrue(capturedValue.size() == 1);
 
-        final ContainerNode dataAfter = (ContainerNode) capturedValue.iterator().next().getRootNode().getDataAfter().get();
-        assertEquals(crossShardContainer.getChild(TestModel.INNER_CONTAINER_PATH.getLastPathArgument()).get(), dataAfter);
+        final ContainerNode dataAfter =
+                (ContainerNode) capturedValue.iterator().next().getRootNode().getDataAfter().get();
+        assertEquals(crossShardContainer.getChild(
+                TestModel.INNER_CONTAINER_PATH.getLastPathArgument()).get(), dataAfter);
 
         final Map<DOMDataTreeIdentifier, NormalizedNode<?, ?>> capturedSubtrees = captorForSubtrees.getValue();
         assertTrue(capturedSubtrees.size() == 1);
         assertTrue(capturedSubtrees.containsKey(INNER_CONTAINER_ID));
-        assertEquals(crossShardContainer.getChild(TestModel.INNER_CONTAINER_PATH.getLastPathArgument()).get(), capturedSubtrees.get(INNER_CONTAINER_ID));
+        assertEquals(crossShardContainer.getChild(TestModel.INNER_CONTAINER_PATH.getLastPathArgument()).get(),
+                capturedSubtrees.get(INNER_CONTAINER_ID));
 
         verifyNoMoreInteractions(mockedDataTreeListener);
     }
@@ -221,11 +229,13 @@ public class ShardedDOMDataTreeProducerMultiShardTest {
 
         final InMemoryDOMDataTreeShard innerShard = InMemoryDOMDataTreeShard.create(INNER_CONTAINER_ID, executor, 1);
         innerShard.onGlobalContextUpdated(schemaContext);
-        final DOMDataTreeProducer shardRegProducer = dataTreeService.createProducer(Collections.singletonList(INNER_CONTAINER_ID));
+        final DOMDataTreeProducer shardRegProducer =
+                dataTreeService.createProducer(Collections.singletonList(INNER_CONTAINER_ID));
         innerShardReg = dataTreeService.registerDataTreeShard(INNER_CONTAINER_ID, innerShard, shardRegProducer);
         shardRegProducer.close();
 
-        dataTreeService.registerListener(mockedDataTreeListener, Collections.singletonList(TEST_ID), true, Collections.emptyList());
+        dataTreeService.registerListener(mockedDataTreeListener, Collections.singletonList(TEST_ID),
+                true, Collections.emptyList());
 
         final DOMDataTreeShardProducer producer = rootShard.createProducer(Collections.singletonList(TEST_ID));
         final DOMDataTreeShardWriteTransaction transaction = producer.createTransaction();
@@ -236,9 +246,11 @@ public class ShardedDOMDataTreeProducerMultiShardTest {
                 .build();
 
         //verify listeners have been notified
-        verify(mockedDataTreeListener, timeout(1000).times(4)).onDataTreeChanged(captorForChanges.capture(), captorForSubtrees.capture());
+        verify(mockedDataTreeListener, timeout(1000).times(4)).onDataTreeChanged(
+                captorForChanges.capture(), captorForSubtrees.capture());
         final List<Collection<DataTreeCandidate>> capturedChanges = captorForChanges.getAllValues();
-        final List<Map<DOMDataTreeIdentifier, NormalizedNode<?, ?>>> capturedSubtrees = captorForSubtrees.getAllValues();
+        final List<Map<DOMDataTreeIdentifier, NormalizedNode<?, ?>>> capturedSubtrees =
+                captorForSubtrees.getAllValues();
         final DataTreeCandidate firstNotificationCandidate = capturedChanges.get(2).iterator().next();
 
         assertTrue(capturedSubtrees.get(2).size() == 1);
@@ -258,7 +270,8 @@ public class ShardedDOMDataTreeProducerMultiShardTest {
         final DOMDataTreeListener mockedDataTreeListener = Mockito.mock(DOMDataTreeListener.class);
         doNothing().when(mockedDataTreeListener).onDataTreeChanged(anyCollection(), anyMap());
 
-        dataTreeService.registerListener(mockedDataTreeListener, Collections.singletonList(INNER_CONTAINER_ID), true, Collections.emptyList());
+        dataTreeService.registerListener(mockedDataTreeListener, Collections.singletonList(INNER_CONTAINER_ID),
+                true, Collections.emptyList());
 
         final DOMDataTreeShardProducer producer = rootShard.createProducer(Collections.singletonList(TEST_ID));
         final DOMDataTreeShardWriteTransaction transaction = producer.createTransaction();
@@ -288,11 +301,14 @@ public class ShardedDOMDataTreeProducerMultiShardTest {
         cursor.enter(TestModel.TEST_PATH.getLastPathArgument());
 
         final LeafNode<String> shardedValue1 =
-                ImmutableLeafNodeBuilder.<String>create().withNodeIdentifier(new NodeIdentifier(TestModel.SHARDED_VALUE_1)).withValue("sharded value 1").build();
+                ImmutableLeafNodeBuilder.<String>create().withNodeIdentifier(
+                        new NodeIdentifier(TestModel.SHARDED_VALUE_1)).withValue("sharded value 1").build();
         final LeafNode<String> shardedValue2 =
-                ImmutableLeafNodeBuilder.<String>create().withNodeIdentifier(new NodeIdentifier(TestModel.SHARDED_VALUE_2)).withValue("sharded value 2").build();
+                ImmutableLeafNodeBuilder.<String>create().withNodeIdentifier(
+                        new NodeIdentifier(TestModel.SHARDED_VALUE_2)).withValue("sharded value 2").build();
 
-        final DataContainerNodeAttrBuilder<NodeIdentifier, ContainerNode> containerNodeBuilder = ImmutableContainerNodeBuilder.create();
+        final DataContainerNodeAttrBuilder<NodeIdentifier, ContainerNode> containerNodeBuilder =
+                ImmutableContainerNodeBuilder.create();
         final ContainerNode containerNode =
                 containerNodeBuilder
                         .withNodeIdentifier(new NodeIdentifier(TestModel.INNER_CONTAINER))
@@ -318,7 +334,8 @@ public class ShardedDOMDataTreeProducerMultiShardTest {
 
         final ContainerNode lowerShardContainer = ImmutableContainerNodeBuilder.create()
                 .withNodeIdentifier(new NodeIdentifier(TestModel.ANOTHER_SHARD_CONTAINER))
-                .withChild(ImmutableLeafNodeBuilder.create().withNodeIdentifier(new NodeIdentifier(TestModel.ANOTHER_SHARD_VALUE)).build())
+                .withChild(ImmutableLeafNodeBuilder.create().withNodeIdentifier(
+                        new NodeIdentifier(TestModel.ANOTHER_SHARD_VALUE)).build())
                 .build();
 
         cursor.write(TestModel.ANOTHER_SHARD_PATH.getLastPathArgument(), lowerShardContainer);
@@ -336,9 +353,11 @@ public class ShardedDOMDataTreeProducerMultiShardTest {
 
     private ContainerNode createCrossShardContainer() {
         final LeafNode<String> shardedValue1 =
-                ImmutableLeafNodeBuilder.<String>create().withNodeIdentifier(new NodeIdentifier(TestModel.SHARDED_VALUE_1)).withValue("sharded value 1").build();
+                ImmutableLeafNodeBuilder.<String>create().withNodeIdentifier(
+                        new NodeIdentifier(TestModel.SHARDED_VALUE_1)).withValue("sharded value 1").build();
         final LeafNode<String> shardedValue2 =
-                ImmutableLeafNodeBuilder.<String>create().withNodeIdentifier(new NodeIdentifier(TestModel.SHARDED_VALUE_2)).withValue("sharded value 2").build();
+                ImmutableLeafNodeBuilder.<String>create().withNodeIdentifier(new NodeIdentifier(
+                        TestModel.SHARDED_VALUE_2)).withValue("sharded value 2").build();
 
 
         final ContainerNode lowerShardContainer = ImmutableContainerNodeBuilder.create()
@@ -365,7 +384,7 @@ public class ShardedDOMDataTreeProducerMultiShardTest {
         return testContainer;
     }
 
-    private void writeCrossShardContainer(final DOMDataTreeShardWriteTransaction transaction) throws Exception{
+    private void writeCrossShardContainer(final DOMDataTreeShardWriteTransaction transaction) throws Exception {
         final DOMDataTreeWriteCursor cursor = transaction.createCursor(ROOT_ID);
 
         cursor.write(TestModel.TEST_PATH.getLastPathArgument(), crossShardContainer);
index b1c48761ee2b9a59f9eadd13df1e9b4d29eb6ddf..73208c5177d622adef021575413cc23521dec98b 100644 (file)
@@ -74,7 +74,8 @@ public class ShardedDOMDataTreeShardTest {
     @Test
     public void attachAndRemoveShard() throws DOMDataTreeShardingConflictException {
         doNothing().when(rootShard).onChildAttached(TEST_ID, childShard);
-        final ListenerRegistration<DOMDataTreeShard> reg = shardingService.registerDataTreeShard(TEST_ID, childShard, testProducer);
+        final ListenerRegistration<DOMDataTreeShard> reg =
+                shardingService.registerDataTreeShard(TEST_ID, childShard, testProducer);
         verify(rootShard, times(1)).onChildAttached(TEST_ID, childShard);
 
         doNothing().when(rootShard).onChildDetached(TEST_ID, childShard);
index 6cc21b8d0575cc74c256393402e887a9bdbf7411..35611e94a6ce9e94b21d5b899754ed669ea31fcf 100644 (file)
@@ -123,8 +123,10 @@ public class ShardedDOMDataTreeTest {
 
         final InMemoryDOMDataTreeShard innerShard = InMemoryDOMDataTreeShard.create(INNER_CONTAINER_ID, executor, 1);
         innerShard.onGlobalContextUpdated(schemaContext);
-        final DOMDataTreeProducer shardRegProducer2 = dataTreeService.createProducer(Collections.singletonList(INNER_CONTAINER_ID));
-        ListenerRegistration<InMemoryDOMDataTreeShard> innerShardReg = dataTreeService.registerDataTreeShard(INNER_CONTAINER_ID, innerShard, shardRegProducer2);
+        final DOMDataTreeProducer shardRegProducer2 =
+                dataTreeService.createProducer(Collections.singletonList(INNER_CONTAINER_ID));
+        ListenerRegistration<InMemoryDOMDataTreeShard> innerShardReg =
+                dataTreeService.registerDataTreeShard(INNER_CONTAINER_ID, innerShard, shardRegProducer2);
 
         innerShardReg.close();
         // try to register the shard again
@@ -146,7 +148,8 @@ public class ShardedDOMDataTreeTest {
         final DOMDataTreeListener mockedDataTreeListener = Mockito.mock(DOMDataTreeListener.class);
         doNothing().when(mockedDataTreeListener).onDataTreeChanged(anyCollection(), anyMap());
 
-        dataTreeService.registerListener(mockedDataTreeListener, Collections.singletonList(INNER_CONTAINER_ID), true, Collections.emptyList());
+        dataTreeService.registerListener(mockedDataTreeListener, Collections.singletonList(INNER_CONTAINER_ID),
+                true, Collections.emptyList());
 
         final DOMDataTreeProducer producer = dataTreeService.createProducer(Collections.singletonList(ROOT_ID));
         DOMDataTreeCursorAwareTransaction tx = producer.createTransaction(false);
@@ -173,12 +176,15 @@ public class ShardedDOMDataTreeTest {
         cursor.close();
         tx.submit().checkedGet();
 
-        verify(mockedDataTreeListener, timeout(1000).times(3)).onDataTreeChanged(captorForChanges.capture(), captorForSubtrees.capture());
+        verify(mockedDataTreeListener, timeout(1000).times(3)).onDataTreeChanged(captorForChanges.capture(),
+                captorForSubtrees.capture());
         final List<Collection<DataTreeCandidate>> capturedValue = captorForChanges.getAllValues();
         assertTrue(capturedValue.size() == 3);
 
-        final ContainerNode capturedChange = (ContainerNode) capturedValue.get(1).iterator().next().getRootNode().getDataAfter().get();
-        final ContainerNode innerContainerVerify = (ContainerNode) crossShardContainer.getChild(TestModel.INNER_CONTAINER_PATH.getLastPathArgument()).get();
+        final ContainerNode capturedChange =
+                (ContainerNode) capturedValue.get(1).iterator().next().getRootNode().getDataAfter().get();
+        final ContainerNode innerContainerVerify = (ContainerNode) crossShardContainer.getChild(
+                TestModel.INNER_CONTAINER_PATH.getLastPathArgument()).get();
         assertEquals(innerContainerVerify, capturedChange);
 
         verifyNoMoreInteractions(mockedDataTreeListener);
@@ -203,7 +209,8 @@ public class ShardedDOMDataTreeTest {
 
         assertTrue(rootTx.cancel());
 
-        final DOMDataTreeProducer innerContainerProducer = rootProducer.createProducer(Collections.singletonList(INNER_CONTAINER_ID));
+        final DOMDataTreeProducer innerContainerProducer = rootProducer.createProducer(
+                Collections.singletonList(INNER_CONTAINER_ID));
 
         rootTx = rootProducer.createTransaction(false);
         try {
@@ -239,9 +246,11 @@ public class ShardedDOMDataTreeTest {
 
     private ContainerNode createCrossShardContainer() {
         final LeafNode<String> shardedValue1 =
-                ImmutableLeafNodeBuilder.<String>create().withNodeIdentifier(new NodeIdentifier(TestModel.SHARDED_VALUE_1)).withValue("sharded value 1").build();
+                ImmutableLeafNodeBuilder.<String>create().withNodeIdentifier(new NodeIdentifier(
+                        TestModel.SHARDED_VALUE_1)).withValue("sharded value 1").build();
         final LeafNode<String> shardedValue2 =
-                ImmutableLeafNodeBuilder.<String>create().withNodeIdentifier(new NodeIdentifier(TestModel.SHARDED_VALUE_2)).withValue("sharded value 2").build();
+                ImmutableLeafNodeBuilder.<String>create().withNodeIdentifier(new NodeIdentifier(
+                        TestModel.SHARDED_VALUE_2)).withValue("sharded value 2").build();
 
 
         final ContainerNode lowerShardContainer = ImmutableContainerNodeBuilder.create()
index dcc81475a6626cdf62c51e88f06c3f2432a75878..c1b21438cc9358d077b9cb2a1fc25670040415f5 100644 (file)
@@ -63,7 +63,8 @@ public class ShardedDOMDataWriteTransactionTest {
 
         final ShardedDOMDataTree shardedDOMDataTree =
                 new ShardedDOMDataTree();
-        final DOMDataTreeProducer shardRegProducer = shardedDOMDataTree.createProducer(Collections.singletonList(ROOT_ID));
+        final DOMDataTreeProducer shardRegProducer = shardedDOMDataTree.createProducer(
+                Collections.singletonList(ROOT_ID));
         shardedDOMDataTree.registerDataTreeShard(ROOT_ID, rootShard, shardRegProducer);
         shardRegProducer.close();
         final YangInstanceIdentifier yangInstanceIdentifier = YangInstanceIdentifier.of(QName.create("test"));
@@ -92,7 +93,8 @@ public class ShardedDOMDataWriteTransactionTest {
 
         cursor.close();
         try {
-            transaction.createCursor(new DOMDataTreeIdentifier(LogicalDatastoreType.CONFIGURATION, YangInstanceIdentifier.EMPTY));
+            transaction.createCursor(new DOMDataTreeIdentifier(LogicalDatastoreType.CONFIGURATION,
+                    YangInstanceIdentifier.EMPTY));
             fail("Should have failed, config ds not available to this tx");
         } catch (final IllegalArgumentException e) {
             assertTrue(e.getMessage().contains("not accessible"));
@@ -102,7 +104,8 @@ public class ShardedDOMDataWriteTransactionTest {
         assertFalse(transaction.cancel());
 
         final DOMDataTreeCursorAwareTransaction newTx = producer.createTransaction(false);
-        assertTrue("Transaction identifier incorrect " + transaction.getIdentifier(), ((String) transaction.getIdentifier()).contains("SHARDED-DOM-"));
+        assertTrue("Transaction identifier incorrect " + transaction.getIdentifier(), (
+                (String) transaction.getIdentifier()).contains("SHARDED-DOM-"));
         assertNotEquals(transaction.getIdentifier(),
                 newTx.getIdentifier());
     }
index 7c643b1d29a14093546acf556665465f25260c1e..35105e89f5af8590bfd3897495282e163a06a2b2 100644 (file)
@@ -58,7 +58,7 @@ public class ShardedDOMReadTransactionAdapterTest {
         @Nonnull
         @Override
         public <T extends DOMDataTreeListener> ListenerRegistration<T>
-        registerListener(@Nonnull final T listener, @Nonnull final Collection<DOMDataTreeIdentifier> subtrees,
+            registerListener(@Nonnull final T listener, @Nonnull final Collection<DOMDataTreeIdentifier> subtrees,
                          final boolean allowRxMerges,
                          @Nonnull final Collection<DOMDataTreeProducer> producers) throws DOMDataTreeLoopException {
             final Map<DOMDataTreeIdentifier, NormalizedNode<?, ?>> subtree = Maps.newHashMap();
index df6709ad9a2648870dc6fb42a48bc810a86ddb9f..47ffb164f56a48fc16c445873d76681bc9d2eb31 100644 (file)
@@ -16,11 +16,10 @@ public enum TestCommitCohort implements DOMStoreThreePhaseCommitCohort {
 
     ALLWAYS_SUCCESS(true, true, true, true), CAN_COMMIT_FAILED(false, false, false, true), PRE_COMMIT_FAILED(true,
             false, false, true), COMMIT_FAILED(true, true, false, true);
-    ;
 
 
-
-    private TestCommitCohort(final boolean canCommit, final boolean preCommit, final boolean commit, final boolean abort) {
+    TestCommitCohort(final boolean canCommit, final boolean preCommit,
+            final boolean commit, final boolean abort) {
         this.canCommit = Futures.immediateFuture(canCommit);
         this.preCommit = immediate(canCommit, new IllegalStateException());
         this.commit = immediate(commit, new IllegalStateException());
@@ -53,8 +52,8 @@ public enum TestCommitCohort implements DOMStoreThreePhaseCommitCohort {
         return commit;
     }
 
-    private static ListenableFuture<Void> immediate(final boolean isSuccess, final Exception e) {
-        return isSuccess ? Futures.<Void>immediateFuture(null) : Futures.<Void>immediateFailedFuture(e);
+    private static ListenableFuture<Void> immediate(final boolean isSuccess, final Exception except) {
+        return isSuccess ? Futures.<Void>immediateFuture(null) : Futures.<Void>immediateFailedFuture(except);
     }
 
 
index 08ff36ec91f9f60bf9f82bb3c98519dce939a585..1a717d51c13a6ff4ddef31be19110212462c62f0 100644 (file)
@@ -40,7 +40,7 @@ abstract class TestUtils {
     private static final QName TOP_LEVEL_LIST_QNAME = QName.create(TOP_QNAME, "top-level-list");
     private static final QName TOP_LEVEL_LIST_KEY_QNAME = QName.create(TOP_QNAME, "name");
 
-    private final static MapEntryNode topLevelListNormalized = ImmutableMapEntryNodeBuilder.create()
+    private static final MapEntryNode TOP_LEVEL_LIST_NODE = ImmutableMapEntryNodeBuilder.create()
             .withNodeIdentifier(
                     new YangInstanceIdentifier.NodeIdentifierWithPredicates(
                             TOP_LEVEL_LIST_QNAME, TOP_LEVEL_LIST_KEY_QNAME, TOP_LEVEL_LIST_FOO_KEY_VALUE))
@@ -49,7 +49,7 @@ abstract class TestUtils {
 
     private static final DataContainerChild<?, ?> CHILD_LIST = ImmutableNodes.mapNodeBuilder(TestModel.TEST_QNAME)
             .withNodeIdentifier(NodeIdentifier.create(TestModel.TEST_QNAME))
-            .withChild(topLevelListNormalized)
+            .withChild(TOP_LEVEL_LIST_NODE)
             .build();
 
     static final NormalizedNode<?, ?> TEST_CONTAINER = Builders.containerBuilder()
@@ -64,7 +64,7 @@ abstract class TestUtils {
 
     static final String EXCEPTION_TEXT = "TestRpcImplementationException";
 
-    static TestRpcImplementation getTestRpcImplementation(){
+    static TestRpcImplementation getTestRpcImplementation() {
         return new TestRpcImplementation();
     }
 
index ff5905510559e3065fabc920adad3103cc075483..a90cf1404292c23eb12a8dd3ea1ef344b060ae70 100644 (file)
@@ -48,6 +48,7 @@ public class OsgiBundleScanningSchemaServiceTest {
         assertEquals(bundleContext, osgiService.getContext());
     }
 
+    @SuppressWarnings("checkstyle:IllegalCatch")
     @After
     public void destroyInstance() throws Exception {
         try {
index a0751b60bccc83990f50802b1763c15e90b54773..196d2a6205df5700f9e42d125e02a0b75c84d06d 100644 (file)
@@ -62,6 +62,7 @@ public class SchemaServiceActivatorTest {
         verify(osgiBundle).close();
     }
 
+    @SuppressWarnings("checkstyle:IllegalCatch")
     @After
     @Before
     public void destroyInstance() throws Exception {