Mechanical code cleanup (sal-dom-broker) 81/46081/3
authorStephen Kitt <skitt@redhat.com>
Thu, 22 Sep 2016 16:18:12 +0000 (18:18 +0200)
committerTom Pantelis <tpanteli@brocade.com>
Fri, 23 Sep 2016 18:40:45 +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: I4fa4890915dd1bf80dfb69378a38dd2b6c9d7043
Signed-off-by: Stephen Kitt <skitt@redhat.com>
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/AbstractDOMForwardedTransactionFactory.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/CommitCoordinationTask.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/DOMDataBrokerTransactionChainImpl.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/DOMNotificationRouter.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/ShardedDOMDataTree.java

index 8ee928e..fef26fe 100644 (file)
@@ -152,7 +152,7 @@ abstract class AbstractDOMForwardedTransactionFactory<T extends DOMStoreTransact
         for (Entry<LogicalDatastoreType, T> store : storeTxFactories.entrySet()) {
             txns.put(store.getKey(), store.getValue().newWriteOnlyTransaction());
         }
-        return new DOMForwardedWriteTransaction<DOMStoreWriteTransaction>(newTransactionIdentifier(), txns, this);
+        return new DOMForwardedWriteTransaction<>(newTransactionIdentifier(), txns, this);
     }
 
     /**
index da7a0d1..efe4c19 100644 (file)
@@ -27,7 +27,7 @@ import org.slf4j.LoggerFactory;
  * support of cancellation.
  */
 final class CommitCoordinationTask implements Callable<Void> {
-    private static enum Phase {
+    private enum Phase {
         canCommit,
         preCommit,
         doCommit,
index fd216ec..dff375e 100644 (file)
@@ -35,7 +35,7 @@ import org.slf4j.LoggerFactory;
  */
 final class DOMDataBrokerTransactionChainImpl extends AbstractDOMForwardedTransactionFactory<DOMStoreTransactionChain>
         implements DOMTransactionChain {
-    private static enum State {
+    private enum State {
         RUNNING,
         CLOSING,
         CLOSED,
index 64c6b9e..41dfcb9 100644 (file)
@@ -193,7 +193,7 @@ public final class DOMNotificationRouter implements AutoCloseable, DOMNotificati
     }
 
     @Override
-    public ListenableFuture<? extends Object> putNotification(final DOMNotification notification) throws InterruptedException {
+    public ListenableFuture<?> putNotification(final DOMNotification notification) throws InterruptedException {
         final Collection<ListenerRegistration<? extends DOMNotificationListener>> subscribers = listeners.get(notification.getType());
         if (subscribers.isEmpty()) {
             return NO_LISTENERS;
@@ -203,7 +203,7 @@ public final class DOMNotificationRouter implements AutoCloseable, DOMNotificati
         return publish(seq, notification, subscribers);
     }
 
-    private ListenableFuture<? extends Object> tryPublish(final DOMNotification notification, final Collection<ListenerRegistration<? extends DOMNotificationListener>> subscribers) {
+    private ListenableFuture<?> tryPublish(final DOMNotification notification, final Collection<ListenerRegistration<? extends DOMNotificationListener>> subscribers) {
         final long seq;
         try {
              seq = disruptor.getRingBuffer().tryNext();
@@ -215,7 +215,7 @@ public final class DOMNotificationRouter implements AutoCloseable, DOMNotificati
     }
 
     @Override
-    public ListenableFuture<? extends Object> offerNotification(final DOMNotification notification) {
+    public ListenableFuture<?> offerNotification(final DOMNotification notification) {
         final Collection<ListenerRegistration<? extends DOMNotificationListener>> subscribers = listeners.get(notification.getType());
         if (subscribers.isEmpty()) {
             return NO_LISTENERS;
@@ -225,7 +225,7 @@ public final class DOMNotificationRouter implements AutoCloseable, DOMNotificati
     }
 
     @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 {
         final Collection<ListenerRegistration<? extends DOMNotificationListener>> subscribers = listeners.get(notification.getType());
         if (subscribers.isEmpty()) {
@@ -233,7 +233,7 @@ public final class DOMNotificationRouter implements AutoCloseable, DOMNotificati
         }
 
         // Attempt to perform a non-blocking publish first
-        final ListenableFuture<? extends Object> noBlock = tryPublish(notification, subscribers);
+        final ListenableFuture<?> noBlock = tryPublish(notification, subscribers);
         if (!DOMNotificationPublishService.REJECTED.equals(noBlock)) {
             return noBlock;
         }
index 827baa5..638e585 100644 (file)
@@ -100,7 +100,7 @@ public final class ShardedDOMDataTree implements DOMDataTreeService, DOMDataTree
 
             // FIXME: wrap the shard in a proper adaptor based on implemented interface
 
-            reg = new ShardRegistration<T>(this, prefix, shard);
+            reg = new ShardRegistration<>(this, prefix, shard);
 
             storeShard(prefix, reg);
 

©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.