Fix checkstyle if-statements must use braces sal-rest-docgen
[controller.git] / opendaylight / md-sal / sal-rest-docgen / src / main / java / org / opendaylight / controller / sal / rest / doc / DocProvider.java
index 31f4253318f146e95c2a0923f3f08d3e14cc4a2d..c07e9c78be7a24672cbca9a5c75c3ea01cb07d34 100644 (file)
@@ -16,7 +16,7 @@ import org.opendaylight.controller.sal.core.api.Broker;
 import org.opendaylight.controller.sal.core.api.Provider;
 import org.opendaylight.controller.sal.core.api.model.SchemaService;
 import org.opendaylight.controller.sal.core.api.mount.MountProvisionService;
-import org.opendaylight.controller.sal.core.api.mount.MountProvisionService.MountProvisionListener;
+import org.opendaylight.controller.sal.core.api.mount.MountProvisionListener;
 import org.opendaylight.controller.sal.rest.doc.impl.ApiDocGenerator;
 import org.opendaylight.controller.sal.rest.doc.mountpoints.MountPointSwagger;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
@@ -70,17 +70,19 @@ public class DocProvider implements BundleActivator, ServiceTrackerCustomizer<Br
     @Override
     public void start(BundleContext context) throws Exception {
         bundleContext = context;
-        brokerServiceTracker = new ServiceTracker(context, Broker.class, this);
+        brokerServiceTracker = new ServiceTracker<>(context, Broker.class, this);
         brokerServiceTracker.open();
     }
 
     @Override
     public void stop(BundleContext context) throws Exception {
-        if (brokerServiceTracker != null)
+        if (brokerServiceTracker != null) {
             brokerServiceTracker.close();
+        }
 
-        if (session != null)
+        if (session != null) {
             session.close();
+        }
 
         synchronized (toClose) {
             for (AutoCloseable close : toClose) {
@@ -98,8 +100,9 @@ public class DocProvider implements BundleActivator, ServiceTrackerCustomizer<Br
 
     @Override
     public void modifiedService(ServiceReference<Broker> reference, Broker service) {
-        if (session != null)
+        if (session != null) {
             session.close();
+        }
 
         Broker broker = bundleContext.getService(reference);
         session = broker.registerProvider(this, bundleContext);