Fix checkstyle violations in sal-dom-spi 04/69104/2
authorTom Pantelis <tompantelis@gmail.com>
Tue, 6 Mar 2018 02:34:04 +0000 (21:34 -0500)
committerMichael Vorburger <vorburger@redhat.com>
Wed, 7 Mar 2018 12:49:48 +0000 (12:49 +0000)
Change-Id: Ifc0955a9dcd162879681cb30ef925b05f37a1fd6
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
32 files changed:
opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/md/sal/dom/broker/spi/mount/SimpleDOMMountPoint.java
opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/md/sal/dom/broker/spi/rpc/RpcRoutingStrategy.java
opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/md/sal/dom/spi/AbstractDOMDataTreeChangeListenerRegistration.java
opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/md/sal/dom/spi/AbstractDOMRpcImplementationRegistration.java
opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/md/sal/dom/spi/AbstractDOMRpcProviderService.java
opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/md/sal/dom/spi/AbstractRegistrationTree.java
opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/md/sal/dom/spi/DOMNotificationSubscriptionListener.java
opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/md/sal/dom/spi/ForwardingDOMDataReadOnlyTransaction.java
opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/md/sal/dom/spi/ForwardingDOMDataReadWriteTransaction.java
opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/md/sal/dom/spi/ForwardingDOMDataWriteTransaction.java
opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/md/sal/dom/spi/ForwardingDOMNotificationPublishService.java
opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/md/sal/dom/spi/ForwardingDOMRpcImplementation.java
opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/md/sal/dom/spi/ForwardingDOMRpcProviderService.java
opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/md/sal/dom/spi/ForwardingDOMRpcService.java
opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/sal/core/spi/BrokerModule.java
opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/sal/core/spi/data/AbstractDOMStoreTransaction.java
opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/sal/core/spi/data/AbstractDOMStoreTreeChangePublisher.java
opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/sal/core/spi/data/AbstractSnapshotBackedTransactionChain.java
opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/sal/core/spi/data/DOMStore.java
opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/sal/core/spi/data/DOMStoreReadTransaction.java
opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/sal/core/spi/data/DOMStoreThreePhaseCommitCohort.java
opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/sal/core/spi/data/DOMStoreTransaction.java
opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/sal/core/spi/data/DOMStoreTransactionChain.java
opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/sal/core/spi/data/DOMStoreTransactionFactory.java
opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/sal/core/spi/data/DOMStoreTreeChangePublisher.java
opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/sal/core/spi/data/DOMStoreWriteTransaction.java
opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/sal/core/spi/data/ForwardingDOMStoreThreePhaseCommitCohort.java
opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/sal/core/spi/data/SnapshotBackedReadTransaction.java
opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/sal/core/spi/data/SnapshotBackedReadWriteTransaction.java
opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/sal/core/spi/data/SnapshotBackedTransactions.java
opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/sal/core/spi/data/SnapshotBackedWriteTransaction.java
opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/sal/core/spi/data/statistics/DOMStoreStatsTracker.java

index f696b20..11d9cab 100644 (file)
@@ -8,25 +8,27 @@
 
 package org.opendaylight.controller.md.sal.dom.broker.spi.mount;
 
+import com.google.common.base.Optional;
+import com.google.common.collect.ClassToInstanceMap;
+import com.google.common.collect.ImmutableClassToInstanceMap;
 import org.opendaylight.controller.md.sal.dom.api.DOMMountPoint;
 import org.opendaylight.controller.md.sal.dom.api.DOMService;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 
-import com.google.common.base.Optional;
-import com.google.common.collect.ClassToInstanceMap;
-import com.google.common.collect.ImmutableClassToInstanceMap;
-
-public class SimpleDOMMountPoint implements DOMMountPoint {
+public final class SimpleDOMMountPoint implements DOMMountPoint {
 
     private final YangInstanceIdentifier identifier;
     private final ClassToInstanceMap<DOMService> services;
     private final SchemaContext schemaContext;
 
-    public static final SimpleDOMMountPoint create(final YangInstanceIdentifier identifier, final ClassToInstanceMap<DOMService> services, final SchemaContext ctx) {
+    public static SimpleDOMMountPoint create(final YangInstanceIdentifier identifier,
+            final ClassToInstanceMap<DOMService> services, final SchemaContext ctx) {
         return new SimpleDOMMountPoint(identifier, services, ctx);
     }
-    private SimpleDOMMountPoint(final YangInstanceIdentifier identifier, final ClassToInstanceMap<DOMService> services, final SchemaContext ctx) {
+
+    private SimpleDOMMountPoint(final YangInstanceIdentifier identifier,
+            final ClassToInstanceMap<DOMService> services, final SchemaContext ctx) {
         this.identifier = identifier;
         this.services = ImmutableClassToInstanceMap.copyOf(services);
         this.schemaContext = ctx;
index f17de22..9c3191f 100644 (file)
@@ -27,21 +27,20 @@ public abstract class RpcRoutingStrategy implements Identifiable<QName> {
     }
 
     /**
-     * Returns leaf QName in which RPC Route is stored
-     *
+     * Returns leaf QName in which RPC Route is stored.
      *
      * @return leaf QName in which RPC Route is stored
      * @throws UnsupportedOperationException If RPC is not content routed.
-     *  ({@link #isContextBasedRouted()} returned <code>false</code>)
+     *     ({@link #isContextBasedRouted()} returned <code>false</code>)
      */
     public abstract QName getLeaf();
 
     /**
-     * Returns identity QName which represents RPC Routing context
+     * Returns identity QName which represents RPC Routing context.
      *
      * @return identity QName which represents RPC Routing context
      * @throws UnsupportedOperationException If RPC is not content routed.
-     *  ({@link #isContextBasedRouted()} returned <code>false</code>)
+     *     ({@link #isContextBasedRouted()} returned <code>false</code>)
      */
     public abstract QName getContext();
 
@@ -107,7 +106,7 @@ public abstract class RpcRoutingStrategy implements Identifiable<QName> {
 
     private static final class GlobalRpcStrategy extends RpcRoutingStrategy {
 
-        public GlobalRpcStrategy(final QName identifier) {
+        GlobalRpcStrategy(final QName identifier) {
             super(identifier);
         }
 
index 8033438..d1d4586 100644 (file)
@@ -16,7 +16,8 @@ import org.opendaylight.yangtools.concepts.AbstractListenerRegistration;
  *
  * @param <T> type of listener
  */
-public abstract class AbstractDOMDataTreeChangeListenerRegistration<T extends DOMDataTreeChangeListener> extends AbstractListenerRegistration<T> {
+public abstract class AbstractDOMDataTreeChangeListenerRegistration<T extends DOMDataTreeChangeListener>
+        extends AbstractListenerRegistration<T> {
     protected AbstractDOMDataTreeChangeListenerRegistration(final T listener) {
         super(listener);
     }
index f0ce2b6..895509c 100644 (file)
@@ -14,7 +14,8 @@ import org.opendaylight.yangtools.concepts.AbstractObjectRegistration;
 /**
  * Abstract base class for {@link DOMRpcImplementationRegistration} implementations.
  */
-public abstract class AbstractDOMRpcImplementationRegistration<T extends DOMRpcImplementation> extends AbstractObjectRegistration<T> implements DOMRpcImplementationRegistration<T> {
+public abstract class AbstractDOMRpcImplementationRegistration<T extends DOMRpcImplementation>
+        extends AbstractObjectRegistration<T> implements DOMRpcImplementationRegistration<T> {
     protected AbstractDOMRpcImplementationRegistration(final T instance) {
         super(instance);
     }
index c137426..31a114b 100644 (file)
@@ -18,7 +18,8 @@ import org.opendaylight.controller.md.sal.dom.api.DOMRpcProviderService;
  */
 public abstract class AbstractDOMRpcProviderService implements DOMRpcProviderService {
     @Override
-    public final <T extends DOMRpcImplementation> DOMRpcImplementationRegistration<T> registerRpcImplementation(final T implementation, final DOMRpcIdentifier... types) {
+    public final <T extends DOMRpcImplementation> DOMRpcImplementationRegistration<T> registerRpcImplementation(
+            final T implementation, final DOMRpcIdentifier... types) {
         return registerRpcImplementation(implementation, ImmutableSet.copyOf(types));
     }
 }
index 0da140e..61e8e3a 100644 (file)
@@ -77,7 +77,8 @@ public abstract class AbstractRegistrationTree<T> {
      * @param node Tree node
      * @param registration Registration instance
      */
-    protected final void removeRegistration(@Nonnull final RegistrationTreeNode<T> node, @Nonnull final T registration) {
+    protected final void removeRegistration(@Nonnull final RegistrationTreeNode<T> node,
+            @Nonnull final T registration) {
         // Take the write lock
         rwLock.writeLock().lock();
         try {
index 85369da..802bb6f 100644 (file)
@@ -22,11 +22,9 @@ import org.opendaylight.yangtools.yang.model.api.SchemaPath;
 public interface DOMNotificationSubscriptionListener extends EventListener {
 
     /**
-     * Invoked when notification subscription changed
+     * Invoked when notification subscription changed.
      *
-     * @param currentTypes Set of notification types
-     * for which listeners are registered.
+     * @param currentTypes Set of notification types for which listeners are registered.
      */
     void onSubscriptionChanged(Set<SchemaPath> currentTypes);
-
 }
index dcec6c3..4742099 100644 (file)
@@ -21,17 +21,20 @@ import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
  * Utility {@link DOMDataReadOnlyTransaction} implementation which forwards all interface
  * method invocation to a delegate instance.
  */
-public abstract class ForwardingDOMDataReadOnlyTransaction extends ForwardingObject implements DOMDataReadOnlyTransaction {
+public abstract class ForwardingDOMDataReadOnlyTransaction extends ForwardingObject
+        implements DOMDataReadOnlyTransaction {
     @Override
     protected abstract @Nonnull DOMDataReadOnlyTransaction delegate();
 
     @Override
-    public CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> read(final LogicalDatastoreType store, final YangInstanceIdentifier path) {
+    public CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> read(final LogicalDatastoreType store,
+            final YangInstanceIdentifier path) {
         return delegate().read(store, path);
     }
 
     @Override
-    public CheckedFuture<Boolean, ReadFailedException> exists(final LogicalDatastoreType store, final YangInstanceIdentifier path) {
+    public CheckedFuture<Boolean, ReadFailedException> exists(final LogicalDatastoreType store,
+            final YangInstanceIdentifier path) {
         return delegate().exists(store, path);
     }
 
index 923bef7..7b0bae7 100644 (file)
@@ -25,17 +25,20 @@ import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
  * Utility {@link DOMDataReadWriteTransaction} implementation which forwards all interface
  * method invocation to a delegate instance.
  */
-public abstract class ForwardingDOMDataReadWriteTransaction extends ForwardingObject implements DOMDataReadWriteTransaction {
+public abstract class ForwardingDOMDataReadWriteTransaction extends ForwardingObject
+        implements DOMDataReadWriteTransaction {
     @Override
     protected abstract @Nonnull DOMDataReadWriteTransaction delegate();
 
     @Override
-    public CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> read(final LogicalDatastoreType store, final YangInstanceIdentifier path) {
+    public CheckedFuture<Optional<NormalizedNode<?, ?>>, ReadFailedException> read(final LogicalDatastoreType store,
+            final YangInstanceIdentifier path) {
         return delegate().read(store, path);
     }
 
     @Override
-    public CheckedFuture<Boolean, ReadFailedException> exists(final LogicalDatastoreType store, final YangInstanceIdentifier path) {
+    public CheckedFuture<Boolean, ReadFailedException> exists(final LogicalDatastoreType store,
+            final YangInstanceIdentifier path) {
         return delegate().exists(store, path);
     }
 
@@ -45,12 +48,14 @@ public abstract class ForwardingDOMDataReadWriteTransaction extends ForwardingOb
     }
 
     @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) {
         delegate().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) {
         delegate().merge(store, path, data);
     }
 
index 2afb478..e544ee8 100644 (file)
@@ -33,12 +33,14 @@ public abstract class ForwardingDOMDataWriteTransaction extends ForwardingObject
     }
 
     @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) {
         delegate().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) {
         delegate().merge(store, path, data);
     }
 
index c9e6bcc..351e885 100644 (file)
@@ -17,7 +17,8 @@ import org.opendaylight.controller.md.sal.dom.api.DOMNotificationPublishService;
  * Utility implementations of {@link DOMNotificationPublishService} which forwards
  * all requests to a delegate instance.
  */
-public abstract class ForwardingDOMNotificationPublishService extends ForwardingObject implements DOMNotificationPublishService {
+public abstract class ForwardingDOMNotificationPublishService extends ForwardingObject
+        implements DOMNotificationPublishService {
     @Override
     protected abstract DOMNotificationPublishService delegate();
 
index e93f941..f7a21aa 100644 (file)
@@ -25,7 +25,8 @@ public abstract class ForwardingDOMRpcImplementation extends ForwardingObject im
     protected abstract @Nonnull DOMRpcImplementation delegate();
 
     @Override
-    public CheckedFuture<DOMRpcResult, DOMRpcException> invokeRpc(final DOMRpcIdentifier type, final NormalizedNode<?, ?> input) {
+    public CheckedFuture<DOMRpcResult, DOMRpcException> invokeRpc(final DOMRpcIdentifier type,
+            final NormalizedNode<?, ?> input) {
         return delegate().invokeRpc(type, input);
     }
 }
index 99c4cad..3e8b5a6 100644 (file)
@@ -24,12 +24,14 @@ public abstract class ForwardingDOMRpcProviderService extends ForwardingObject i
     protected abstract @Nonnull DOMRpcProviderService delegate();
 
     @Override
-    public <T extends DOMRpcImplementation> DOMRpcImplementationRegistration<T> registerRpcImplementation(final T implementation, final DOMRpcIdentifier... types) {
+    public <T extends DOMRpcImplementation> DOMRpcImplementationRegistration<T> registerRpcImplementation(
+            final T implementation, final DOMRpcIdentifier... types) {
         return delegate().registerRpcImplementation(implementation, types);
     }
 
     @Override
-    public <T extends DOMRpcImplementation> DOMRpcImplementationRegistration<T> registerRpcImplementation(final T implementation, final Set<DOMRpcIdentifier> types) {
+    public <T extends DOMRpcImplementation> DOMRpcImplementationRegistration<T> registerRpcImplementation(
+            final T implementation, final Set<DOMRpcIdentifier> types) {
         return delegate().registerRpcImplementation(implementation, types);
     }
 }
index 976d086..a9e87d0 100644 (file)
@@ -26,7 +26,8 @@ public abstract class ForwardingDOMRpcService extends ForwardingObject implement
     protected abstract @Nonnull DOMRpcService delegate();
 
     @Override
-    public CheckedFuture<DOMRpcResult, DOMRpcException> invokeRpc(final SchemaPath type, final NormalizedNode<?, ?> input) {
+    public CheckedFuture<DOMRpcResult, DOMRpcException> invokeRpc(final SchemaPath type,
+            final NormalizedNode<?, ?> input) {
         return delegate().invokeRpc(type, input);
     }
 
index 670598d..21e41f9 100644 (file)
@@ -8,9 +8,8 @@
 package org.opendaylight.controller.sal.core.spi;
 
 import java.util.Set;
-
-import org.opendaylight.controller.sal.core.api.BrokerService;
 import org.opendaylight.controller.sal.core.api.Broker.ConsumerSession;
+import org.opendaylight.controller.sal.core.api.BrokerService;
 import org.opendaylight.controller.sal.core.api.Consumer.ConsumerFunctionality;
 import org.opendaylight.controller.sal.core.api.Provider.ProviderFunctionality;
 
index fba643d..4131efc 100644 (file)
@@ -17,9 +17,11 @@ import javax.annotation.Nullable;
 /**
  * Abstract DOM Store Transaction.
  *
+ * <p>
  * Convenience super implementation of DOM Store transaction which provides
  * common implementation of {@link #toString()} and {@link #getIdentifier()}.
  *
+ * <p>
  * It can optionally capture the context where it was allocated.
  *
  * @param <T> identifier type
index 74938ef..670cbe8 100644 (file)
@@ -26,22 +26,26 @@ import org.slf4j.LoggerFactory;
 /**
  * Abstract base class for {@link DOMStoreTreeChangePublisher} implementations.
  */
-public abstract class AbstractDOMStoreTreeChangePublisher extends AbstractRegistrationTree<AbstractDOMDataTreeChangeListenerRegistration<?>> implements DOMStoreTreeChangePublisher {
+public abstract class AbstractDOMStoreTreeChangePublisher
+        extends AbstractRegistrationTree<AbstractDOMDataTreeChangeListenerRegistration<?>>
+        implements DOMStoreTreeChangePublisher {
     private static final Logger LOG = LoggerFactory.getLogger(AbstractDOMStoreTreeChangePublisher.class);
 
     /**
-     * Callback for subclass to notify specified registrations of a candidate at a specified path. This method is guaranteed
-     * to be only called from within {@link #processCandidateTree(DataTreeCandidate)}.
+     * Callback for subclass to notify specified registrations of a candidate at a specified path. This method is
+     * guaranteed to be only called from within {@link #processCandidateTree(DataTreeCandidate)}.
      *
      * @param registrations Registrations which are affected by the candidate node
      * @param path Path of changed candidate node. Guaranteed to match the path specified by the registration
      * @param node Candidate node
      */
-    protected abstract void notifyListeners(@Nonnull Collection<AbstractDOMDataTreeChangeListenerRegistration<?>> registrations, @Nonnull YangInstanceIdentifier path, @Nonnull DataTreeCandidateNode node);
+    protected abstract void notifyListeners(@Nonnull Collection<AbstractDOMDataTreeChangeListenerRegistration<?>>
+            registrations, @Nonnull YangInstanceIdentifier path, @Nonnull DataTreeCandidateNode node);
 
     /**
      * Callback notifying the subclass that the specified registration is being closed and it's user no longer
-     * wishes to receive notifications. This notification is invoked while the {@link org.opendaylight.yangtools.concepts.ListenerRegistration#close()}
+     * wishes to receive notifications. This notification is invoked while the
+     * {@link org.opendaylight.yangtools.concepts.ListenerRegistration#close()}
      * method is executing. Subclasses can use this callback to properly remove any delayed notifications pending
      * towards the registration.
      *
@@ -61,23 +65,26 @@ public abstract class AbstractDOMStoreTreeChangePublisher extends AbstractRegist
             return;
         }
 
-        try (final RegistrationTreeSnapshot<AbstractDOMDataTreeChangeListenerRegistration<?>> snapshot = takeSnapshot()) {
+        try (RegistrationTreeSnapshot<AbstractDOMDataTreeChangeListenerRegistration<?>> snapshot = takeSnapshot()) {
             lookupAndNotify(candidate.getRootPath().getPathArguments(), 0, snapshot.getRootNode(), candidate);
         }
     }
 
     @Override
-    public final <L extends DOMDataTreeChangeListener> AbstractDOMDataTreeChangeListenerRegistration<L> registerTreeChangeListener(final YangInstanceIdentifier treeId, final L listener) {
+    public final <L extends DOMDataTreeChangeListener> AbstractDOMDataTreeChangeListenerRegistration<L>
+            registerTreeChangeListener(final YangInstanceIdentifier treeId, final L listener) {
         // Take the write lock
         takeLock();
         try {
-            final RegistrationTreeNode<AbstractDOMDataTreeChangeListenerRegistration<?>> node = findNodeFor(treeId.getPathArguments());
-            final AbstractDOMDataTreeChangeListenerRegistration<L> reg = new AbstractDOMDataTreeChangeListenerRegistration<L>(listener) {
-                @Override
-                protected void removeRegistration() {
-                    AbstractDOMStoreTreeChangePublisher.this.removeRegistration(node, this);
-                    registrationRemoved(this);
-                }
+            final RegistrationTreeNode<AbstractDOMDataTreeChangeListenerRegistration<?>> node =
+                    findNodeFor(treeId.getPathArguments());
+            final AbstractDOMDataTreeChangeListenerRegistration<L> reg =
+                new AbstractDOMDataTreeChangeListenerRegistration<L>(listener) {
+                    @Override
+                    protected void removeRegistration() {
+                        AbstractDOMStoreTreeChangePublisher.this.removeRegistration(node, this);
+                        registrationRemoved(this);
+                    }
             };
 
             addRegistration(node, reg);
@@ -88,16 +95,20 @@ public abstract class AbstractDOMStoreTreeChangePublisher extends AbstractRegist
         }
     }
 
-    private void lookupAndNotify(final List<PathArgument> args, final int offset, final RegistrationTreeNode<AbstractDOMDataTreeChangeListenerRegistration<?>> node, final DataTreeCandidate candidate) {
+    private void lookupAndNotify(final List<PathArgument> args, final int offset,
+            final RegistrationTreeNode<AbstractDOMDataTreeChangeListenerRegistration<?>> node,
+            final DataTreeCandidate candidate) {
         if (args.size() != offset) {
             final PathArgument arg = args.get(offset);
 
-            final RegistrationTreeNode<AbstractDOMDataTreeChangeListenerRegistration<?>> exactChild = node.getExactChild(arg);
+            final RegistrationTreeNode<AbstractDOMDataTreeChangeListenerRegistration<?>> exactChild =
+                    node.getExactChild(arg);
             if (exactChild != null) {
                 lookupAndNotify(args, offset + 1, exactChild, candidate);
             }
 
-            for (RegistrationTreeNode<AbstractDOMDataTreeChangeListenerRegistration<?>> c : node.getInexactChildren(arg)) {
+            for (RegistrationTreeNode<AbstractDOMDataTreeChangeListenerRegistration<?>> c :
+                    node.getInexactChildren(arg)) {
                 lookupAndNotify(args, offset + 1, c, candidate);
             }
         } else {
@@ -105,7 +116,9 @@ public abstract class AbstractDOMStoreTreeChangePublisher extends AbstractRegist
         }
     }
 
-    private void notifyNode(final YangInstanceIdentifier path, final RegistrationTreeNode<AbstractDOMDataTreeChangeListenerRegistration<?>> regNode, final DataTreeCandidateNode candNode) {
+    private void notifyNode(final YangInstanceIdentifier path,
+            final RegistrationTreeNode<AbstractDOMDataTreeChangeListenerRegistration<?>> regNode,
+            final DataTreeCandidateNode candNode) {
         if (candNode.getModificationType() == ModificationType.UNMODIFIED) {
             LOG.debug("Skipping unmodified candidate {}", path);
             return;
@@ -118,12 +131,14 @@ public abstract class AbstractDOMStoreTreeChangePublisher extends AbstractRegist
 
         for (DataTreeCandidateNode candChild : candNode.getChildNodes()) {
             if (candChild.getModificationType() != ModificationType.UNMODIFIED) {
-                final RegistrationTreeNode<AbstractDOMDataTreeChangeListenerRegistration<?>> regChild = regNode.getExactChild(candChild.getIdentifier());
+                final RegistrationTreeNode<AbstractDOMDataTreeChangeListenerRegistration<?>> regChild =
+                        regNode.getExactChild(candChild.getIdentifier());
                 if (regChild != null) {
                     notifyNode(path.node(candChild.getIdentifier()), regChild, candChild);
                 }
 
-                for (RegistrationTreeNode<AbstractDOMDataTreeChangeListenerRegistration<?>> rc : regNode.getInexactChildren(candChild.getIdentifier())) {
+                for (RegistrationTreeNode<AbstractDOMDataTreeChangeListenerRegistration<?>> rc :
+                        regNode.getInexactChildren(candChild.getIdentifier())) {
                     notifyNode(path.node(candChild.getIdentifier()), rc, candChild);
                 }
             }
index 383a0e5..f80c800 100644 (file)
@@ -19,14 +19,15 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * Abstract implementation of the {@link DOMStoreTransactionChain} interface relying on {@link DataTreeSnapshot} supplier
- * and backend commit coordinator.
+ * Abstract implementation of the {@link DOMStoreTransactionChain} interface relying on {@link DataTreeSnapshot}
+ * supplier and backend commit coordinator.
  *
  * @param <T> transaction identifier type
  */
 @Beta
-public abstract class AbstractSnapshotBackedTransactionChain<T> extends TransactionReadyPrototype<T> implements DOMStoreTransactionChain {
-    private static abstract class State {
+public abstract class AbstractSnapshotBackedTransactionChain<T> extends TransactionReadyPrototype<T>
+        implements DOMStoreTransactionChain {
+    private abstract static class State {
         /**
          * Allocate a new snapshot.
          *
@@ -68,14 +69,16 @@ public abstract class AbstractSnapshotBackedTransactionChain<T> extends Transact
         @Override
         protected DataTreeSnapshot getSnapshot(Object transactionId) {
             final DataTreeSnapshot ret = snapshot;
-            Preconditions.checkState(ret != null, "Could not get snapshot for transaction %s - previous transaction %s is not ready yet",
+            Preconditions.checkState(ret != null,
+                    "Could not get snapshot for transaction %s - previous transaction %s is not ready yet",
                     transactionId, transaction.getIdentifier());
             return ret;
         }
 
         void setSnapshot(final DataTreeSnapshot snapshot) {
             final boolean success = SNAPSHOT_UPDATER.compareAndSet(this, null, snapshot);
-            Preconditions.checkState(success, "Transaction %s has already been marked as ready", transaction.getIdentifier());
+            Preconditions.checkState(success, "Transaction %s has already been marked as ready",
+                    transaction.getIdentifier());
         }
     }
 
@@ -115,8 +118,8 @@ public abstract class AbstractSnapshotBackedTransactionChain<T> extends Transact
     }
 
     private boolean recordTransaction(final State expected, final DOMStoreWriteTransaction transaction) {
-        final State state = new Allocated(transaction);
-        return STATE_UPDATER.compareAndSet(this, expected, state);
+        final State localState = new Allocated(transaction);
+        return STATE_UPDATER.compareAndSet(this, expected, localState);
     }
 
     @Override
@@ -172,7 +175,8 @@ public abstract class AbstractSnapshotBackedTransactionChain<T> extends Transact
             if (allocated.getTransaction().equals(tx)) {
                 final boolean success = STATE_UPDATER.compareAndSet(this, localState, idleState);
                 if (!success) {
-                    LOG.warn("Transaction {} aborted, but chain {} state already transitioned from {} to {}, very strange",
+                    LOG.warn(
+                        "Transaction {} aborted, but chain {} state already transitioned from {} to {}, very strange",
                         tx, this, localState, state);
                 }
             }
@@ -190,7 +194,8 @@ public abstract class AbstractSnapshotBackedTransactionChain<T> extends Transact
         if (localState instanceof Allocated) {
             final Allocated allocated = (Allocated)localState;
             final DOMStoreWriteTransaction transaction = allocated.getTransaction();
-            Preconditions.checkState(tx.equals(transaction), "Mis-ordered ready transaction %s last allocated was %s", tx, transaction);
+            Preconditions.checkState(tx.equals(transaction), "Mis-ordered ready transaction %s last allocated was %s",
+                    tx, transaction);
             allocated.setSnapshot(tree);
         } else {
             LOG.debug("Ignoring transaction {} readiness due to state {}", tx, localState);
@@ -239,7 +244,8 @@ public abstract class AbstractSnapshotBackedTransactionChain<T> extends Transact
         }
 
         if (!STATE_UPDATER.compareAndSet(this, localState, idleState)) {
-            LOG.debug("Transaction chain {} has already transitioned from {} to {}, not making it idle", this, localState, state);
+            LOG.debug("Transaction chain {} has already transitioned from {} to {}, not making it idle",
+                    this, localState, state);
         }
     }
 
@@ -249,7 +255,8 @@ public abstract class AbstractSnapshotBackedTransactionChain<T> extends Transact
      * @param transaction Transaction which failed.
      * @param cause Failure cause
      */
-    protected final void onTransactionFailed(final SnapshotBackedWriteTransaction<T> transaction, final Throwable cause) {
+    protected final void onTransactionFailed(final SnapshotBackedWriteTransaction<T> transaction,
+            final Throwable cause) {
         LOG.debug("Transaction chain {} failed on transaction {}", this, transaction, cause);
         state = FAILED;
     }
@@ -283,7 +290,7 @@ public abstract class AbstractSnapshotBackedTransactionChain<T> extends Transact
      * @param operationError Any previous error that could be reported through three phase commit
      * @return A {@link DOMStoreThreePhaseCommitCohort} cohort.
      */
-    protected abstract DOMStoreThreePhaseCommitCohort createCohort(final SnapshotBackedWriteTransaction<T> transaction,
-                                                                   final DataTreeModification modification,
-                                                                   final Exception operationError);
+    protected abstract DOMStoreThreePhaseCommitCohort createCohort(SnapshotBackedWriteTransaction<T> transaction,
+                                                                   DataTreeModification modification,
+                                                                   Exception operationError);
 }
index 7a51df9..238aeb9 100644 (file)
@@ -20,6 +20,7 @@ import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
  * DOM Data Store provides transactional tree-like storage for YANG-modeled
  * entities described by YANG schema and represented by {@link NormalizedNode}.
  *
+ * <p>
  * Read and write access to stored data is provided only via transactions
  * created using {@link #newReadOnlyTransaction()},
  * {@link #newWriteOnlyTransaction()} and {@link #newReadWriteTransaction()}, or
@@ -29,12 +30,13 @@ import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 public interface DOMStore extends DOMStoreTransactionFactory {
 
     /**
-     * Registers {@link org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeListener} for Data Change callbacks which will
-     * be triggered on the change of provided subpath. What constitutes a change
+     * Registers {@link org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeListener} for Data Change
+     * callbacks which will be triggered on the change of provided subpath. What constitutes a change
      * depends on the @scope parameter.
      *
      * Listener upon registration receives an initial callback
-     * {@link AsyncDataChangeListener#onDataChanged(org.opendaylight.controller.md.sal.common.api.data.AsyncDataChangeEvent)}
+     * {@link AsyncDataChangeListener#onDataChanged(org.opendaylight.controller.md.sal.common.api.data
+     *     .AsyncDataChangeEvent)}
      * which contains stable view of data tree at the time of registration.
      *
      *  @param path Path (subtree identifier) on which client listener will be
@@ -48,21 +50,19 @@ public interface DOMStore extends DOMStoreTransactionFactory {
      *         registration / interest on receiving data changes.
      *
      */
-    <L extends AsyncDataChangeListener<YangInstanceIdentifier, NormalizedNode<?, ?>>> ListenerRegistration<L> registerChangeListener(
-            YangInstanceIdentifier path, L listener, DataChangeScope scope);
+    <L extends AsyncDataChangeListener<YangInstanceIdentifier, NormalizedNode<?, ?>>> ListenerRegistration<L>
+        registerChangeListener(YangInstanceIdentifier path, L listener, DataChangeScope scope);
 
     /**
-     *
      * Creates new transaction chain.
      *
+     * <p>
      * Transactions in a chain need to be committed in sequence and each
      * transaction should see the effects of previous transactions as if they
      * happened.
      *
-     * See {@link DOMStoreTransactionChain} for more information.
-     *
+     * @see DOMStoreTransactionChain for more information.
      * @return Newly created transaction chain.
      */
     DOMStoreTransactionChain createTransactionChain();
-
 }
index 3068911..ede5bae 100644 (file)
@@ -7,17 +7,16 @@
  */
 package org.opendaylight.controller.sal.core.spi.data;
 
+import com.google.common.base.Optional;
+import com.google.common.util.concurrent.CheckedFuture;
 import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 
-import com.google.common.base.Optional;
-import com.google.common.util.concurrent.CheckedFuture;
-
 public interface DOMStoreReadTransaction extends DOMStoreTransaction {
 
     /**
-     * Reads data from provided logical data store located at provided path
+     * Reads data from provided logical data store located at provided path.
      *
      * @param path
      *            Path which uniquely identifies subtree which client want to
@@ -37,8 +36,8 @@ public interface DOMStoreReadTransaction extends DOMStoreTransaction {
 
     /**
      * Checks if data is available in the logical data store located at provided path.
-     * <p>
      *
+     * <p>
      * Note: a successful result from this method makes no guarantee that a subsequent call to {@link #read}
      * will succeed. It is possible that the data resides in a data store on a remote node and, if that
      * node goes down or a network failure occurs, a subsequent read would fail. Another scenario is if
index ec54e42..db2afd0 100644 (file)
@@ -36,6 +36,7 @@ public interface DOMStoreThreePhaseCommitCohort {
     /**
      * Initiates a pre-commit phase of associated transaction on datastore.
      *
+     * <p>
      * This message is valid only and only if and only if the participant responded
      * on {@link #canCommit()} call with positive response.
      *
index b225576..86679d3 100644 (file)
@@ -10,15 +10,15 @@ package org.opendaylight.controller.sal.core.spi.data;
 import org.opendaylight.yangtools.concepts.Identifiable;
 
 /**
- * DOM Data Store transaction
- *
- * See {@link DOMStoreReadTransaction}, {@link DOMStoreWriteTransaction} and {@link DOMStoreReadWriteTransaction}
- * for specific transaction types.
+ * DOM Data Store transaction.
  *
+ * @see DOMStoreReadTransaction
+ * @see DOMStoreWriteTransaction
+ * @see DOMStoreReadWriteTransaction
  */
 public interface DOMStoreTransaction extends AutoCloseable, Identifiable<Object> {
     /**
-     * Unique identifier of the transaction
+     * Unique identifier of the transaction.
      */
     @Override
     Object getIdentifier();
index b916fdd..dfffd3e 100644 (file)
@@ -19,10 +19,12 @@ public interface DOMStoreTransactionChain extends DOMStoreTransactionFactory, Au
      * Create a new read only transaction which will continue the chain. The
      * previous write transaction has to be either READY or CANCELLED.
      *
+     * <p>
      * If previous write transaction was already commited to data store, new
      * read-only transaction is same as obtained via {@link DOMStore#newReadOnlyTransaction()}
      * and contains merged result of previous one and current state of data store.
      *
+     * <p>
      * Otherwise read-only transaction presents isolated view as if previous read-write
      * transaction was successful. State which was introduced by other transactions
      * outside this transaction chain after creation of previous transaction is not visible.
@@ -39,10 +41,12 @@ public interface DOMStoreTransactionChain extends DOMStoreTransactionFactory, Au
      * Create a new read write transaction which will continue the chain. The
      * previous read-write transaction has to be either COMMITED or CANCELLED.
      *
+     * <p>
      * If previous write transaction was already commited to data store, new
      * read-write transaction is same as obtained via {@link DOMStore#newReadWriteTransaction()}
      * and contains merged result of previous one and current state of data store.
      *
+     * <p>
      * Otherwise read-write transaction presents isolated view as if previous read-write
      * transaction was successful. State which was introduced by other transactions
      * outside this transaction chain after creation of previous transaction is not visible.
@@ -71,6 +75,7 @@ public interface DOMStoreTransactionChain extends DOMStoreTransactionFactory, Au
     /**
      * Closes Transaction Chain.
      *
+     * <p>
      * Close method of transaction chain does not guarantee that
      * last alocated transaction is ready or was submitted.
      *
index 433d575..f33c0a4 100644 (file)
@@ -16,8 +16,7 @@ package org.opendaylight.controller.sal.core.spi.data;
  * Underlying {@link DOMStore} or {@link DOMStoreTransactionChain}.
  *
  * <p>
- * See {@link DOMStore} or {@link DOMStoreTransactionChain} for concrete
- * variations of this factory.
+ * See DOMStore, DOMStoreTransactionChain for concrete variations of this factory.
  *
  * <p>
  * <b>Note:</b> This interface is used only to define common functionality
@@ -28,15 +27,13 @@ package org.opendaylight.controller.sal.core.spi.data;
 public interface DOMStoreTransactionFactory {
 
     /**
-     *
-     * Creates a read only transaction
+     * Creates a read only transaction.
      *
      * <p>
      * Creates a new read-only transaction, which provides read access to
      * snapshot of current state.
      *
-     * See {@link DOMStoreReadTransaction} for more information.
-     *
+     * @see DOMStoreReadTransaction for more information.
      * @return new {@link DOMStoreReadTransaction}
      * @throws IllegalStateException
      *             If state of factory prevents allocating new transaction.
@@ -45,22 +42,18 @@ public interface DOMStoreTransactionFactory {
     DOMStoreReadTransaction newReadOnlyTransaction();
 
     /**
-     * Creates write only transaction
-     *
-     * <p>
-     * See {@link DOMStoreWriteTransaction} for more information.
+     * Creates write only transaction.
      *
+     * @see DOMStoreWriteTransaction for more information.
      * @return new {@link DOMStoreWriteTransaction}
      * @throws IllegalStateException If state of factory prevents allocating new transaction.
      */
     DOMStoreWriteTransaction newWriteOnlyTransaction();
 
     /**
-     * Creates Read-Write transaction
-     *
-     * <p>
-     * See {@link DOMStoreReadWriteTransaction} for more information.
+     * Creates Read-Write transaction.
      *
+     * @see DOMStoreReadWriteTransaction for more information.
      * @return  new {@link DOMStoreWriteTransaction}
      * @throws IllegalStateException If state of factory prevents allocating new transaction.
      */
index 5d75f88..78bf7fb 100644 (file)
@@ -21,14 +21,16 @@ public interface DOMStoreTreeChangePublisher {
      * Registers a {@link DOMDataTreeChangeListener} to receive
      * notifications when data changes under a given path in the conceptual data
      * tree.
+     *
      * <p>
      * You are able to register for notifications  for any node or subtree
      * which can be represented using {@link YangInstanceIdentifier}.
-     * <p>
      *
+     * <p>
      * You are able to register for data change notifications for a subtree or leaf
      * even if it does not exist. You will receive notification once that node is
      * created.
+     *
      * <p>
      * If there is any pre-existing data in data tree on path for which you are
      * registering, you will receive initial data change event, which will
@@ -38,6 +40,7 @@ public interface DOMStoreTreeChangePublisher {
      * This method returns a {@link ListenerRegistration} object. To
      * "unregister" your listener for changes call the {@link ListenerRegistration#close()}
      * method on this returned object.
+     *
      * <p>
      * You MUST explicitly unregister your listener when you no longer want to receive
      * notifications. This is especially true in OSGi environments, where failure to
@@ -52,5 +55,6 @@ public interface DOMStoreTreeChangePublisher {
      *         your listener using {@link ListenerRegistration#close()} to stop
      *         delivery of change events.
      */
-    @Nonnull <L extends DOMDataTreeChangeListener> ListenerRegistration<L> registerTreeChangeListener(@Nonnull YangInstanceIdentifier treeId, @Nonnull L listener);
+    @Nonnull <L extends DOMDataTreeChangeListener> ListenerRegistration<L> registerTreeChangeListener(
+            @Nonnull YangInstanceIdentifier treeId, @Nonnull L listener);
 }
index 1964fd4..3aaf006 100644 (file)
@@ -17,14 +17,12 @@ public interface DOMStoreWriteTransaction extends DOMStoreTransaction {
      * operation, which is to say that whole subtree will be replaced by
      * specified path.
      *
+     * <p>
      * If you need add or merge of current object with specified use
      * {@link #merge(YangInstanceIdentifier, NormalizedNode)}.
      *
-     *
-     * @param path
-     * @param data
-     *            Data object to be written
-     *
+     * @param path the path to write
+     * @param data data object to be written
      * @throws IllegalStateException
      *             if the client code already sealed transaction and invoked
      *             {@link #ready()}
@@ -36,10 +34,8 @@ public interface DOMStoreWriteTransaction extends DOMStoreTransaction {
      * operation, which is to say that whole subtree will be replaced by
      * specified path.
      *
-     * @param path
-     * @param data
-     *            Data object to be written
-     *
+     * @param path the path to write
+     * @param data data object to be written
      * @throws IllegalStateException
      *             if the client code already sealed transaction and invoked
      *             {@link #ready()}
@@ -47,11 +43,9 @@ public interface DOMStoreWriteTransaction extends DOMStoreTransaction {
     void merge(YangInstanceIdentifier path, NormalizedNode<?, ?> data);
 
     /**
-     *
      * Deletes data and whole subtree located at provided path.
      *
-     * @param path
-     *            Path to delete
+     * @param path path to delete
      * @throws IllegalStateException
      *             if the client code already sealed transaction and invoked
      *             {@link #ready()}
@@ -59,7 +53,6 @@ public interface DOMStoreWriteTransaction extends DOMStoreTransaction {
     void delete(YangInstanceIdentifier path);
 
     /**
-     *
      * Seals transaction, and returns three-phase commit cohort associated
      * with this transaction and DOM Store to be coordinated by coordinator.
      *
index 4c817dd..c6e70fe 100644 (file)
@@ -16,7 +16,8 @@ import com.google.common.util.concurrent.ListenableFuture;
  * which forward most of their functionality to a backend {@link #delegate()}.
  */
 @Beta
-public abstract class ForwardingDOMStoreThreePhaseCommitCohort extends ForwardingObject implements DOMStoreThreePhaseCommitCohort {
+public abstract class ForwardingDOMStoreThreePhaseCommitCohort extends ForwardingObject
+        implements DOMStoreThreePhaseCommitCohort {
     @Override
     protected abstract DOMStoreThreePhaseCommitCohort delegate();
 
index 8a59149..688d1e3 100644 (file)
@@ -22,16 +22,17 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
+ * Implementation of read-only transaction backed by {@link DataTreeSnapshot}.
  *
- * Implementation of read-only transaction backed by {@link DataTreeSnapshot}
- *
+ * <p>
  * Implementation of read-only transaction backed by {@link DataTreeSnapshot}
  * which delegates most of its calls to similar methods provided by underlying snapshot.
  *
  * @param <T> identifier type
  */
 @Beta
-public final class SnapshotBackedReadTransaction<T> extends AbstractDOMStoreTransaction<T> implements DOMStoreReadTransaction {
+public final class SnapshotBackedReadTransaction<T> extends AbstractDOMStoreTransaction<T>
+        implements DOMStoreReadTransaction {
     private static final Logger LOG = LoggerFactory.getLogger(SnapshotBackedReadTransaction.class);
     private volatile DataTreeSnapshot stableSnapshot;
 
@@ -55,6 +56,7 @@ public final class SnapshotBackedReadTransaction<T> extends AbstractDOMStoreTran
     }
 
     @Override
+    @SuppressWarnings("checkstyle:IllegalCatch")
     public CheckedFuture<Optional<NormalizedNode<?,?>>, ReadFailedException> read(final YangInstanceIdentifier path) {
         LOG.debug("Tx: {} Read: {}", getIdentifier(), path);
         checkNotNull(path, "Path must not be null.");
@@ -66,7 +68,7 @@ public final class SnapshotBackedReadTransaction<T> extends AbstractDOMStoreTran
 
         try {
             return Futures.immediateCheckedFuture(Optional.fromJavaUtil(snapshot.readNode(path)));
-        } catch (Exception e) {
+        } catch (RuntimeException e) {
             LOG.error("Tx: {} Failed Read of {}", getIdentifier(), path, e);
             return Futures.immediateFailedCheckedFuture(new ReadFailedException("Read failed",e));
         }
index 30abf87..2d938fe 100644 (file)
@@ -8,12 +8,12 @@
 package org.opendaylight.controller.sal.core.spi.data;
 
 import static com.google.common.base.Preconditions.checkNotNull;
+
 import com.google.common.annotations.Beta;
 import com.google.common.base.Optional;
 import com.google.common.util.concurrent.CheckedFuture;
 import com.google.common.util.concurrent.Futures;
 import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
-import org.opendaylight.controller.sal.core.spi.data.SnapshotBackedWriteTransaction.TransactionReadyPrototype;
 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.tree.DataTreeSnapshot;
@@ -27,7 +27,8 @@ import org.slf4j.LoggerFactory;
  * @param <T> identifier type
  */
 @Beta
-public final class SnapshotBackedReadWriteTransaction<T> extends SnapshotBackedWriteTransaction<T> implements DOMStoreReadWriteTransaction {
+public final class SnapshotBackedReadWriteTransaction<T> extends SnapshotBackedWriteTransaction<T>
+        implements DOMStoreReadWriteTransaction {
     private static final Logger LOG = LoggerFactory.getLogger(SnapshotBackedReadWriteTransaction.class);
 
     SnapshotBackedReadWriteTransaction(final T identifier, final boolean debug,
@@ -36,6 +37,7 @@ public final class SnapshotBackedReadWriteTransaction<T> extends SnapshotBackedW
     }
 
     @Override
+    @SuppressWarnings("checkstyle:IllegalCatch")
     public CheckedFuture<Optional<NormalizedNode<?,?>>, ReadFailedException> read(final YangInstanceIdentifier path) {
         LOG.debug("Tx: {} Read: {}", getIdentifier(), path);
         checkNotNull(path, "Path must not be null.");
@@ -43,7 +45,7 @@ public final class SnapshotBackedReadWriteTransaction<T> extends SnapshotBackedW
         final Optional<NormalizedNode<?, ?>> result;
         try {
             result = readSnapshotNode(path);
-        } catch (Exception e) {
+        } catch (RuntimeException e) {
             LOG.error("Tx: {} Failed Read of {}", getIdentifier(), path, e);
             return Futures.immediateFailedCheckedFuture(new ReadFailedException("Read failed", e));
         }
index 927e224..a82a65e 100644 (file)
@@ -27,7 +27,8 @@ public final class SnapshotBackedTransactions {
      * @param debug Enable transaction debugging
      * @param snapshot Snapshot which will be modified.
      */
-    public static <T> SnapshotBackedReadTransaction<T> newReadTransaction(final T identifier, final boolean debug, final DataTreeSnapshot snapshot) {
+    public static <T> SnapshotBackedReadTransaction<T> newReadTransaction(final T identifier, final boolean debug,
+            final DataTreeSnapshot snapshot) {
         return new SnapshotBackedReadTransaction<>(identifier, debug, snapshot);
     }
 
@@ -39,8 +40,8 @@ public final class SnapshotBackedTransactions {
      * @param snapshot Snapshot which will be modified.
      * @param readyImpl Implementation of ready method.
      */
-    public static <T> SnapshotBackedReadWriteTransaction<T> newReadWriteTransaction(final T identifier, final boolean debug,
-            final DataTreeSnapshot snapshot, final TransactionReadyPrototype<T> readyImpl) {
+    public static <T> SnapshotBackedReadWriteTransaction<T> newReadWriteTransaction(final T identifier,
+            final boolean debug, final DataTreeSnapshot snapshot, final TransactionReadyPrototype<T> readyImpl) {
         return new SnapshotBackedReadWriteTransaction<>(identifier, debug, snapshot, readyImpl);
     }
 
index eaabb3a..b5afe6a 100644 (file)
@@ -31,14 +31,17 @@ import org.slf4j.LoggerFactory;
  * @param <T> Identifier type
  */
 @Beta
-public class SnapshotBackedWriteTransaction<T> extends AbstractDOMStoreTransaction<T> implements DOMStoreWriteTransaction {
+public class SnapshotBackedWriteTransaction<T> extends AbstractDOMStoreTransaction<T>
+        implements DOMStoreWriteTransaction {
     private static final Logger LOG = LoggerFactory.getLogger(SnapshotBackedWriteTransaction.class);
     @SuppressWarnings("rawtypes")
-    private static final AtomicReferenceFieldUpdater<SnapshotBackedWriteTransaction, TransactionReadyPrototype> READY_UPDATER =
-            AtomicReferenceFieldUpdater.newUpdater(SnapshotBackedWriteTransaction.class, TransactionReadyPrototype.class, "readyImpl");
+    private static final AtomicReferenceFieldUpdater<SnapshotBackedWriteTransaction, TransactionReadyPrototype>
+        READY_UPDATER = AtomicReferenceFieldUpdater.newUpdater(SnapshotBackedWriteTransaction.class,
+                TransactionReadyPrototype.class, "readyImpl");
     @SuppressWarnings("rawtypes")
-    private static final AtomicReferenceFieldUpdater<SnapshotBackedWriteTransaction, DataTreeModification> TREE_UPDATER =
-            AtomicReferenceFieldUpdater.newUpdater(SnapshotBackedWriteTransaction.class, DataTreeModification.class, "mutableTree");
+    private static final AtomicReferenceFieldUpdater<SnapshotBackedWriteTransaction, DataTreeModification>
+        TREE_UPDATER = AtomicReferenceFieldUpdater.newUpdater(SnapshotBackedWriteTransaction.class,
+                DataTreeModification.class, "mutableTree");
 
     // non-null when not ready
     private volatile TransactionReadyPrototype<T> readyImpl;
@@ -54,6 +57,7 @@ public class SnapshotBackedWriteTransaction<T> extends AbstractDOMStoreTransacti
     }
 
     @Override
+    @SuppressWarnings("checkstyle:IllegalCatch")
     public void write(final YangInstanceIdentifier path, final NormalizedNode<?, ?> data) {
         checkNotReady();
 
@@ -63,7 +67,7 @@ public class SnapshotBackedWriteTransaction<T> extends AbstractDOMStoreTransacti
         try {
             tree.write(path, data);
             // FIXME: Add checked exception
-        } catch (Exception e) {
+        } catch (RuntimeException e) {
             LOG.error("Tx: {}, failed to write {}:{} in {}", getIdentifier(), path, data, tree, e);
             // Rethrow original ones if they are subclasses of RuntimeException
             // or Error
@@ -74,6 +78,7 @@ public class SnapshotBackedWriteTransaction<T> extends AbstractDOMStoreTransacti
     }
 
     @Override
+    @SuppressWarnings("checkstyle:IllegalCatch")
     public void merge(final YangInstanceIdentifier path, final NormalizedNode<?, ?> data) {
         checkNotReady();
 
@@ -83,7 +88,7 @@ public class SnapshotBackedWriteTransaction<T> extends AbstractDOMStoreTransacti
         try {
             tree.merge(path, data);
             // FIXME: Add checked exception
-        } catch (Exception e) {
+        } catch (RuntimeException e) {
             LOG.error("Tx: {}, failed to write {}:{} in {}", getIdentifier(), path, data, tree, e);
             // Rethrow original ones if they are subclasses of RuntimeException
             // or Error
@@ -94,6 +99,7 @@ public class SnapshotBackedWriteTransaction<T> extends AbstractDOMStoreTransacti
     }
 
     @Override
+    @SuppressWarnings("checkstyle:IllegalCatch")
     public void delete(final YangInstanceIdentifier path) {
         checkNotReady();
 
@@ -103,7 +109,7 @@ public class SnapshotBackedWriteTransaction<T> extends AbstractDOMStoreTransacti
         try {
             tree.delete(path);
             // FIXME: Add checked exception
-        } catch (Exception e) {
+        } catch (RuntimeException e) {
             LOG.error("Tx: {}, failed to delete {} in {}", getIdentifier(), path, tree, e);
             // Rethrow original ones if they are subclasses of RuntimeException
             // or Error
@@ -124,12 +130,13 @@ public class SnapshotBackedWriteTransaction<T> extends AbstractDOMStoreTransacti
         return readyImpl == null ? null : Optional.fromJavaUtil(mutableTree.readNode(path));
     }
 
-    private final void checkNotReady() {
+    private void checkNotReady() {
         checkState(readyImpl != null, "Transaction %s is no longer open. No further modifications allowed.",
                 getIdentifier());
     }
 
     @Override
+    @SuppressWarnings("checkstyle:IllegalCatch")
     public DOMStoreThreePhaseCommitCohort ready() {
         @SuppressWarnings("unchecked")
         final TransactionReadyPrototype<T> wasReady = READY_UPDATER.getAndSet(this, null);
@@ -167,8 +174,8 @@ public class SnapshotBackedWriteTransaction<T> extends AbstractDOMStoreTransacti
     }
 
     /**
-     * This class is intended to be implemented by Transaction factories
-     * responsible for allocation of {@link org.opendaylight.controller.sal.core.spi.data.SnapshotBackedWriteTransaction} and
+     * This class is intended to be implemented by Transaction factories responsible for allocation of
+     * {@link org.opendaylight.controller.sal.core.spi.data.SnapshotBackedWriteTransaction} and
      * providing underlying logic for applying implementation.
      *
      * @param <T> identifier type
@@ -180,11 +187,12 @@ public class SnapshotBackedWriteTransaction<T> extends AbstractDOMStoreTransacti
          *
          * @param tx Transaction which got aborted.
          */
-        protected abstract void transactionAborted(final SnapshotBackedWriteTransaction<T> tx);
+        protected abstract void transactionAborted(SnapshotBackedWriteTransaction<T> tx);
 
         /**
          * Returns a commit coordinator associated with supplied transactions.
          *
+         * <p>
          * This call must not fail.
          *
          * @param tx
index 12713b2..4496107 100644 (file)
@@ -9,9 +9,7 @@
 package org.opendaylight.controller.sal.core.spi.data.statistics;
 
 import java.util.concurrent.ExecutorService;
-
 import javax.annotation.Nonnull;
-
 import org.opendaylight.yangtools.util.concurrent.QueuedNotificationManager;
 
 /**
@@ -26,19 +24,19 @@ public interface DOMStoreStatsTracker {
      *
      * @param dclExecutor the executor
      */
-    void setDataChangeListenerExecutor( @Nonnull ExecutorService dclExecutor );
+    void setDataChangeListenerExecutor(@Nonnull ExecutorService dclExecutor);
 
     /**
      * Sets the executor used internally by the data store.
      *
      * @param dsExecutor the executor
      */
-    void setDataStoreExecutor( @Nonnull ExecutorService dsExecutor );
+    void setDataStoreExecutor(@Nonnull ExecutorService dsExecutor);
 
     /**
-     * Sets the QueuedNotificationManager use for DataChangeListener notifications,
+     * Sets the QueuedNotificationManager use for DataChangeListener notifications.
      *
      * @param manager the manager
      */
-    void setNotificationManager( @Nonnull QueuedNotificationManager<?, ?> manager );
+    void setNotificationManager(@Nonnull QueuedNotificationManager<?, ?> manager);
 }

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