Mechanical code cleanup (sal-dom-spi) 73/46073/3
authorStephen Kitt <skitt@redhat.com>
Thu, 22 Sep 2016 15:35:14 +0000 (17:35 +0200)
committerTom Pantelis <tpanteli@brocade.com>
Fri, 23 Sep 2016 18:40:08 +0000 (18:40 +0000)
* Remove unnecessary type specifiers (use Java 7 <>)
* Remove unnecessary "extends Object" declarations
* Remove unnecessary semi-colons
* Merge identical catch blocks
* Remove redundant modifiers:
  - enum constructors are private by default
  - interface properties are public static final by default
  - interface methods are public abstract by default
  - interfaces are abstract by default
  - inner interfaces are static by default
  - inner classes in interfaces are public static by default

Change-Id: I68a6f9ee118c8ff47bc2511efa234b93b09de32a
Signed-off-by: Stephen Kitt <skitt@redhat.com>
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/RegistrationTreeNode.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/DOMStoreTransaction.java
opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/sal/core/spi/data/SnapshotBackedTransactions.java

index 6bc11079e23f714aaa16eb77e484ae28f98fb2ec..c9e6bccbd34c5dec5ab3e906a1b7c60d97dede1e 100644 (file)
@@ -22,17 +22,17 @@ public abstract class ForwardingDOMNotificationPublishService extends Forwarding
     protected abstract DOMNotificationPublishService delegate();
 
     @Override
-    public ListenableFuture<? extends Object> putNotification(final DOMNotification notification) throws InterruptedException {
+    public ListenableFuture<?> putNotification(final DOMNotification notification) throws InterruptedException {
         return delegate().putNotification(notification);
     }
 
     @Override
-    public ListenableFuture<? extends Object> offerNotification(final DOMNotification notification) {
+    public ListenableFuture<?> offerNotification(final DOMNotification notification) {
         return delegate().offerNotification(notification);
     }
 
     @Override
-    public ListenableFuture<? extends Object> offerNotification(final DOMNotification notification, final long timeout,
+    public ListenableFuture<?> offerNotification(final DOMNotification notification, final long timeout,
             final TimeUnit unit) throws InterruptedException {
         return delegate().offerNotification(notification, timeout, unit);
     }
index 41e80ead7a1d61be47d14d519baa8483e5c80f81..378e9edb6e9b55adff57b2c6f8dee0de2001cadc 100644 (file)
@@ -97,7 +97,7 @@ public final class RegistrationTreeNode<T> implements Identifiable<PathArgument>
     RegistrationTreeNode<T> ensureChild(@Nonnull final PathArgument child) {
         RegistrationTreeNode<T> potential = children.get(Preconditions.checkNotNull(child));
         if (potential == null) {
-            potential = new RegistrationTreeNode<T>(this, child);
+            potential = new RegistrationTreeNode<>(this, child);
             children.put(child, potential);
         }
         return potential;
index 7b6e68dc512e8e5eacf7c183295d33942332862a..9898ce9bb95d24b524497ab12339067514688a74 100644 (file)
@@ -140,7 +140,8 @@ public abstract class AbstractSnapshotBackedTransactionChain<T> extends Transact
 
         do {
             entry = getSnapshot(transactionId);
-            ret = new SnapshotBackedReadWriteTransaction<T>(transactionId, getDebugTransactions(), entry.getValue(), this);
+            ret = new SnapshotBackedReadWriteTransaction<>(transactionId, getDebugTransactions(), entry.getValue(),
+                    this);
         } while (!recordTransaction(entry.getKey(), ret));
 
         return ret;
@@ -157,7 +158,7 @@ public abstract class AbstractSnapshotBackedTransactionChain<T> extends Transact
 
         do {
             entry = getSnapshot(transactionId);
-            ret = new SnapshotBackedWriteTransaction<T>(transactionId, getDebugTransactions(), entry.getValue(), this);
+            ret = new SnapshotBackedWriteTransaction<>(transactionId, getDebugTransactions(), entry.getValue(), this);
         } while (!recordTransaction(entry.getKey(), ret));
 
         return ret;
index 76ea78b29928415dd585d9144a33c2d824f9b997..b225576ba795383377330ea06fed60a12a091083 100644 (file)
@@ -21,7 +21,7 @@ public interface DOMStoreTransaction extends AutoCloseable, Identifiable<Object>
      * Unique identifier of the transaction
      */
     @Override
-    public Object getIdentifier();
+    Object getIdentifier();
 
     @Override
     void close();
index 3368c8aee101ad58b2eabd8d0b106613cf387d69..927e224cec2b90d6690ed5df03f53a85f1d6edab 100644 (file)
@@ -28,7 +28,7 @@ public final class SnapshotBackedTransactions {
      * @param snapshot Snapshot which will be modified.
      */
     public static <T> SnapshotBackedReadTransaction<T> newReadTransaction(final T identifier, final boolean debug, final DataTreeSnapshot snapshot) {
-        return new SnapshotBackedReadTransaction<T>(identifier, debug, snapshot);
+        return new SnapshotBackedReadTransaction<>(identifier, debug, snapshot);
     }
 
     /**
@@ -41,7 +41,7 @@ public final class SnapshotBackedTransactions {
      */
     public static <T> SnapshotBackedReadWriteTransaction<T> newReadWriteTransaction(final T identifier, final boolean debug,
             final DataTreeSnapshot snapshot, final TransactionReadyPrototype<T> readyImpl) {
-        return new SnapshotBackedReadWriteTransaction<T>(identifier, debug, snapshot, readyImpl);
+        return new SnapshotBackedReadWriteTransaction<>(identifier, debug, snapshot, readyImpl);
     }
 
     /**
@@ -54,6 +54,6 @@ public final class SnapshotBackedTransactions {
      */
     public static <T> SnapshotBackedWriteTransaction<T> newWriteTransaction(final T identifier, final boolean debug,
             final DataTreeSnapshot snapshot, final TransactionReadyPrototype<T> readyImpl) {
-        return new SnapshotBackedWriteTransaction<T>(identifier, debug, snapshot, readyImpl);
+        return new SnapshotBackedWriteTransaction<>(identifier, debug, snapshot, readyImpl);
     }
 }