checkStyleViolationSeverity=error implemented for mdsal-dom-inmemory-datastore 26/45826/1
authorjanab <brinda.jana@nexusis.com>
Fri, 26 Aug 2016 20:18:06 +0000 (13:18 -0700)
committerRobert Varga <rovarga@cisco.com>
Mon, 19 Sep 2016 15:05:03 +0000 (17:05 +0200)
Changed the local variable indVal to index.
An unwanted folder was added accidentally, removed.
Code review comments are implemented.

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

36 files changed:
dom/mdsal-dom-inmemory-datastore/pom.xml
dom/mdsal-dom-inmemory-datastore/src/main/java/org/opendaylight/mdsal/dom/store/inmemory/AbstractDOMShardTreeChangePublisher.java
dom/mdsal-dom-inmemory-datastore/src/main/java/org/opendaylight/mdsal/dom/store/inmemory/ChainedTransactionCommitImpl.java
dom/mdsal-dom-inmemory-datastore/src/main/java/org/opendaylight/mdsal/dom/store/inmemory/DOMDataTreeShardWriteTransaction.java
dom/mdsal-dom-inmemory-datastore/src/main/java/org/opendaylight/mdsal/dom/store/inmemory/DOMStoreTransactionChainImpl.java
dom/mdsal-dom-inmemory-datastore/src/main/java/org/opendaylight/mdsal/dom/store/inmemory/DataTreeModificationCursorAdaptor.java
dom/mdsal-dom-inmemory-datastore/src/main/java/org/opendaylight/mdsal/dom/store/inmemory/DelegatingWriteCursorStrategy.java
dom/mdsal-dom-inmemory-datastore/src/main/java/org/opendaylight/mdsal/dom/store/inmemory/ForeignShardThreePhaseCommitCohort.java
dom/mdsal-dom-inmemory-datastore/src/main/java/org/opendaylight/mdsal/dom/store/inmemory/InMemoryDOMDataStore.java
dom/mdsal-dom-inmemory-datastore/src/main/java/org/opendaylight/mdsal/dom/store/inmemory/InMemoryDOMDataStoreConfigProperties.java
dom/mdsal-dom-inmemory-datastore/src/main/java/org/opendaylight/mdsal/dom/store/inmemory/InMemoryDOMDataStoreFactory.java
dom/mdsal-dom-inmemory-datastore/src/main/java/org/opendaylight/mdsal/dom/store/inmemory/InMemoryDOMDataTreeShard.java
dom/mdsal-dom-inmemory-datastore/src/main/java/org/opendaylight/mdsal/dom/store/inmemory/InMemoryDOMDataTreeShardChangePublisher.java
dom/mdsal-dom-inmemory-datastore/src/main/java/org/opendaylight/mdsal/dom/store/inmemory/InMemoryDOMDataTreeShardThreePhaseCommitCohort.java
dom/mdsal-dom-inmemory-datastore/src/main/java/org/opendaylight/mdsal/dom/store/inmemory/InMemoryDOMStoreThreePhaseCommitCohort.java
dom/mdsal-dom-inmemory-datastore/src/main/java/org/opendaylight/mdsal/dom/store/inmemory/InMemoryDOMStoreTreeChangePublisher.java
dom/mdsal-dom-inmemory-datastore/src/main/java/org/opendaylight/mdsal/dom/store/inmemory/InmemoryDOMDataTreeShardWriteTransaction.java
dom/mdsal-dom-inmemory-datastore/src/main/java/org/opendaylight/mdsal/dom/store/inmemory/ReadableCursorOperation.java
dom/mdsal-dom-inmemory-datastore/src/main/java/org/opendaylight/mdsal/dom/store/inmemory/ReadableWriteableDOMDataTreeShard.java
dom/mdsal-dom-inmemory-datastore/src/main/java/org/opendaylight/mdsal/dom/store/inmemory/ShardCanCommitCoordinationTask.java
dom/mdsal-dom-inmemory-datastore/src/main/java/org/opendaylight/mdsal/dom/store/inmemory/ShardCommitCoordinationTask.java
dom/mdsal-dom-inmemory-datastore/src/main/java/org/opendaylight/mdsal/dom/store/inmemory/ShardDataModificationBuilder.java
dom/mdsal-dom-inmemory-datastore/src/main/java/org/opendaylight/mdsal/dom/store/inmemory/ShardDataModificationCursor.java
dom/mdsal-dom-inmemory-datastore/src/main/java/org/opendaylight/mdsal/dom/store/inmemory/ShardPreCommitCoordinationTask.java
dom/mdsal-dom-inmemory-datastore/src/main/java/org/opendaylight/mdsal/dom/store/inmemory/WritableInteriorNode.java
dom/mdsal-dom-inmemory-datastore/src/main/java/org/opendaylight/mdsal/dom/store/inmemory/WriteCursorStrategy.java
dom/mdsal-dom-inmemory-datastore/src/main/java/org/opendaylight/mdsal/dom/store/inmemory/WriteableModificationNode.java
dom/mdsal-dom-inmemory-datastore/src/main/java/org/opendaylight/mdsal/dom/store/inmemory/WriteableNodeWithSubshard.java
dom/mdsal-dom-inmemory-datastore/src/test/java/org/opendaylight/controller/md/sal/dom/store/impl/InMemoryDataStoreTest.java
dom/mdsal-dom-inmemory-datastore/src/test/java/org/opendaylight/controller/md/sal/dom/store/impl/SchemaUpdateForTransactionTest.java
dom/mdsal-dom-inmemory-datastore/src/test/java/org/opendaylight/controller/md/sal/dom/store/impl/TestDCLExecutorService.java
dom/mdsal-dom-inmemory-datastore/src/test/java/org/opendaylight/mdsal/dom/store/inmemory/AbstractDOMShardTreeChangePublisherTest.java
dom/mdsal-dom-inmemory-datastore/src/test/java/org/opendaylight/mdsal/dom/store/inmemory/InMemoryDOMStoreThreePhaseCommitCohortTest.java
dom/mdsal-dom-inmemory-datastore/src/test/java/org/opendaylight/mdsal/dom/store/inmemory/InmemoryDOMDataTreeShardWriteTransactionTest.java
dom/mdsal-dom-inmemory-datastore/src/test/java/org/opendaylight/mdsal/dom/store/inmemory/ShardSubmitCoordinationTaskTest.java
dom/mdsal-dom-inmemory-datastore/src/test/java/org/opendaylight/mdsal/dom/store/inmemory/WriteableNodeOperationTest.java

index f0ad67544c6042bc419da951f232c6941864760e..1e3857510cf5368688ccfe04cea29e81abdce347 100644 (file)
         <artifactId>maven-bundle-plugin</artifactId>
         <extensions>true</extensions>
       </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 307c8ca2086122d7a78fc74318f53dc66a48e8a0..1cfea3463eae969eb465b33f020a501077c374c0 100644 (file)
@@ -46,7 +46,8 @@ import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableMa
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-abstract class AbstractDOMShardTreeChangePublisher extends AbstractDOMStoreTreeChangePublisher implements DOMStoreTreeChangePublisher {
+abstract class AbstractDOMShardTreeChangePublisher extends AbstractDOMStoreTreeChangePublisher
+        implements DOMStoreTreeChangePublisher {
 
     private static final Logger LOG = LoggerFactory.getLogger(AbstractDOMShardTreeChangePublisher.class);
 
@@ -63,7 +64,8 @@ abstract class AbstractDOMShardTreeChangePublisher extends AbstractDOMStoreTreeC
     }
 
     @Override
-    public <L extends DOMDataTreeChangeListener> AbstractDOMDataTreeChangeListenerRegistration<L> registerTreeChangeListener(final YangInstanceIdentifier path, final L listener) {
+    public <L extends DOMDataTreeChangeListener> AbstractDOMDataTreeChangeListenerRegistration<L>
+            registerTreeChangeListener(final YangInstanceIdentifier path, final L listener) {
         takeLock();
         try {
             return setupListenerContext(path, listener);
@@ -72,7 +74,8 @@ abstract class AbstractDOMShardTreeChangePublisher extends AbstractDOMStoreTreeC
         }
     }
 
-    private <L extends DOMDataTreeChangeListener> AbstractDOMDataTreeChangeListenerRegistration<L> setupListenerContext(final YangInstanceIdentifier listenerPath, final L listener) {
+    private <L extends DOMDataTreeChangeListener> AbstractDOMDataTreeChangeListenerRegistration<L>
+            setupListenerContext(final YangInstanceIdentifier listenerPath, final L listener) {
         // we need to register the listener registration path based on the shards root
         // we have to strip the shard path from the listener path and then register
         YangInstanceIdentifier strippedIdentifier = listenerPath;
@@ -80,8 +83,10 @@ abstract class AbstractDOMShardTreeChangePublisher extends AbstractDOMStoreTreeC
             strippedIdentifier = YangInstanceIdentifier.create(stripShardPath(listenerPath));
         }
 
-        final DOMDataTreeListenerWithSubshards subshardListener = new DOMDataTreeListenerWithSubshards(dataTree, strippedIdentifier, listener);
-        final AbstractDOMDataTreeChangeListenerRegistration<L> reg = setupContextWithoutSubshards(strippedIdentifier, subshardListener);
+        final DOMDataTreeListenerWithSubshards subshardListener =
+                new DOMDataTreeListenerWithSubshards(dataTree, strippedIdentifier, listener);
+        final AbstractDOMDataTreeChangeListenerRegistration<L> reg =
+                setupContextWithoutSubshards(strippedIdentifier, subshardListener);
 
         for (final ChildShardContext maybeAffected : childShards.values()) {
             if (listenerPath.contains(maybeAffected.getPrefix().getRootIdentifier())) {
@@ -91,8 +96,10 @@ abstract class AbstractDOMShardTreeChangePublisher extends AbstractDOMStoreTreeC
                 subshardListener.addSubshard(maybeAffected);
             } else if (maybeAffected.getPrefix().getRootIdentifier().contains(listenerPath)) {
                 // bind path is inside subshard
-                // TODO can this happen? seems like in ShardedDOMDataTree we are already registering to the lowest shard possible
-                throw new UnsupportedOperationException("Listener should be registered directly into initialDataChangeEvent subshard");
+                // TODO can this happen? seems like in ShardedDOMDataTree we are
+                // already registering to the lowest shard possible
+                throw new UnsupportedOperationException("Listener should be registered directly "
+                        + "into initialDataChangeEvent subshard");
             }
         }
 
@@ -101,7 +108,8 @@ abstract class AbstractDOMShardTreeChangePublisher extends AbstractDOMStoreTreeC
         return reg;
     }
 
-    private <L extends DOMDataTreeChangeListener> void initialDataChangeEvent(final YangInstanceIdentifier listenerPath, final L listener) {
+    private <L extends DOMDataTreeChangeListener> void initialDataChangeEvent(
+            final YangInstanceIdentifier listenerPath, final L listener) {
         // FIXME Add support for wildcard listeners
         final Optional<NormalizedNode<?, ?>> preExistingData = dataTree.takeSnapshot()
                 .readNode(YangInstanceIdentifier.create(stripShardPath(listenerPath)));
@@ -146,10 +154,14 @@ abstract class AbstractDOMShardTreeChangePublisher extends AbstractDOMStoreTreeC
         return nodeBuilder.build();
     }
 
-    private <L extends DOMDataTreeChangeListener> AbstractDOMDataTreeChangeListenerRegistration<L> setupContextWithoutSubshards(final YangInstanceIdentifier listenerPath, final DOMDataTreeListenerWithSubshards listener) {
+    private <L extends DOMDataTreeChangeListener> AbstractDOMDataTreeChangeListenerRegistration<L>
+            setupContextWithoutSubshards(final YangInstanceIdentifier listenerPath,
+                    final DOMDataTreeListenerWithSubshards listener) {
         LOG.debug("Registering root listener at {}", listenerPath);
-        final RegistrationTreeNode<AbstractDOMDataTreeChangeListenerRegistration<?>> node = findNodeFor(listenerPath.getPathArguments());
-        final AbstractDOMDataTreeChangeListenerRegistration<L> registration = new AbstractDOMDataTreeChangeListenerRegistration<L>((L) listener) {
+        final RegistrationTreeNode<AbstractDOMDataTreeChangeListenerRegistration<?>> node =
+                findNodeFor(listenerPath.getPathArguments());
+        final AbstractDOMDataTreeChangeListenerRegistration<L> registration =
+                new AbstractDOMDataTreeChangeListenerRegistration<L>((L) listener) {
             @Override
             protected void removeRegistration() {
                 listener.close();
@@ -218,8 +230,9 @@ abstract class AbstractDOMShardTreeChangePublisher extends AbstractDOMStoreTreeC
             final DOMStoreTreeChangePublisher listenableShard = (DOMStoreTreeChangePublisher) context.getShard();
             // since this is going into subshard we want to listen for ALL changes in the subshard
             registrations.put(context.getPrefix().getRootIdentifier(),
-                    listenableShard.registerTreeChangeListener(context.getPrefix().getRootIdentifier(),
-                            changes -> onDataTreeChanged(context.getPrefix().getRootIdentifier(), changes)));
+                listenableShard.registerTreeChangeListener(
+                        context.getPrefix().getRootIdentifier(), changes -> onDataTreeChanged(
+                                context.getPrefix().getRootIdentifier(), changes)));
         }
 
         void close() {
index ea7ee15a571844c3d5fa3e4172365bb32994748a..c3c9589ff0ce21efe2d174b7ab82720709bd2f24 100644 (file)
@@ -7,17 +7,17 @@
  */
 package org.opendaylight.mdsal.dom.store.inmemory;
 
-import org.opendaylight.mdsal.dom.spi.store.SnapshotBackedWriteTransaction;
-
 import com.google.common.base.Preconditions;
 import com.google.common.util.concurrent.ListenableFuture;
+import org.opendaylight.mdsal.dom.spi.store.SnapshotBackedWriteTransaction;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeModification;
 
 final class ChainedTransactionCommitImpl extends InMemoryDOMStoreThreePhaseCommitCohort {
     private final DOMStoreTransactionChainImpl txChain;
 
-    ChainedTransactionCommitImpl(final InMemoryDOMDataStore store, final SnapshotBackedWriteTransaction<String> transaction,
-        final DataTreeModification modification, final DOMStoreTransactionChainImpl txChain) {
+    ChainedTransactionCommitImpl(final InMemoryDOMDataStore store,
+        final SnapshotBackedWriteTransaction<String> transaction,final DataTreeModification modification,
+            final DOMStoreTransactionChainImpl txChain) {
         super(store, transaction, modification);
         this.txChain = Preconditions.checkNotNull(txChain);
     }
index 59fa4b0966315a94aebec176c3e5d105d5cd84ff..4ffdf1e9a0fafbd089b8149fc169aa399891c468 100644 (file)
@@ -31,6 +31,7 @@ public interface DOMDataTreeShardWriteTransaction extends DOMDataTreeCursorProvi
     /**
      * Finish this transaction and submit it for processing.
      *
+     *<p>
      * FIXME: this method should accept a callback which will report success/failure. Let's not use a CheckedFuture
      *        due to overhead associated with attaching listeners to them.
      * @throws IllegalStateException if this transaction has an unclosed cursor.
index e21998f551e2ebdbaf9d21dbf4dfa220a13927c8..7650b29a6973af5840bf62d03f18eec6862c753b 100644 (file)
@@ -7,11 +7,10 @@
  */
 package org.opendaylight.mdsal.dom.store.inmemory;
 
+import com.google.common.base.Preconditions;
 import org.opendaylight.mdsal.dom.spi.store.AbstractSnapshotBackedTransactionChain;
 import org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort;
 import org.opendaylight.mdsal.dom.spi.store.SnapshotBackedWriteTransaction;
-
-import com.google.common.base.Preconditions;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeModification;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeSnapshot;
 
@@ -23,7 +22,8 @@ final class DOMStoreTransactionChainImpl extends AbstractSnapshotBackedTransacti
     }
 
     @Override
-    protected DOMStoreThreePhaseCommitCohort createCohort(final SnapshotBackedWriteTransaction<String> tx, final DataTreeModification modification) {
+    protected DOMStoreThreePhaseCommitCohort createCohort(final SnapshotBackedWriteTransaction<String> tx,
+            final DataTreeModification modification) {
         return new ChainedTransactionCommitImpl(store, tx, modification, this);
     }
 
index 0a90f13d422ab4bac1d59578a44880c1a4274dfe..a4986e714d5971b4b83ff786c81cfc4d7dc91007 100644 (file)
@@ -28,7 +28,8 @@ final class DataTreeModificationCursorAdaptor extends ForwardingObject implement
         return new DataTreeModificationCursorAdaptor(dataTreeCursor);
     }
 
-    protected final DataTreeModificationCursor delegate() {
+    @Override
+    protected DataTreeModificationCursor delegate() {
         return delegate;
     }
 
@@ -42,6 +43,16 @@ final class DataTreeModificationCursorAdaptor extends ForwardingObject implement
         delegate.enter(child);
     }
 
+    @Override
+    public void enter(final Iterable<PathArgument> path) {
+        delegate.enter(path);
+    }
+
+    @Override
+    public void enter(final PathArgument... path) {
+        delegate.enter(path);
+    }
+
     @Override
     public void merge(final PathArgument child, final NormalizedNode<?, ?> data) {
         delegate.merge(child, data);
@@ -52,11 +63,6 @@ final class DataTreeModificationCursorAdaptor extends ForwardingObject implement
         delegate.write(child, data);
     }
 
-    @Override
-    public void enter(final Iterable<PathArgument> path) {
-        delegate.enter(path);
-    }
-
     @Override
     public void exit() {
         delegate.exit();
@@ -76,8 +82,4 @@ final class DataTreeModificationCursorAdaptor extends ForwardingObject implement
         delegate.close();
     }
 
-    @Override
-    public void enter(final PathArgument... path) {
-        delegate.enter(path);
-    }
 }
index 3122b00860e42ac1bc7473c7c6aaf08613958f00..e7a9b66e8816579a25a841ebd773bdfc58c02903 100644 (file)
@@ -67,6 +67,7 @@ abstract class DelegatingWriteCursorStrategy extends ForwardingObject implements
      * Operation performed to exit current logical level, default implementation calls
      * {@link DOMDataTreeWriteCursor#exit()} on underlaying cursor.
      *
+     *<p>
      * Subclasses may override this to customize exit strategy.
      *
      */
index 16d4b34e79d937a5a4a1eb1862799a8b9aae8f15..1b16f738fc60b68754b8db437ffa5b85c59da713 100644 (file)
@@ -22,7 +22,8 @@ public class ForeignShardThreePhaseCommitCohort implements DOMStoreThreePhaseCom
     private final DOMDataTreeIdentifier prefix;
     private final ForeignShardModificationContext shard;
 
-    public ForeignShardThreePhaseCommitCohort(final DOMDataTreeIdentifier prefix, final ForeignShardModificationContext shard) {
+    public ForeignShardThreePhaseCommitCohort(final DOMDataTreeIdentifier prefix,
+            final ForeignShardModificationContext shard) {
         this.prefix = prefix;
         this.shard = shard;
     }
index ae7f4c1e39499d3712491f0ced01baeeb2aea5a5..5ebcc8391688320c5107ea388ae3eef98523adf3 100644 (file)
@@ -7,6 +7,11 @@
  */
 package org.opendaylight.mdsal.dom.store.inmemory;
 
+import com.google.common.base.Preconditions;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicLong;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeChangeListener;
 import org.opendaylight.mdsal.dom.spi.store.DOMStore;
 import org.opendaylight.mdsal.dom.spi.store.DOMStoreReadTransaction;
 import org.opendaylight.mdsal.dom.spi.store.DOMStoreReadWriteTransaction;
@@ -17,11 +22,6 @@ import org.opendaylight.mdsal.dom.spi.store.DOMStoreWriteTransaction;
 import org.opendaylight.mdsal.dom.spi.store.SnapshotBackedTransactions;
 import org.opendaylight.mdsal.dom.spi.store.SnapshotBackedWriteTransaction;
 import org.opendaylight.mdsal.dom.spi.store.SnapshotBackedWriteTransaction.TransactionReadyPrototype;
-import org.opendaylight.mdsal.dom.api.DOMDataTreeChangeListener;
-import com.google.common.base.Preconditions;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicLong;
 import org.opendaylight.yangtools.concepts.Identifiable;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.util.ExecutorServiceUtil;
@@ -39,15 +39,17 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * In-memory DOM Data Store
+ * In-memory DOM Data Store.
  *
+ *<p>
  * Implementation of {@link DOMStore} which uses {@link DataTree} and other
  * classes such as {@link SnapshotBackedWriteTransaction}.
  * {@link org.opendaylight.mdsal.dom.spi.store.SnapshotBackedReadTransaction} to implement {@link DOMStore}
  * contract.
  *
  */
-public class InMemoryDOMDataStore extends TransactionReadyPrototype<String> implements DOMStore, Identifiable<String>, SchemaContextListener, AutoCloseable, DOMStoreTreeChangePublisher {
+public class InMemoryDOMDataStore extends TransactionReadyPrototype<String> implements DOMStore,
+        Identifiable<String>, SchemaContextListener, AutoCloseable, DOMStoreTreeChangePublisher {
     private static final Logger LOG = LoggerFactory.getLogger(InMemoryDOMDataStore.class);
 
     private final DataTree dataTree = InMemoryDataTreeFactory.getInstance().create(TreeType.OPERATIONAL);
@@ -61,7 +63,8 @@ public class InMemoryDOMDataStore extends TransactionReadyPrototype<String> impl
     private volatile AutoCloseable closeable;
 
     public InMemoryDOMDataStore(final String name, final ExecutorService dataChangeListenerExecutor) {
-        this(name, dataChangeListenerExecutor, InMemoryDOMDataStoreConfigProperties.DEFAULT_MAX_DATA_CHANGE_LISTENER_QUEUE_SIZE, false);
+        this(name, dataChangeListenerExecutor,
+                InMemoryDOMDataStoreConfigProperties.DEFAULT_MAX_DATA_CHANGE_LISTENER_QUEUE_SIZE, false);
     }
 
     public InMemoryDOMDataStore(final String name, final ExecutorService dataChangeListenerExecutor,
@@ -69,7 +72,8 @@ public class InMemoryDOMDataStore extends TransactionReadyPrototype<String> impl
         this.name = Preconditions.checkNotNull(name);
         this.dataChangeListenerExecutor = Preconditions.checkNotNull(dataChangeListenerExecutor);
         this.debugTransactions = debugTransactions;
-        changePublisher = new InMemoryDOMStoreTreeChangePublisher(this.dataChangeListenerExecutor, maxDataChangeListenerQueueSize);
+        changePublisher = new InMemoryDOMStoreTreeChangePublisher(this.dataChangeListenerExecutor,
+                maxDataChangeListenerQueueSize);
     }
 
     public void setCloseable(final AutoCloseable closeable) {
@@ -83,17 +87,20 @@ public class InMemoryDOMDataStore extends TransactionReadyPrototype<String> impl
 
     @Override
     public DOMStoreReadTransaction newReadOnlyTransaction() {
-        return SnapshotBackedTransactions.newReadTransaction(nextIdentifier(), debugTransactions, dataTree.takeSnapshot());
+        return SnapshotBackedTransactions.newReadTransaction(
+                nextIdentifier(),debugTransactions, dataTree.takeSnapshot());
     }
 
     @Override
     public DOMStoreReadWriteTransaction newReadWriteTransaction() {
-        return SnapshotBackedTransactions.newReadWriteTransaction(nextIdentifier(), debugTransactions, dataTree.takeSnapshot(), this);
+        return SnapshotBackedTransactions.newReadWriteTransaction(nextIdentifier(),
+                debugTransactions, dataTree.takeSnapshot(), this);
     }
 
     @Override
     public DOMStoreWriteTransaction newWriteOnlyTransaction() {
-        return SnapshotBackedTransactions.newWriteTransaction(nextIdentifier(), debugTransactions, dataTree.takeSnapshot(), this);
+        return SnapshotBackedTransactions.newWriteTransaction(nextIdentifier(),
+                debugTransactions, dataTree.takeSnapshot(), this);
     }
 
     @Override
@@ -106,14 +113,15 @@ public class InMemoryDOMDataStore extends TransactionReadyPrototype<String> impl
         dataTree.setSchemaContext(ctx);
     }
 
+    @SuppressWarnings("checkstyle:IllegalCatch")
     @Override
     public void close() {
         ExecutorServiceUtil.tryGracefulShutdown(dataChangeListenerExecutor, 30, TimeUnit.SECONDS);
 
-        if(closeable != null) {
+        if (closeable != null) {
             try {
                 closeable.close();
-            } catch(Exception e) {
+            } catch (Exception e) {
                 LOG.debug("Error closing instance", e);
             }
         }
@@ -128,7 +136,8 @@ public class InMemoryDOMDataStore extends TransactionReadyPrototype<String> impl
     }
 
     @Override
-    public synchronized <L extends DOMDataTreeChangeListener> ListenerRegistration<L> registerTreeChangeListener(final YangInstanceIdentifier treeId, final L listener) {
+    public synchronized <L extends DOMDataTreeChangeListener> ListenerRegistration<L> registerTreeChangeListener(
+            final YangInstanceIdentifier treeId, final L listener) {
         /*
          * Make sure commit is not occurring right now. Listener has to be
          * registered and its state capture enqueued at a consistent point.
@@ -142,7 +151,8 @@ public class InMemoryDOMDataStore extends TransactionReadyPrototype<String> impl
     }
 
     @Override
-    protected DOMStoreThreePhaseCommitCohort transactionReady(final SnapshotBackedWriteTransaction<String> tx, final DataTreeModification modification) {
+    protected DOMStoreThreePhaseCommitCohort transactionReady(final SnapshotBackedWriteTransaction<String> tx,
+            final DataTreeModification modification) {
         LOG.debug("Tx: {} is submitted. Modifications: {}", tx.getIdentifier(), modification);
         return new InMemoryDOMStoreThreePhaseCommitCohort(this, tx, modification);
     }
index 4fb3ecee46285b54b47f625faa58b682a4a307c9..9c68a1bcc630097e307126b391a4d7911664a3e3 100644 (file)
@@ -10,7 +10,7 @@ package org.opendaylight.mdsal.dom.store.inmemory;
 
 /**
  * Holds configuration properties when creating an {@link InMemoryDOMDataStore} instance via the
- * {@link InMemoryDOMDataStoreFactory}
+ * {@link InMemoryDOMDataStoreFactory}.
  *
  * @author Thomas Pantelis
  * @see InMemoryDOMDataStoreFactory
index 0ebe8019777886919cd370251b3623ed580ad920..8b278ec93b26ea47ad596852d5bd7bcdd9cdf4bc 100644 (file)
@@ -7,10 +7,9 @@
  */
 package org.opendaylight.mdsal.dom.store.inmemory;
 
-import org.opendaylight.mdsal.dom.api.DOMSchemaService;
-
 import java.util.concurrent.ExecutorService;
 import javax.annotation.Nullable;
+import org.opendaylight.mdsal.dom.api.DOMSchemaService;
 import org.opendaylight.yangtools.util.concurrent.SpecialExecutors;
 
 /**
index f518346daad47f84cf1ac26bcc1e3d05fcdc76f1..575c95d62a6751285900c32adbb9766b385f097b 100644 (file)
@@ -42,6 +42,7 @@ public class InMemoryDOMDataTreeShard implements ReadableWriteableDOMDataTreeSha
     private static final class SubshardProducerSpecification {
         private final Collection<DOMDataTreeIdentifier> prefixes = new ArrayList<>(1);
         private final ChildShardContext shard;
+
         SubshardProducerSpecification(final ChildShardContext subshard) {
             this.shard = Preconditions.checkNotNull(subshard);
         }
@@ -73,12 +74,13 @@ public class InMemoryDOMDataTreeShard implements ReadableWriteableDOMDataTreeSha
         final TreeType treeType = treeTypeFor(prefix.getDatastoreType());
         this.dataTree = InMemoryDataTreeFactory.getInstance().create(treeType, prefix.getRootIdentifier());
 
-        this.shardChangePublisher = new InMemoryDOMDataTreeShardChangePublisher(dataTreeChangeExecutor, maxDataChangeListenerQueueSize, dataTree, prefix.getRootIdentifier(), childShards);
+        this.shardChangePublisher = new InMemoryDOMDataTreeShardChangePublisher(dataTreeChangeExecutor,
+                maxDataChangeListenerQueueSize, dataTree, prefix.getRootIdentifier(), childShards);
         this.executor = MoreExecutors.listeningDecorator(Executors.newSingleThreadExecutor());
     }
 
-    public static InMemoryDOMDataTreeShard create(final DOMDataTreeIdentifier id, final ExecutorService dataTreeChangeExecutor,
-                                                  final int maxDataChangeListenerQueueSize) {
+    public static InMemoryDOMDataTreeShard create(final DOMDataTreeIdentifier id,
+            final ExecutorService dataTreeChangeExecutor, final int maxDataChangeListenerQueueSize) {
         return new InMemoryDOMDataTreeShard(id, dataTreeChangeExecutor, maxDataChangeListenerQueueSize);
     }
 
@@ -111,7 +113,8 @@ public class InMemoryDOMDataTreeShard implements ReadableWriteableDOMDataTreeSha
 
     @Nonnull
     @Override
-    public <L extends DOMDataTreeChangeListener> ListenerRegistration<L> registerTreeChangeListener(@Nonnull final YangInstanceIdentifier treeId, @Nonnull final L listener) {
+    public <L extends DOMDataTreeChangeListener> ListenerRegistration<L> registerTreeChangeListener(
+            @Nonnull final YangInstanceIdentifier treeId, @Nonnull final L listener) {
         return shardChangePublisher.registerTreeChangeListener(treeId, listener);
     }
 
@@ -122,7 +125,8 @@ public class InMemoryDOMDataTreeShard implements ReadableWriteableDOMDataTreeSha
     }
 
     private void reparentChildShards(final DOMDataTreeIdentifier newChildPrefix, final DOMDataTreeShard newChild) {
-        final Iterator<Entry<DOMDataTreeIdentifier, ChildShardContext>> actualChildren = childShards.entrySet().iterator();
+        final Iterator<Entry<DOMDataTreeIdentifier, ChildShardContext>> actualChildren =
+                childShards.entrySet().iterator();
         final Map<DOMDataTreeIdentifier, ChildShardContext> reparented = new HashMap<>();
         while (actualChildren.hasNext()) {
             final Entry<DOMDataTreeIdentifier, ChildShardContext> actualChild = actualChildren.next();
@@ -149,7 +153,8 @@ public class InMemoryDOMDataTreeShard implements ReadableWriteableDOMDataTreeSha
         throw new UnsupportedOperationException();
     }
 
-    private static ChildShardContext createContextFor(final DOMDataTreeIdentifier prefix, final DOMDataTreeShard child) {
+    private static ChildShardContext createContextFor(final DOMDataTreeIdentifier prefix,
+            final DOMDataTreeShard child) {
         Preconditions.checkArgument(child instanceof WriteableDOMDataTreeShard,
             "Child %s is not a writable shared", child);
         return new ChildShardContext(prefix, (WriteableDOMDataTreeShard) child);
@@ -175,7 +180,8 @@ public class InMemoryDOMDataTreeShard implements ReadableWriteableDOMDataTreeSha
         return ret;
     }
 
-    InmemoryDOMDataTreeShardWriteTransaction createTransaction(final InmemoryDOMDataTreeShardWriteTransaction previousTx) {
+    InmemoryDOMDataTreeShardWriteTransaction createTransaction(
+            final InmemoryDOMDataTreeShardWriteTransaction previousTx) {
         // FIXME: implement this
         throw new UnsupportedOperationException();
     }
index 8c6b8be4503b8334b42bf7899435bcf67badbec8..8f6bfbdf7949644784287432ca196ffe19ab286b 100644 (file)
@@ -30,15 +30,16 @@ final class InMemoryDOMDataTreeShardChangePublisher extends AbstractDOMShardTree
 
     private static final Logger LOG = LoggerFactory.getLogger(InMemoryDOMDataTreeShardChangePublisher.class);
 
-    private static final Invoker<AbstractDOMDataTreeChangeListenerRegistration<?>, DataTreeCandidate> MANAGER_INVOKER =
-            (listener, notification) -> {
-                final DOMDataTreeChangeListener inst = listener.getInstance();
-                if (inst != null) {
-                    inst.onDataTreeChanged(ImmutableList.of(notification));
-                }
-            };
+    private static final Invoker<AbstractDOMDataTreeChangeListenerRegistration<?>, DataTreeCandidate>
+        MANAGER_INVOKER = (listener, notification) -> {
+            final DOMDataTreeChangeListener inst = listener.getInstance();
+            if (inst != null) {
+                inst.onDataTreeChanged(ImmutableList.of(notification));
+            }
+        };
 
-    private final QueuedNotificationManager<AbstractDOMDataTreeChangeListenerRegistration<?>, DataTreeCandidate> notificationManager;
+    private final QueuedNotificationManager<AbstractDOMDataTreeChangeListenerRegistration<?>,
+        DataTreeCandidate> notificationManager;
 
     InMemoryDOMDataTreeShardChangePublisher(final ExecutorService executorService,
                                             final int maxQueueSize,
@@ -46,11 +47,13 @@ final class InMemoryDOMDataTreeShardChangePublisher extends AbstractDOMShardTree
                                             final YangInstanceIdentifier rootPath,
                                             final Map<DOMDataTreeIdentifier, ChildShardContext> childShards) {
         super(dataTree, rootPath, childShards);
-        notificationManager = new QueuedNotificationManager<>(executorService, MANAGER_INVOKER, maxQueueSize, "DataTreeChangeListenerQueueMgr");
+        notificationManager = new QueuedNotificationManager<>(
+                executorService, MANAGER_INVOKER, maxQueueSize, "DataTreeChangeListenerQueueMgr");
     }
 
     @Override
-    protected void notifyListeners(@Nonnull final Collection<AbstractDOMDataTreeChangeListenerRegistration<?>> registrations,
+    protected void notifyListeners(
+            @Nonnull final Collection<AbstractDOMDataTreeChangeListenerRegistration<?>> registrations,
                                    @Nonnull final YangInstanceIdentifier path,
                                    @Nonnull final DataTreeCandidateNode node) {
         final DataTreeCandidate candidate = DataTreeCandidates.newDataTreeCandidate(path, node);
@@ -67,7 +70,8 @@ final class InMemoryDOMDataTreeShardChangePublisher extends AbstractDOMShardTree
 
     }
 
-    public <L extends DOMDataTreeChangeListener> AbstractDOMDataTreeChangeListenerRegistration<L> registerTreeChangeListener(YangInstanceIdentifier path, L listener) {
+    public <L extends DOMDataTreeChangeListener> AbstractDOMDataTreeChangeListenerRegistration<L>
+            registerTreeChangeListener(YangInstanceIdentifier path, L listener) {
         return super.registerTreeChangeListener(path, listener);
     }
 
index 5f20089c5cbe2475acc410eb9e8aefee2cb1a542..1f8c9cbcd372d7b0e20d4fa49f2b31035e87a15f 100644 (file)
@@ -11,7 +11,6 @@ package org.opendaylight.mdsal.dom.store.inmemory;
 import com.google.common.base.Preconditions;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
-import java.util.Collections;
 import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
 import org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTree;
@@ -40,6 +39,7 @@ class InMemoryDOMDataTreeShardThreePhaseCommitCohort implements DOMStoreThreePha
         this.changePublisher = Preconditions.checkNotNull(changePublisher);
     }
 
+    @SuppressWarnings("checkstyle:IllegalCatch")
     @Override
     public ListenableFuture<Boolean> canCommit() {
         try {
@@ -51,13 +51,15 @@ class InMemoryDOMDataTreeShardThreePhaseCommitCohort implements DOMStoreThreePha
             LOG.warn("Data validation failed for {}", modification);
             LOG.trace("dataTree : {}", dataTree);
 
-            return Futures.immediateFailedFuture(new TransactionCommitFailedException("Data did not pass validation.", e));
+            return Futures.immediateFailedFuture(new TransactionCommitFailedException(
+                    "Data did not pass validation.", e));
         } catch (Exception e) {
             LOG.warn("Unexpected failure in validation phase", e);
             return Futures.immediateFailedFuture(e);
         }
     }
 
+    @SuppressWarnings("checkstyle:IllegalCatch")
     @Override
     public ListenableFuture<Void> preCommit() {
         try {
index a7843947c01cfea1ff3d4ee71cd475b9baeb1b87..535623352a77d3bfb526e49f37e32b5055f4f422 100644 (file)
@@ -10,15 +10,14 @@ package org.opendaylight.mdsal.dom.store.inmemory;
 
 import static com.google.common.base.Preconditions.checkState;
 
-import org.opendaylight.mdsal.dom.spi.store.AbstractDOMStoreTransaction;
-import org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort;
-import org.opendaylight.mdsal.dom.spi.store.SnapshotBackedWriteTransaction;
-
-import org.opendaylight.mdsal.common.api.OptimisticLockFailedException;
-import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
 import com.google.common.base.Preconditions;
 import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
+import org.opendaylight.mdsal.common.api.OptimisticLockFailedException;
+import org.opendaylight.mdsal.common.api.TransactionCommitFailedException;
+import org.opendaylight.mdsal.dom.spi.store.AbstractDOMStoreTransaction;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreThreePhaseCommitCohort;
+import org.opendaylight.mdsal.dom.spi.store.SnapshotBackedWriteTransaction;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.ConflictingModificationAppliedException;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidate;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeModification;
@@ -35,7 +34,8 @@ class InMemoryDOMStoreThreePhaseCommitCohort implements DOMStoreThreePhaseCommit
     private final InMemoryDOMDataStore store;
     private DataTreeCandidate candidate;
 
-    public InMemoryDOMStoreThreePhaseCommitCohort(final InMemoryDOMDataStore store, final SnapshotBackedWriteTransaction<String> writeTransaction, final DataTreeModification modification) {
+    InMemoryDOMStoreThreePhaseCommitCohort(final InMemoryDOMDataStore store,
+            final SnapshotBackedWriteTransaction<String> writeTransaction, final DataTreeModification modification) {
         this.transaction = Preconditions.checkNotNull(writeTransaction);
         this.modification = Preconditions.checkNotNull(modification);
         this.store = Preconditions.checkNotNull(store);
@@ -48,6 +48,7 @@ class InMemoryDOMStoreThreePhaseCommitCohort implements DOMStoreThreePhaseCommit
         }
     }
 
+    @SuppressWarnings("checkstyle:IllegalCatch")
     @Override
     public final ListenableFuture<Boolean> canCommit() {
         try {
@@ -66,15 +67,18 @@ class InMemoryDOMStoreThreePhaseCommitCohort implements DOMStoreThreePhaseCommit
 
             // For debugging purposes, allow dumping of the modification. Coupled with the above
             // precondition log, it should allow us to understand what went on.
-            LOG.trace("Store Tx: {} modifications: {} tree: {}", getTransaction().getIdentifier(), modification, store);
+            LOG.trace("Store Tx: {} modifications: {} tree: {}", getTransaction().getIdentifier(),
+                    modification, store);
 
-            return Futures.immediateFailedFuture(new TransactionCommitFailedException("Data did not pass validation.", e));
+            return Futures.immediateFailedFuture(
+                    new TransactionCommitFailedException("Data did not pass validation.", e));
         } catch (Exception e) {
             LOG.warn("Unexpected failure in validation phase", e);
             return Futures.immediateFailedFuture(e);
         }
     }
 
+    @SuppressWarnings("checkstyle:IllegalCatch")
     @Override
     public final ListenableFuture<Void> preCommit() {
         try {
index 8771315e58f635b14e77c705d083312b30fb7a4e..919f888f024121f577285eb2a7e31cff04615d56 100644 (file)
@@ -7,15 +7,14 @@
  */
 package org.opendaylight.mdsal.dom.store.inmemory;
 
-import org.opendaylight.mdsal.dom.spi.store.AbstractDOMStoreTreeChangePublisher;
-
-import org.opendaylight.mdsal.dom.spi.AbstractDOMDataTreeChangeListenerRegistration;
-import org.opendaylight.mdsal.dom.api.DOMDataTreeChangeListener;
 import com.google.common.base.Optional;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.concurrent.ExecutorService;
 import javax.annotation.Nonnull;
+import org.opendaylight.mdsal.dom.api.DOMDataTreeChangeListener;
+import org.opendaylight.mdsal.dom.spi.AbstractDOMDataTreeChangeListenerRegistration;
+import org.opendaylight.mdsal.dom.spi.store.AbstractDOMStoreTreeChangePublisher;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.util.concurrent.QueuedNotificationManager;
 import org.opendaylight.yangtools.util.concurrent.QueuedNotificationManager.Invoker;
@@ -31,24 +30,29 @@ import org.slf4j.LoggerFactory;
 final class InMemoryDOMStoreTreeChangePublisher extends AbstractDOMStoreTreeChangePublisher {
     private static final Invoker<AbstractDOMDataTreeChangeListenerRegistration<?>, DataTreeCandidate> MANAGER_INVOKER =
             new Invoker<AbstractDOMDataTreeChangeListenerRegistration<?>, DataTreeCandidate>() {
-                @Override
-                public void invokeListener(final AbstractDOMDataTreeChangeListenerRegistration<?> listener, final DataTreeCandidate notification) {
-                    // FIXME: this is inefficient, as we could grab the entire queue for the listener and post it
-                    final DOMDataTreeChangeListener inst = listener.getInstance();
-                    if (inst != null) {
-                        inst.onDataTreeChanged(Collections.singletonList(notification));
-                    }
-                }
-            };
+        @Override
+        public void invokeListener(final AbstractDOMDataTreeChangeListenerRegistration<?> listener,
+                final DataTreeCandidate notification) {
+            // FIXME: this is inefficient, as we could grab the entire queue for the listener and post it
+            final DOMDataTreeChangeListener inst = listener.getInstance();
+            if (inst != null) {
+                inst.onDataTreeChanged(Collections.singletonList(notification));
+            }
+        }
+    };
     private static final Logger LOG = LoggerFactory.getLogger(InMemoryDOMStoreTreeChangePublisher.class);
-    private final QueuedNotificationManager<AbstractDOMDataTreeChangeListenerRegistration<?>, DataTreeCandidate> notificationManager;
+
+    private final QueuedNotificationManager<AbstractDOMDataTreeChangeListenerRegistration<?>, DataTreeCandidate>
+        notificationManager;
 
     InMemoryDOMStoreTreeChangePublisher(final ExecutorService listenerExecutor, final int maxQueueSize) {
-        notificationManager = new QueuedNotificationManager<>(listenerExecutor, MANAGER_INVOKER, maxQueueSize, "DataTreeChangeListenerQueueMgr");
+        notificationManager = new QueuedNotificationManager<>(listenerExecutor, MANAGER_INVOKER, maxQueueSize,
+                "DataTreeChangeListenerQueueMgr");
     }
 
     @Override
-    protected void notifyListeners(final Collection<AbstractDOMDataTreeChangeListenerRegistration<?>> registrations, final YangInstanceIdentifier path, final DataTreeCandidateNode node) {
+    protected void notifyListeners(final Collection<AbstractDOMDataTreeChangeListenerRegistration<?>> registrations,
+            final YangInstanceIdentifier path, final DataTreeCandidateNode node) {
         final DataTreeCandidate candidate = DataTreeCandidates.newDataTreeCandidate(path, node);
 
         for (AbstractDOMDataTreeChangeListenerRegistration<?> reg : registrations) {
@@ -58,13 +62,15 @@ final class InMemoryDOMStoreTreeChangePublisher extends AbstractDOMStoreTreeChan
     }
 
     @Override
-    protected synchronized void registrationRemoved(final AbstractDOMDataTreeChangeListenerRegistration<?> registration) {
+    protected synchronized void registrationRemoved(
+            final AbstractDOMDataTreeChangeListenerRegistration<?> registration) {
         LOG.debug("Closing registration {}", registration);
 
         // FIXME: remove the queue for this registration and make sure we clear it
     }
 
-    <L extends DOMDataTreeChangeListener> ListenerRegistration<L> registerTreeChangeListener(final YangInstanceIdentifier treeId, final L listener, final DataTreeSnapshot snapshot) {
+    <L extends DOMDataTreeChangeListener> ListenerRegistration<L> registerTreeChangeListener(
+            final YangInstanceIdentifier treeId, final L listener, final DataTreeSnapshot snapshot) {
         final AbstractDOMDataTreeChangeListenerRegistration<L> reg = registerTreeChangeListener(treeId, listener);
 
         final Optional<NormalizedNode<?, ?>> node = snapshot.readNode(treeId);
index 059abf20726039fa338c81f2ac0fcda9aad1b4a8..f04641533d14fec8599ee17417e35c96ae5cc20a 100644 (file)
@@ -87,7 +87,8 @@ class InmemoryDOMDataTreeShardWriteTransaction implements DOMDataTreeShardWriteT
 
     InmemoryDOMDataTreeShardWriteTransaction(final ShardDataModification root,
                                              final DataTree rootShardDataTree,
-                                             final InMemoryDOMDataTreeShardChangePublisher changePublisher, final ListeningExecutorService executor) {
+                                             final InMemoryDOMDataTreeShardChangePublisher changePublisher,
+                                             final ListeningExecutorService executor) {
         this.modification = Preconditions.checkNotNull(root);
         this.rootShardDataTree = Preconditions.checkNotNull(rootShardDataTree);
         this.changePublisher = Preconditions.checkNotNull(changePublisher);
@@ -159,8 +160,10 @@ class InmemoryDOMDataTreeShardWriteTransaction implements DOMDataTreeShardWriteT
         LOG.debug("Readying open transaction on shard {}", modification.getPrefix());
         rootModification = modification.seal();
 
-        cohorts.add(new InMemoryDOMDataTreeShardThreePhaseCommitCohort(rootShardDataTree, rootModification, changePublisher));
-        for (final Entry<DOMDataTreeIdentifier, ForeignShardModificationContext> entry : modification.getChildShards().entrySet()) {
+        cohorts.add(new InMemoryDOMDataTreeShardThreePhaseCommitCohort(
+                rootShardDataTree, rootModification, changePublisher));
+        for (final Entry<DOMDataTreeIdentifier, ForeignShardModificationContext> entry :
+                modification.getChildShards().entrySet()) {
             cohorts.add(new ForeignShardThreePhaseCommitCohort(entry.getKey(), entry.getValue()));
         }
         finished = true;
@@ -173,7 +176,8 @@ class InmemoryDOMDataTreeShardWriteTransaction implements DOMDataTreeShardWriteT
         Preconditions.checkNotNull(cohorts);
         Preconditions.checkState(!cohorts.isEmpty(), "Transaction was not readied yet.");
 
-        final ListenableFuture<Void> submit = executor.submit(new ShardSubmitCoordinationTask(modification.getPrefix(), cohorts));
+        final ListenableFuture<Void> submit = executor.submit(new ShardSubmitCoordinationTask(
+                modification.getPrefix(), cohorts));
 
         return submit;
     }
@@ -182,7 +186,8 @@ class InmemoryDOMDataTreeShardWriteTransaction implements DOMDataTreeShardWriteT
     public ListenableFuture<Boolean> validate() {
         LOG.debug("CanCommit on open transaction on shard {}", modification.getPrefix());
 
-        final ListenableFuture<Boolean> submit = executor.submit(new ShardCanCommitCoordinationTask(modification.getPrefix(), cohorts));
+        final ListenableFuture<Boolean> submit = executor.submit(new ShardCanCommitCoordinationTask(
+                modification.getPrefix(), cohorts));
         return submit;
     }
 
@@ -190,7 +195,8 @@ class InmemoryDOMDataTreeShardWriteTransaction implements DOMDataTreeShardWriteT
     public ListenableFuture<Void> prepare() {
         LOG.debug("PreCommit on open transaction on shard {}", modification.getPrefix());
 
-        final ListenableFuture<Void> submit = executor.submit(new ShardPreCommitCoordinationTask(modification.getPrefix(), cohorts));
+        final ListenableFuture<Void> submit = executor.submit(new ShardPreCommitCoordinationTask(
+                modification.getPrefix(), cohorts));
         return submit;
     }
 
@@ -198,7 +204,8 @@ class InmemoryDOMDataTreeShardWriteTransaction implements DOMDataTreeShardWriteT
     public ListenableFuture<Void> commit() {
         LOG.debug("Commit open transaction on shard {}", modification.getPrefix());
 
-        final ListenableFuture<Void> submit = executor.submit(new ShardCommitCoordinationTask(modification.getPrefix(), cohorts));
+        final ListenableFuture<Void> submit = executor.submit(new ShardCommitCoordinationTask(
+                modification.getPrefix(), cohorts));
         return submit;
     }
 
index 3c39870f08b007e44ec05fb82deb9f1f3816944d..a8c239729f4ade15647b6ccd2c0bc77df1017d83 100644 (file)
@@ -14,6 +14,6 @@ import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 
 interface ReadableCursorOperation extends CursorStrategy {
 
-    abstract Optional<NormalizedNode<?, ?>> readNode(PathArgument arg);
+    Optional<NormalizedNode<?, ?>> readNode(PathArgument arg);
 
 }
\ No newline at end of file
index 7a5796f1c5ead182b16986167070a695bf600501..fbae4a62adda33308fbcbf54f321d7fcddba6154 100644 (file)
@@ -12,7 +12,7 @@ import com.google.common.annotations.Beta;
 import org.opendaylight.mdsal.dom.spi.store.DOMStoreTreeChangePublisher;
 
 /**
- * Marker interface for readable/writeable DOMDataTreeShard
+ * Marker interface for readable/writeable DOMDataTreeShard.
  */
 @Beta
 public interface ReadableWriteableDOMDataTreeShard extends DOMStoreTreeChangePublisher, WriteableDOMDataTreeShard {
index c8499ecd48cbee559628ed2c137b3c2641dfd32d..b46481f73e49225fe37ff6d5d9857d37b829ebe0 100644 (file)
@@ -21,7 +21,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * Task that coordinates the CanCommit phase of the provided {@link DOMStoreThreePhaseCommitCohort}'s
+ * Task that coordinates the CanCommit phase of the provided {@link DOMStoreThreePhaseCommitCohort}'s.
  */
 @Beta
 public class ShardCanCommitCoordinationTask implements Callable<Boolean> {
@@ -67,9 +67,9 @@ public class ShardCanCommitCoordinationTask implements Callable<Boolean> {
 
     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;
     }
index 4ff9d2f5cdaaffa708830499503cc31085fa9317..dbbd0abdb2c0e393b56a10116ae53f780832e5d0 100644 (file)
@@ -21,7 +21,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * Task that coordinates the Commit phase of the provided {@link DOMStoreThreePhaseCommitCohort}'s
+ * Task that coordinates the Commit phase of the provided {@link DOMStoreThreePhaseCommitCohort}'s.
  */
 @Beta
 public class ShardCommitCoordinationTask implements Callable<Void> {
@@ -64,9 +64,9 @@ public class ShardCommitCoordinationTask 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;
     }
index f6e78ad7f7831ba771f0357c10c3f651f51502fc..1ea21a02c923dd6ab1b60d5fdef4614afa7b90e4 100644 (file)
@@ -21,7 +21,7 @@ class ShardDataModificationBuilder extends ModificationContextNodeBuilder<ShardD
     private final Map<DOMDataTreeIdentifier, ForeignShardModificationContext> childShards =
             new HashMap<>();
 
-    public ShardDataModificationBuilder(final ShardRootModificationContext root) {
+    ShardDataModificationBuilder(final ShardRootModificationContext root) {
         this.root = root;
     }
 
index 86921c141b84601139084828bc37fd5b20d7f475..964c582c1b260d5f7eca0375fe91eb61d67227dd 100644 (file)
@@ -20,21 +20,22 @@ class ShardDataModificationCursor implements DOMDataTreeWriteCursor {
     private final Deque<WriteCursorStrategy> stack = new ArrayDeque<>();
     private final InmemoryDOMDataTreeShardWriteTransaction parent;
 
-    ShardDataModificationCursor(final ShardDataModification root, final InmemoryDOMDataTreeShardWriteTransaction parent) {
+    ShardDataModificationCursor(final ShardDataModification root,
+            final InmemoryDOMDataTreeShardWriteTransaction parent) {
         stack.push(root.createOperation(null));
         this.parent = Preconditions.checkNotNull(parent);
     }
 
+    private WriteCursorStrategy getCurrent() {
+        return stack.peek();
+    }
+
     @Override
     public void enter(final PathArgument child) {
         WriteCursorStrategy nextOp = getCurrent().enter(child);
         stack.push(nextOp);
     }
 
-    private WriteCursorStrategy getCurrent() {
-        return stack.peek();
-    }
-
     @Override
     public void enter(final PathArgument... path) {
         for (PathArgument pathArgument : path) {
index 737be35c7431e189a39e3c9d97b663f405c74c9b..53500b1e3eecca6133382ace2718508433528947 100644 (file)
@@ -22,10 +22,10 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * Task that coordinates the PreCommit phase of the provided {@link DOMStoreThreePhaseCommitCohort}'s
+ * Task that coordinates the PreCommit phase of the provided {@link DOMStoreThreePhaseCommitCohort}'s.
  */
 @Beta
-public class ShardPreCommitCoordinationTask implements Callable<Void>{
+public class ShardPreCommitCoordinationTask implements Callable<Void> {
 
     private static final Logger LOG = LoggerFactory.getLogger(ShardPreCommitCoordinationTask.class);
 
@@ -65,9 +65,9 @@ public class ShardPreCommitCoordinationTask 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;
     }
index 2b14f0e0a0570c84fd6dba938a04b99e68170dc4..9a179d2af4b83c5287523288d69db7ee2ac4248b 100644 (file)
@@ -17,7 +17,7 @@ class WritableInteriorNode extends WriteableNodeWithSubshard {
 
     private final PathArgument identifier;
 
-    public WritableInteriorNode(PathArgument identifier, Map<PathArgument, WriteableModificationNode> children) {
+    WritableInteriorNode(PathArgument identifier, Map<PathArgument, WriteableModificationNode> children) {
         super(children);
         this.identifier = Preconditions.checkNotNull(identifier);
     }
index c330d03c56d04564635347aa4bad0bbd0eeed1aa..848e4fe52414e7c19092b1c4147f2e815ccd47e7 100644 (file)
@@ -15,15 +15,15 @@ import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNodeContainer;
 interface WriteCursorStrategy extends CursorStrategy {
 
     @Override
-    abstract WriteCursorStrategy enter(PathArgument arg);
+    WriteCursorStrategy enter(PathArgument arg);
 
-    abstract void delete(PathArgument arg);
+    void delete(PathArgument arg);
 
-    abstract void merge(PathArgument arg, NormalizedNode<?, ?> data);
+    void merge(PathArgument arg, NormalizedNode<?, ?> data);
 
-    abstract void write(PathArgument arg, NormalizedNode<?, ?> data);
+    void write(PathArgument arg, NormalizedNode<?, ?> data);
 
-    abstract void mergeToCurrent(NormalizedNodeContainer<?, ?, ?> data);
+    void mergeToCurrent(NormalizedNodeContainer<?, ?, ?> data);
 
-    abstract void writeToCurrent(NormalizedNodeContainer<?, ?, ?> data);
+    void writeToCurrent(NormalizedNodeContainer<?, ?, ?> data);
 }
\ No newline at end of file
index 6d6208f8a1640489608eac662467101d7018fbcb..6dd19f426f152bbd099ed3cc133e41246769fb33 100644 (file)
@@ -18,7 +18,6 @@ import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgum
 abstract class WriteableModificationNode implements Identifiable<PathArgument> {
 
     /**
-     *
      * Gets child which is on path towards subshard.
      *
      * @return null if requested child is not subshard or enclosing node of any subshard.
@@ -28,7 +27,7 @@ abstract class WriteableModificationNode implements Identifiable<PathArgument> {
     abstract Map<PathArgument, WriteableModificationNode> getChildrenWithSubshards();
 
     /**
-     * Creates operation used to modify this node and its children
+     * Creates operation used to modify this node and its children.
      *
      * @param parentCursor Cursor associated with parent shard
      * @return WriteableOperation for this node.
index 29f7077e75ab7aad048611b6c526c3a3e5184427..326ab2330681b835d36cb57ba6e646ca92b0e60c 100644 (file)
@@ -17,7 +17,7 @@ abstract class WriteableNodeWithSubshard extends WriteableModificationNode {
 
     private final Map<PathArgument, WriteableModificationNode> children;
 
-    public WriteableNodeWithSubshard(Map<PathArgument, WriteableModificationNode> children) {
+    WriteableNodeWithSubshard(Map<PathArgument, WriteableModificationNode> children) {
         this.children = ImmutableMap.copyOf(children);
     }
 
index 53bb7aca266d74f824400c091ecd74a55ce269cb..a76fa3fbf0ac45433e901ddee3c5f063aced999b 100644 (file)
@@ -12,16 +12,6 @@ import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
-import org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStore;
-
-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.DOMStoreTransactionChain;
-import org.opendaylight.mdsal.dom.spi.store.DOMStoreWriteTransaction;
-import org.opendaylight.mdsal.dom.spi.store.SnapshotBackedTransactions;
-import org.opendaylight.mdsal.dom.spi.store.SnapshotBackedWriteTransaction.TransactionReadyPrototype;
-import org.opendaylight.mdsal.common.api.ReadFailedException;
 import com.google.common.base.Optional;
 import com.google.common.util.concurrent.CheckedFuture;
 import com.google.common.util.concurrent.ListenableFuture;
@@ -32,6 +22,15 @@ import org.junit.Before;
 import org.junit.Ignore;
 import org.junit.Test;
 import org.mockito.Mockito;
+import org.opendaylight.mdsal.common.api.ReadFailedException;
+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.DOMStoreTransactionChain;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreWriteTransaction;
+import org.opendaylight.mdsal.dom.spi.store.SnapshotBackedTransactions;
+import org.opendaylight.mdsal.dom.spi.store.SnapshotBackedWriteTransaction.TransactionReadyPrototype;
+import org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStore;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
@@ -68,7 +67,7 @@ public class InMemoryDataStoreTest {
         assertNotNull(writeTx);
 
         /**
-         * Writes /test in writeTx
+         * Writes /test in writeTx.
          */
         NormalizedNode<?, ?> testNode = ImmutableNodes.containerNode(TestModel.TEST_QNAME);
         writeTx.write(TestModel.TEST_PATH, testNode);
@@ -94,7 +93,7 @@ public class InMemoryDataStoreTest {
         assertNotNull(writeTx);
 
         /**
-         * Writes /test in writeTx
+         * Writes /test in writeTx.
          */
         NormalizedNode<?, ?> testNode = ImmutableNodes.containerNode(TestModel.TEST_QNAME);
         writeTx.write(TestModel.TEST_PATH, testNode);
@@ -128,8 +127,8 @@ public class InMemoryDataStoreTest {
 
         assertThreePhaseCommit( writeTx.ready() );
 
-        Optional<NormalizedNode<?, ?>> afterCommitRead = domStore.newReadOnlyTransaction().
-                read(TestModel.TEST_PATH ).get();
+        Optional<NormalizedNode<?, ?>> afterCommitRead =
+                domStore.newReadOnlyTransaction().read(TestModel.TEST_PATH ).get();
         assertEquals( "After commit read: isPresent", true, afterCommitRead.isPresent() );
 
         // Delete /test and verify
@@ -140,8 +139,7 @@ public class InMemoryDataStoreTest {
 
         assertThreePhaseCommit( writeTx.ready() );
 
-        afterCommitRead = domStore.newReadOnlyTransaction().
-                read(TestModel.TEST_PATH ).get();
+        afterCommitRead = domStore.newReadOnlyTransaction().read(TestModel.TEST_PATH ).get();
         assertEquals( "After commit read: isPresent", false, afterCommitRead.isPresent() );
     }
 
@@ -161,8 +159,8 @@ public class InMemoryDataStoreTest {
 
         assertThreePhaseCommit( writeTx.ready() );
 
-        Optional<NormalizedNode<?, ?>> afterCommitRead = domStore.newReadOnlyTransaction().
-                read(TestModel.TEST_PATH ).get();
+        Optional<NormalizedNode<?, ?>> afterCommitRead =
+                domStore.newReadOnlyTransaction().read(TestModel.TEST_PATH ).get();
         assertEquals( "After commit read: isPresent", true, afterCommitRead.isPresent() );
         assertEquals( "After commit read: data", containerNode, afterCommitRead.get() );
 
@@ -243,7 +241,7 @@ public class InMemoryDataStoreTest {
         assertEquals(false, exists.checkedGet());
     }
 
-    @Test(expected=ReadFailedException.class)
+    @Test(expected = ReadFailedException.class)
     public void testExistsThrowsReadFailedException() throws Exception {
 
         DOMStoreReadTransaction readTx = domStore.newReadOnlyTransaction();
@@ -255,8 +253,8 @@ public class InMemoryDataStoreTest {
     }
 
 
-
-    @Test(expected=ReadFailedException.class)
+    @SuppressWarnings("checkstyle:IllegalThrows")
+    @Test(expected = ReadFailedException.class)
     public void testReadWithReadOnlyTransactionClosed() throws Throwable {
 
         DOMStoreReadTransaction readTx = domStore.newReadOnlyTransaction();
@@ -267,7 +265,8 @@ public class InMemoryDataStoreTest {
         doReadAndThrowEx( readTx );
     }
 
-    @Test(expected=ReadFailedException.class)
+    @SuppressWarnings("checkstyle:IllegalThrows")
+    @Test(expected = ReadFailedException.class)
     public void testReadWithReadOnlyTransactionFailure() throws Throwable {
 
         DataTreeSnapshot mockSnapshot = Mockito.mock( DataTreeSnapshot.class );
@@ -279,7 +278,8 @@ public class InMemoryDataStoreTest {
         doReadAndThrowEx( readTx );
     }
 
-    @Test(expected=ReadFailedException.class)
+    @SuppressWarnings("checkstyle:IllegalThrows")
+    @Test(expected = ReadFailedException.class)
     public void testReadWithReadWriteTransactionClosed() throws Throwable {
 
         DOMStoreReadTransaction readTx = domStore.newReadWriteTransaction();
@@ -290,7 +290,8 @@ public class InMemoryDataStoreTest {
         doReadAndThrowEx( readTx );
     }
 
-    @Test(expected=ReadFailedException.class)
+    @SuppressWarnings("checkstyle:IllegalThrows")
+    @Test(expected = ReadFailedException.class)
     public void testReadWithReadWriteTransactionFailure() throws Throwable {
 
         DataTreeSnapshot mockSnapshot = Mockito.mock( DataTreeSnapshot.class );
@@ -300,20 +301,22 @@ public class InMemoryDataStoreTest {
         Mockito.doReturn( mockModification ).when( mockSnapshot ).newModification();
         @SuppressWarnings("unchecked")
         TransactionReadyPrototype<String> mockReady = Mockito.mock( TransactionReadyPrototype.class );
-        DOMStoreReadTransaction readTx = SnapshotBackedTransactions.newReadWriteTransaction("1", false, mockSnapshot, mockReady);
+        DOMStoreReadTransaction readTx = SnapshotBackedTransactions.newReadWriteTransaction(
+                "1", false, mockSnapshot, mockReady);
 
         doReadAndThrowEx( readTx );
     }
 
+    @SuppressWarnings("checkstyle:IllegalThrows")
     private static void doReadAndThrowEx( final DOMStoreReadTransaction readTx ) throws Throwable {
         try {
             readTx.read(TestModel.TEST_PATH).get();
-        } catch( ExecutionException e ) {
+        } catch ( ExecutionException e ) {
             throw e.getCause();
         }
     }
 
-    @Test(expected=IllegalStateException.class)
+    @Test(expected = IllegalStateException.class)
     public void testWriteWithTransactionReady() throws Exception {
 
         DOMStoreWriteTransaction writeTx = domStore.newWriteOnlyTransaction();
@@ -324,7 +327,7 @@ public class InMemoryDataStoreTest {
         writeTx.write( TestModel.TEST_PATH, ImmutableNodes.containerNode( TestModel.TEST_QNAME ) );
     }
 
-    @Test(expected=IllegalStateException.class)
+    @Test(expected = IllegalStateException.class)
     public void testReadyWithTransactionAlreadyReady() throws Exception {
 
         DOMStoreWriteTransaction writeTx = domStore.newWriteOnlyTransaction();
@@ -360,18 +363,16 @@ public class InMemoryDataStoreTest {
         assertNotNull(txChain);
 
         /**
-         * We alocate new read-write transaction and write /test
-         *
-         *
+         * We alocate new read-write transaction and write /test.
          */
         DOMStoreReadWriteTransaction firstTx = txChain.newReadWriteTransaction();
         assertTestContainerWrite(firstTx);
 
         /**
          * First transaction is marked as ready, we are able to allocate chained
-         * transactions
+         * transactions.
          */
-        DOMStoreThreePhaseCommitCohort firstWriteTxCohort = firstTx.ready();
+        final DOMStoreThreePhaseCommitCohort firstWriteTxCohort = firstTx.ready();
 
         /**
          * We alocate chained transaction - read transaction, note first one is
@@ -380,32 +381,25 @@ public class InMemoryDataStoreTest {
         DOMStoreReadTransaction secondReadTx = txChain.newReadOnlyTransaction();
 
         /**
-         *
          * We test if we are able to read data from tx, read should not fail
          * since we are using chained transaction.
-         *
-         *
          */
         assertTestContainerExists(secondReadTx);
 
         /**
-         *
          * We alocate next transaction, which is still based on first one, but
          * is read-write.
-         *
          */
         DOMStoreReadWriteTransaction thirdDeleteTx = txChain.newReadWriteTransaction();
 
         /**
          * We test existence of /test in third transaction container should
          * still be visible from first one (which is still uncommmited).
-         *
-         *
          */
         assertTestContainerExists(thirdDeleteTx);
 
         /**
-         * We delete node in third transaction
+         * We delete node in third transaction.
          */
         thirdDeleteTx.delete(TestModel.TEST_PATH);
 
@@ -415,7 +409,7 @@ public class InMemoryDataStoreTest {
         DOMStoreThreePhaseCommitCohort thirdDeleteTxCohort = thirdDeleteTx.ready();
 
         /**
-         * We commit first transaction
+         * We commit first transaction.
          *
          */
         assertThreePhaseCommit(firstWriteTxCohort);
index f1a4cc045561d659255b3a1c677ac2969825208d..4611fa860bdfa7f01c1d83fea784620e319b9e91 100644 (file)
@@ -9,14 +9,13 @@ package org.opendaylight.controller.md.sal.dom.store.impl;
 
 import static org.junit.Assert.assertNotNull;
 
-import org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStore;
-
-import org.opendaylight.mdsal.dom.spi.store.DOMStoreReadWriteTransaction;
 import com.google.common.util.concurrent.MoreExecutors;
 import java.util.concurrent.ExecutionException;
 import org.junit.Before;
 import org.junit.Ignore;
 import org.junit.Test;
+import org.opendaylight.mdsal.dom.spi.store.DOMStoreReadWriteTransaction;
+import org.opendaylight.mdsal.dom.store.inmemory.InMemoryDOMDataStore;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 
@@ -54,13 +53,15 @@ public class SchemaUpdateForTransactionTest {
      * then triggering update of global schema context
      * and then performing write (according to new module).
      *
+     *<p>
      * If transaction between allocation and schema context was
      * unmodified, it is safe to change its schema context
      * to new one (e.g. it will be same as if allocated after
      * schema context update.)
      *
-     * @throws InterruptedException
-     * @throws ExecutionException
+     *<p>
+     * @throws InterruptedException when this condition met
+     * @throws ExecutionException when execution fails
      */
     @Ignore
     @Test
index a01933c295bea088f5f86e7f0ad417f4d4e2be58..966e4550681e1f129e87ae51f999523825d03f4c 100644 (file)
@@ -13,7 +13,7 @@ import com.google.common.util.concurrent.MoreExecutors;
 import java.util.concurrent.ExecutorService;
 
 /**
- * A forwarding Executor used by unit tests for DataChangeListener notifications
+ * A forwarding Executor used by unit tests for DataChangeListener notifications.
  *
  * @author Thomas Pantelis
  */
index 15fd602b900252f67123bf2b191799cc995d0af9..89d744d793df507fd1700bdea9977bb35148c11c 100644 (file)
@@ -122,13 +122,15 @@ public class AbstractDOMShardTreeChangePublisherTest extends AbstractDOMShardTre
         super(DATA_TREE, YANG_INSTANCE_IDENTIFIER, CHILD_SHARDS);
     }
 
-    private AbstractDOMShardTreeChangePublisherTest(final Map<DOMDataTreeIdentifier, ChildShardContext> childShardContextMap) {
+    private AbstractDOMShardTreeChangePublisherTest(
+            final Map<DOMDataTreeIdentifier, ChildShardContext> childShardContextMap) {
         super(DATA_TREE, YANG_INSTANCE_IDENTIFIER, childShardContextMap);
     }
 
     @Override
-    protected void notifyListeners(@Nonnull final Collection<AbstractDOMDataTreeChangeListenerRegistration<?>> registrations,
-                                   @Nonnull final YangInstanceIdentifier path, @Nonnull final DataTreeCandidateNode node) {
+    protected void notifyListeners(
+            @Nonnull final Collection<AbstractDOMDataTreeChangeListenerRegistration<?>> registrations,
+                   @Nonnull final YangInstanceIdentifier path, @Nonnull final DataTreeCandidateNode node) {
         // NOOP
     }
 
index e8abd9e52b6983e824c331e40aac15940abf14f9..2a9b39145d2bab243b675b4725487e04551e3403 100644 (file)
@@ -62,6 +62,7 @@ public class InMemoryDOMStoreThreePhaseCommitCohortTest {
         verify(IN_MEMORY_DOM_DATA_STORE).validate(any());
     }
 
+    @SuppressWarnings({"checkstyle:IllegalThrows", "checkstyle:IllegalCatch"})
     @Test(expected = OptimisticLockFailedException.class)
     public void canCommitTestWithOptimisticLockFailedException() throws Throwable {
         doThrow(new ConflictingModificationAppliedException(YangInstanceIdentifier.EMPTY, "testException"))
@@ -75,6 +76,7 @@ public class InMemoryDOMStoreThreePhaseCommitCohortTest {
         }
     }
 
+    @SuppressWarnings({"checkstyle:IllegalThrows", "checkstyle:IllegalCatch"})
     @Test(expected = TransactionCommitFailedException.class)
     public void canCommitTestWithTransactionCommitFailedException() throws Throwable {
         doThrow(new DataValidationFailedException(YangInstanceIdentifier.EMPTY, "testException"))
@@ -88,6 +90,7 @@ public class InMemoryDOMStoreThreePhaseCommitCohortTest {
         }
     }
 
+    @SuppressWarnings({"checkstyle:IllegalThrows", "checkstyle:IllegalCatch"})
     @Test(expected = UnsupportedOperationException.class)
     public void canCommitTestWithUnknownException() throws Throwable {
         doThrow(new UnsupportedOperationException("testException"))
@@ -108,6 +111,7 @@ public class InMemoryDOMStoreThreePhaseCommitCohortTest {
         verify(IN_MEMORY_DOM_DATA_STORE).prepare(any());
     }
 
+    @SuppressWarnings({"checkstyle:IllegalThrows", "checkstyle:IllegalCatch"})
     @Test(expected = UnsupportedOperationException.class)
     public void preCommitTestWithUnknownException() throws Throwable {
         doThrow(new UnsupportedOperationException("testException"))
index 53c817e9e974f6f7fdf56dee1570011c41b9e1ba..1a7a0cf32445d4822c01755f035ccf0d20a37dd9 100644 (file)
@@ -83,7 +83,8 @@ public class InmemoryDOMDataTreeShardWriteTransactionTest {
 
         inmemoryDOMDataTreeShardWriteTransaction =
                 new InmemoryDOMDataTreeShardWriteTransaction(shardDataModification, DATA_TREE,
-                        inMemoryDOMDataTreeShardChangePublisher, MoreExecutors.listeningDecorator(Executors.newSingleThreadExecutor()));
+                        inMemoryDOMDataTreeShardChangePublisher,
+                        MoreExecutors.listeningDecorator(Executors.newSingleThreadExecutor()));
     }
 
     @Test
index 28ca53100ae6cdafbdc42ab9927b2b36fa1692a0..1352ed1d9c1d6252081fdd8a31bdaf265c72bd7d 100644 (file)
@@ -20,7 +20,7 @@ public class ShardSubmitCoordinationTaskTest {
 
     @Test
     public void basicTest() throws Exception {
-        ShardSubmitCoordinationTask shardSubmitCoordinationTask =
+        final ShardSubmitCoordinationTask shardSubmitCoordinationTask =
                 new ShardSubmitCoordinationTask(DOM_DATA_TREE_IDENTIFIER, Collections.EMPTY_SET);
 
         final ShardCanCommitCoordinationTask canCommitCoordinationTask = mock(ShardCanCommitCoordinationTask.class);
index 471590ae8060461de6702d7fba874b8bad6c6ec4..2e6d620ada5109511e882055ca2ce262bdfc242e 100644 (file)
@@ -149,7 +149,7 @@ public class WriteableNodeOperationTest extends WriteableNodeOperation {
         resetMocks();
     }
 
-    public WriteableNodeOperationTest(){
+    public WriteableNodeOperationTest() {
         super(WRITEABLE_MODIFICATION_NODE, DOM_DATA_TREE_WRITE_CURSOR);
     }