Mechanical code cleanup (sal-binding-broker) 82/46082/4
authorStephen Kitt <skitt@redhat.com>
Thu, 22 Sep 2016 16:19:18 +0000 (18:19 +0200)
committerTom Pantelis <tpanteli@brocade.com>
Tue, 4 Oct 2016 17:44:20 +0000 (17:44 +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: Ia9ab5959dab860bc8220aff4390ca62c87ec8ecf
Signed-off-by: Stephen Kitt <skitt@redhat.com>
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/BindingDOMDataTreeChangeServiceAdapter.java
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/BindingDOMMountPointServiceAdapter.java
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/BindingDOMNotificationPublishServiceAdapter.java
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/BindingToNormalizedNodeCodec.java
opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/md/sal/binding/impl/BindingNormalizedCodecTest.java
opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/md/sal/binding/impl/test/DataTreeChangeListenerTest.java
opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/AugmentationVerifier.java

index d693e66..28ca144 100644 (file)
@@ -53,9 +53,9 @@ final class BindingDOMDataTreeChangeServiceAdapter implements DataTreeChangeServ
         @SuppressWarnings({ "rawtypes", "unchecked" })
         final BindingDOMDataTreeChangeListenerAdapter<T> domListener =
                 listener instanceof ClusteredDataTreeChangeListener ?
-                        new BindingClusteredDOMDataTreeChangeListenerAdapter<T>(
-                                codec, (ClusteredDataTreeChangeListener)listener, treeId.getDatastoreType()) :
-                        new BindingDOMDataTreeChangeListenerAdapter<T>(codec, listener, treeId.getDatastoreType());
+                        new BindingClusteredDOMDataTreeChangeListenerAdapter<>(
+                                codec, (ClusteredDataTreeChangeListener) listener, treeId.getDatastoreType()) :
+                        new BindingDOMDataTreeChangeListenerAdapter<>(codec, listener, treeId.getDatastoreType());
 
         final ListenerRegistration<BindingDOMDataTreeChangeListenerAdapter<T>> domReg =
                 dataTreeChangeService.registerDataTreeChangeListener(domIdentifier, domListener);
index 759c470..8b88f0f 100644 (file)
@@ -56,7 +56,7 @@ public class BindingDOMMountPointServiceAdapter implements MountPointService {
     @Override
     public <T extends MountPointListener> ListenerRegistration<T> registerListener(InstanceIdentifier<?> path,
             T listener) {
-        return new BindingDOMMountPointListenerAdapter<T>(listener,codec,mountService);
+        return new BindingDOMMountPointListenerAdapter<>(listener, codec, mountService);
     }
 
 }
index 1fe81ea..83fa196 100644 (file)
@@ -52,7 +52,7 @@ public class BindingDOMNotificationPublishServiceAdapter implements Notification
     }
 
     @Override
-    public ListenableFuture<? extends Object> offerNotification(final Notification notification) {
+    public ListenableFuture<?> offerNotification(final Notification notification) {
         ListenableFuture<?> offerResult = domPublishService.offerNotification(toDomNotification(notification));
         return DOMNotificationPublishService.REJECTED.equals(offerResult)
                 ? NotificationPublishService.REJECTED
@@ -60,7 +60,7 @@ public class BindingDOMNotificationPublishServiceAdapter implements Notification
     }
 
     @Override
-    public ListenableFuture<? extends Object> offerNotification(final Notification notification, final int timeout, final TimeUnit unit) throws InterruptedException {
+    public ListenableFuture<?> offerNotification(final Notification notification, final int timeout, final TimeUnit unit) throws InterruptedException {
         ListenableFuture<?> offerResult = domPublishService.offerNotification(toDomNotification(notification), timeout, unit);
         return DOMNotificationPublishService.REJECTED.equals(offerResult)
                 ? NotificationPublishService.REJECTED
index b1bb174..fd9eec6 100644 (file)
@@ -356,7 +356,7 @@ public final class BindingToNormalizedNodeCodec implements BindingCodecTreeFacto
          * return non-null value.
          */
         final BindingCodecTreeNode<?> codecContext = currentCodecTree.getSubtreeCodec(bindingPath);
-        return new SimpleEntry<InstanceIdentifier<?>, BindingCodecTreeNode<?>>(bindingPath, codecContext);
+        return new SimpleEntry<>(bindingPath, codecContext);
     }
 
     @SuppressWarnings("unchecked")
index 2716fb7..aef168d 100644 (file)
@@ -71,7 +71,7 @@ public class BindingNormalizedCodecTest extends AbstractSchemaAwareTest {
         final DataObjectSerializerGenerator streamWriter = StreamWriterGenerator.create(JavassistUtils.forClassPool(ClassPool.getDefault()));
         final BindingNormalizedNodeCodecRegistry registry = new BindingNormalizedNodeCodecRegistry(streamWriter);
         codec = new BindingToNormalizedNodeCodec(GeneratedClassLoadingStrategy.getTCCLClassLoadingStrategy(), registry, true);
-    };
+    }
 
     @Test
     public void testComplexAugmentationSerialization() {
index 4a4137c..cc40a2e 100644 (file)
@@ -55,8 +55,8 @@ public class DataTreeChangeListenerTest extends AbstractDataBrokerTest {
     private static final InstanceIdentifier<TopLevelList> BAR_PATH = path(TOP_BAR_KEY);
     private static final PathArgument BAR_ARGUMENT = Iterables.getLast(BAR_PATH.getPathArguments());
     private static final TopLevelList BAR_DATA = topLevelList(TOP_BAR_KEY);
-private static final DataTreeIdentifier<Top> TOP_IDENTIFIER = new DataTreeIdentifier<Top>(LogicalDatastoreType.OPERATIONAL,
-            TOP_PATH);
+    private static final DataTreeIdentifier<Top> TOP_IDENTIFIER =
+            new DataTreeIdentifier<>(LogicalDatastoreType.OPERATIONAL, TOP_PATH);
 
     private static final Top TOP_INITIAL_DATA = top(FOO_DATA);
 
index 4ef25ae..3df048b 100644 (file)
@@ -31,7 +31,7 @@ public class AugmentationVerifier<T extends Augmentable<T>> {
     }
 
     public static <T extends Augmentable<T>> AugmentationVerifier<T> from(T obj) {
-        return new AugmentationVerifier<T>(obj);
+        return new AugmentationVerifier<>(obj);
     }
 
 }

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