Remove unnecessary code 04/32104/2
authorGary Wu <gary.wu1@huawei.com>
Mon, 4 Jan 2016 19:55:53 +0000 (11:55 -0800)
committerGary Wu <gary.wu1@huawei.com>
Mon, 4 Jan 2016 20:00:05 +0000 (12:00 -0800)
Remove unnecessary casts and @SuppressWarnings

Change-Id: I817cdf97e708e4f9c4c343c44f54de60cbcb6eff
Signed-off-by: Gary Wu <gary.wu1@huawei.com>
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/compat/HydrogenDataChangeEvent.java
opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/LazyDataTreeModification.java
opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/AugmentationVerifier.java

index 8f50d0a..77f156e 100644 (file)
@@ -93,7 +93,6 @@ public abstract class HydrogenDataChangeEvent implements
         return null;
     }
 
-    @SuppressWarnings({ "rawtypes", "unchecked" })
     private static final class OperationalChangeEvent extends HydrogenDataChangeEvent {
 
         private final AsyncDataChangeEvent<InstanceIdentifier<?>, DataObject> delegate;
@@ -125,7 +124,7 @@ public abstract class HydrogenDataChangeEvent implements
 
         @Override
         public Map<InstanceIdentifier<?>, DataObject> getOriginalOperationalData() {
-            return (Map) delegate.getOriginalData();
+            return delegate.getOriginalData();
         }
 
         @Override
@@ -149,7 +148,6 @@ public abstract class HydrogenDataChangeEvent implements
 
     }
 
-    @SuppressWarnings({ "rawtypes", "unchecked" })
     private static final class ConfigurationChangeEvent extends HydrogenDataChangeEvent {
 
         private final AsyncDataChangeEvent<InstanceIdentifier<?>, DataObject> delegate;
@@ -181,7 +179,7 @@ public abstract class HydrogenDataChangeEvent implements
 
         @Override
         public Map<InstanceIdentifier<?>, DataObject> getOriginalConfigurationData() {
-            return (Map) delegate.getOriginalData();
+            return delegate.getOriginalData();
         }
 
         @Override
index 2a90f96..af82225 100644 (file)
@@ -53,7 +53,7 @@ class LazyDataTreeModification<T extends DataObject> implements DataTreeModifica
             final LogicalDatastoreType datastoreType) {
         final Entry<InstanceIdentifier<?>, BindingCodecTreeNode<?>> codecCtx =
                 codec.getSubtreeCodec(domChange.getRootPath());
-        return (DataTreeModification<T>) new LazyDataTreeModification(datastoreType, codecCtx.getKey(), codecCtx.getValue(), domChange);
+        return new LazyDataTreeModification(datastoreType, codecCtx.getKey(), codecCtx.getValue(), domChange);
     }
 
     static <T extends DataObject> Collection<DataTreeModification<T>> from(final BindingToNormalizedNodeCodec codec,
index c8129e6..4ef25ae 100644 (file)
@@ -21,7 +21,7 @@ public class AugmentationVerifier<T extends Augmentable<T>> {
 
     public AugmentationVerifier<T> assertHasAugmentation(Class<? extends Augmentation<T>> augmentation) {
         assertHasAugmentation(object, augmentation);
-        return (AugmentationVerifier<T>) this;
+        return this;
     }
 
     public static <T extends Augmentable<T>> void assertHasAugmentation(T object,

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