Fix checkstyle violations in sal-binding-util and sal-schema-service 44/69144/3
authorTom Pantelis <tompantelis@gmail.com>
Tue, 6 Mar 2018 14:05:40 +0000 (09:05 -0500)
committerMichael Vorburger <vorburger@redhat.com>
Fri, 9 Mar 2018 14:56:06 +0000 (14:56 +0000)
Change-Id: I96c37055e8f632ab5ea7dd5c6111039a57430887
Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
opendaylight/md-sal/sal-binding-util/src/main/java/org/opendaylight/controller/md/sal/binding/util/AbstractBindingSalConsumerInstance.java
opendaylight/md-sal/sal-binding-util/src/main/java/org/opendaylight/controller/md/sal/binding/util/AbstractBindingSalProviderInstance.java
opendaylight/md-sal/sal-binding-util/src/main/java/org/opendaylight/controller/md/sal/binding/util/BindingContextUtils.java
opendaylight/md-sal/sal-binding-util/src/main/java/org/opendaylight/controller/md/sal/binding/util/TypeSafeDataReader.java
opendaylight/md-sal/sal-schema-service/src/main/java/org/opendaylight/controller/sal/schema/service/impl/GlobalBundleScanningSchemaServiceImpl.java

index 861f9f0..61d1ec0 100644 (file)
@@ -56,8 +56,8 @@ public abstract class AbstractBindingSalConsumerInstance<N extends NotificationS
     }
 
     @Override
-    public ListenerRegistration<org.opendaylight.yangtools.yang.binding.NotificationListener> registerNotificationListener(
-            org.opendaylight.yangtools.yang.binding.NotificationListener listener) {
+    public ListenerRegistration<org.opendaylight.yangtools.yang.binding.NotificationListener>
+            registerNotificationListener(org.opendaylight.yangtools.yang.binding.NotificationListener listener) {
         return getNotificationBrokerChecked().registerNotificationListener(listener);
     }
 }
index 8fb31d1..5cc0340 100644 (file)
@@ -51,8 +51,8 @@ public abstract class AbstractBindingSalProviderInstance<N extends NotificationP
     }
 
     @Override
-    public <L extends RouteChangeListener<RpcContextIdentifier, InstanceIdentifier<?>>> ListenerRegistration<L> registerRouteChangeListener(
-            final L listener) {
+    public <L extends RouteChangeListener<RpcContextIdentifier, InstanceIdentifier<?>>> ListenerRegistration<L>
+            registerRouteChangeListener(final L listener) {
         return getRpcRegistryChecked().registerRouteChangeListener(listener);
     }
 
index 26aa27e..43ed93f 100644 (file)
@@ -9,6 +9,8 @@ package org.opendaylight.controller.md.sal.binding.util;
 
 import static com.google.common.base.Preconditions.checkNotNull;
 
+import com.google.common.collect.ClassToInstanceMap;
+import com.google.common.collect.MutableClassToInstanceMap;
 import org.opendaylight.controller.md.sal.common.api.routing.RouteChangeListener;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ConsumerContext;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
@@ -24,10 +26,9 @@ import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.binding.RpcService;
 
-import com.google.common.collect.ClassToInstanceMap;
-import com.google.common.collect.MutableClassToInstanceMap;
-
-public class BindingContextUtils {
+public final class BindingContextUtils {
+    private BindingContextUtils() {
+    }
 
     public static ConsumerContext createConsumerContext(BindingAwareConsumer consumer,
             ClassToInstanceMap<BindingAwareService> serviceProvider) {
@@ -67,7 +68,7 @@ public class BindingContextUtils {
         private ClassToInstanceMap<BindingAwareService> alreadyRetrievedServices;
         private ClassToInstanceMap<BindingAwareService> serviceProvider;
 
-        public SingleConsumerContextImpl(ClassToInstanceMap<BindingAwareService> serviceProvider) {
+        SingleConsumerContextImpl(ClassToInstanceMap<BindingAwareService> serviceProvider) {
             this.alreadyRetrievedServices = MutableClassToInstanceMap.create();
             this.serviceProvider = serviceProvider;
         }
@@ -81,7 +82,7 @@ public class BindingContextUtils {
         public final <T extends BindingAwareService> T getSALService(Class<T> service) {
             checkNotNull(service,"Service class should not be null.");
             T potential = alreadyRetrievedServices.getInstance(service);
-            if(potential != null) {
+            if (potential != null) {
                 return potential;
             }
             return tryToRetrieveSalService(service);
@@ -89,12 +90,12 @@ public class BindingContextUtils {
 
         private synchronized <T extends BindingAwareService> T tryToRetrieveSalService(Class<T> service) {
             final T potential = alreadyRetrievedServices.getInstance(service);
-            if(potential != null) {
+            if (potential != null) {
                 return potential;
             }
             final T requested = serviceProvider.getInstance(service);
-            if(requested == null) {
-                throw new IllegalArgumentException("Requested service "+service.getName() +" is not available.");
+            if (requested == null) {
+                throw new IllegalArgumentException("Requested service " + service.getName() + " is not available.");
             }
             final T retrieved = BindingContextUtils.createContextProxyOrReturnService(service,requested);
             alreadyRetrievedServices.put(service, retrieved);
@@ -110,13 +111,13 @@ public class BindingContextUtils {
 
     private static class SingleProviderContextImpl extends SingleConsumerContextImpl implements ProviderContext {
 
-        public SingleProviderContextImpl(ClassToInstanceMap<BindingAwareService> serviceProvider) {
+        SingleProviderContextImpl(ClassToInstanceMap<BindingAwareService> serviceProvider) {
             super(serviceProvider);
         }
 
         @Override
-        public <L extends RouteChangeListener<RpcContextIdentifier, InstanceIdentifier<?>>> ListenerRegistration<L> registerRouteChangeListener(
-                L listener) {
+        public <L extends RouteChangeListener<RpcContextIdentifier, InstanceIdentifier<?>>> ListenerRegistration<L>
+                registerRouteChangeListener(L listener) {
             return getSALService(RpcProviderRegistry.class).registerRouteChangeListener(listener);
         }
 
index 49ac59f..e71f646 100644 (file)
@@ -12,11 +12,10 @@ import org.opendaylight.yangtools.yang.binding.DataObject;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 
 /**
+ * Deprecated.
  *
- *
- * @deprecated Use
- *             {@link org.opendaylight.controller.md.sal.binding.api.ReadTransaction#read(org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType, InstanceIdentifier)}
- *             instead.
+ * @deprecated Use {@link org.opendaylight.controller.md.sal.binding.api.ReadTransaction#read(
+ *     org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType, InstanceIdentifier)} instead.
  */
 @Deprecated
 public final class TypeSafeDataReader {
index 6d2eacb..7a91cdf 100644 (file)
@@ -117,6 +117,6 @@ public final class GlobalBundleScanningSchemaServiceImpl implements SchemaContex
         }
 
         return Futures.makeChecked((ListenableFuture<YangTextSchemaSource>) yangProvider.getSource(sourceIdentifier),
-                e -> new SchemaSourceException("Error retrieving source", e));
+            e -> new SchemaSourceException("Error retrieving source", e));
     }
 }

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