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 d693e66b95e5aebb4e6c8de0951b6f0161f3334d..28ca144b97c979b28241691f7e1f85b96466f13e 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 759c470f0610100679c92de06d16a47c71ba7f32..8b88f0f5c01348ee3bacd9a4277682f699d7505b 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 1fe81ea3f497d6511293582e19feb237cb10bad4..83fa1969d911f59482aeb04bb52535ffa4412b31 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 b1bb1743550f769ef51785afc989801abcff0ade..fd9eec633744361f6682a4e6c3bc6de6343f04aa 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 2716fb7c544ce31f3ad1daf9a28f5c3e1f14ac96..aef168ddf0881a7d0ecb84d0c9eac497b0dc9aef 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 4a4137c2a5d2a8b43d373162d1f94a759aa5a87f..cc40a2e0e161a1bef01856e3aeeefca7c90108f5 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 4ef25ae02e2e30227684efc42dc8a5b7c366111e..3df048bdaae79c1cfb0ad5c8971f25a69de73ac4 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);
     }
 
 }