Merge topic 'checkstyle'
authorTony Tkacik <ttkacik@cisco.com>
Wed, 10 Dec 2014 09:11:31 +0000 (09:11 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Wed, 10 Dec 2014 09:11:31 +0000 (09:11 +0000)
* changes:
  Fix checkstyle if-statements must use braces liblldp
  Fix checkstyle if-statements must use braces hosttracker
  Fix checkstyle if-statements must use braces bundlescanner
  Fix checkstyle if-statements must use braces ClusterManager
  Fix checkstyle if-statements must use braces HostTrackerCallable
  Fix checkstyle if-statements must use braces ConnectionManagerNorthbound
  Fix checkstyle if-statements must use braces HostTrackerNorthbound
  Fix checkstyle if-statements must use braces BridgeDomainNorthbound
  Fix checkstyle if-statements must use braces adsal/northbound/staticrouting
  Fix checkstyle if-statements must use braces adsal/northbound/statistics
  Fix checkstyle if-statements must use braces adsal/protocol_plugins
  Fix checkstyle if-statements must use braces adsal/sal/connection
  Fix checkstyle if-statements must use braces adsal/samples/loadbalancer
  Fix checkstyle if-statements must use braces adsal/usermanager
  Fix checkstyle if-statements must use braces config-persister-file-xml-adapter
  Fix checkstyle if-statements must use braces logback-config
  Fix checkstyle if-statements must use braces yang-jmx-generator-plugin
  Fix checkstyle if-statements must use braces yang-jmx-generator
  Fix checkstyle if-statements must use braces sal-common-impl
  Fix checkstyle if-statements must use braces sal-common-util
  Fix checkstyle if-statements must use braces sal-dom-xsql
  Fix checkstyle if-statements must use braces sal-netconf-connector
  Fix checkstyle if-statements must use braces sal-rest-docgen
  Fix checkstyle if-statements must use braces md/statistics
  Fix checkstyle if-statements must use braces netconf

43 files changed:
opendaylight/adsal/clustering/services_implementation/src/main/java/org/opendaylight/controller/clustering/services_implementation/internal/ClusterManager.java
opendaylight/adsal/hosttracker/api/src/main/java/org/opendaylight/controller/hosttracker/IPHostId.java
opendaylight/adsal/hosttracker/api/src/main/java/org/opendaylight/controller/hosttracker/IPMacHostId.java
opendaylight/adsal/hosttracker/implementation/src/main/java/org/opendaylight/controller/hosttracker/internal/HostTrackerCallable.java
opendaylight/adsal/northbound/bundlescanner/implementation/src/main/java/org/opendaylight/controller/northbound/bundlescanner/internal/Activator.java
opendaylight/adsal/northbound/bundlescanner/implementation/src/main/java/org/opendaylight/controller/northbound/bundlescanner/internal/BundleInfo.java
opendaylight/adsal/northbound/bundlescanner/implementation/src/main/java/org/opendaylight/controller/northbound/bundlescanner/internal/BundleScanner.java
opendaylight/adsal/northbound/connectionmanager/src/main/java/org/opendaylight/controller/connectionmanager/northbound/ConnectionManagerNorthbound.java
opendaylight/adsal/northbound/hosttracker/src/main/java/org/opendaylight/controller/hosttracker/northbound/HostTrackerNorthbound.java
opendaylight/adsal/northbound/networkconfiguration/bridgedomain/src/main/java/org/opendaylight/controller/networkconfig/bridgedomain/northbound/BridgeDomainNorthbound.java
opendaylight/adsal/northbound/staticrouting/src/main/java/org/opendaylight/controller/forwarding/staticrouting/northbound/StaticRoutingNorthbound.java
opendaylight/adsal/northbound/statistics/src/main/java/org/opendaylight/controller/statistics/northbound/StatisticsNorthbound.java
opendaylight/adsal/protocol_plugins/stub/src/main/java/org/opendaylight/controller/protocol_plugins/stub/internal/StubNodeFactory.java
opendaylight/adsal/sal/connection/implementation/src/main/java/org/opendaylight/controller/sal/connection/implementation/internal/ConnectionService.java
opendaylight/adsal/samples/loadbalancer/src/main/java/org/opendaylight/controller/samples/loadbalancer/ConfigManager.java
opendaylight/adsal/samples/loadbalancer/src/main/java/org/opendaylight/controller/samples/loadbalancer/internal/LoadBalancerService.java
opendaylight/adsal/usermanager/implementation/src/main/java/org/opendaylight/controller/usermanager/internal/UserManager.java
opendaylight/commons/liblldp/src/main/java/org/opendaylight/controller/liblldp/BitBufferHelper.java
opendaylight/commons/liblldp/src/main/java/org/opendaylight/controller/liblldp/DataLinkAddress.java
opendaylight/commons/liblldp/src/main/java/org/opendaylight/controller/liblldp/EthernetAddress.java
opendaylight/config/config-persister-file-xml-adapter/src/main/java/org/opendaylight/controller/config/persist/storage/file/xml/XmlFileStorageAdapter.java
opendaylight/config/config-persister-file-xml-adapter/src/main/java/org/opendaylight/controller/config/persist/storage/file/xml/model/Config.java
opendaylight/config/logback-config/src/main/java/org/opendaylight/controller/config/yang/logback/config/LogbackStatusListener.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/JMXGenerator.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/GeneralClassTemplate.java
opendaylight/config/yang-jmx-generator-plugin/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/ftl/TemplateFactory.java
opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/Dependency.java
opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/attribute/JavaAttribute.java
opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/util/FullyQualifiedNameHelper.java
opendaylight/md-sal/sal-common-impl/src/main/java/org/opendaylight/controller/md/sal/common/impl/AbstractDataModification.java
opendaylight/md-sal/sal-common-impl/src/main/java/org/opendaylight/controller/md/sal/common/impl/routing/RoutingUtils.java
opendaylight/md-sal/sal-common-util/src/main/java/org/opendaylight/controller/sal/common/util/Arguments.java
opendaylight/md-sal/sal-dom-xsql/src/main/java/org/opendaylight/controller/md/sal/dom/xsql/XSQLBluePrint.java
opendaylight/md-sal/sal-dom-xsql/src/main/java/org/opendaylight/controller/md/sal/dom/xsql/XSQLBluePrintNode.java
opendaylight/md-sal/sal-dom-xsql/src/main/java/org/opendaylight/controller/md/sal/dom/xsql/jdbc/JDBCConnection.java
opendaylight/md-sal/sal-dom-xsql/src/main/java/org/opendaylight/controller/md/sal/dom/xsql/jdbc/JDBCResultSet.java
opendaylight/md-sal/sal-dom-xsql/src/main/java/org/opendaylight/controller/md/sal/dom/xsql/jdbc/JDBCServer.java
opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NetconfStateSchemas.java
opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/util/RemoteDeviceId.java
opendaylight/md-sal/sal-rest-docgen/src/main/java/org/opendaylight/controller/sal/rest/doc/DocProvider.java
opendaylight/md-sal/statistics-manager/src/main/java/org/opendaylight/controller/md/statistics/manager/impl/helper/FlowComparator.java
opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/transactions/TransactionProvider.java
opendaylight/netconf/config-persister-impl/src/main/java/org/opendaylight/controller/netconf/persist/impl/ConfigPersisterNotificationHandler.java

index e34eb329330d2e1b30ee72aac6950f2084894777..4febcd07c1b5bade9393e58dbf034c16e783c606 100644 (file)
@@ -457,7 +457,9 @@ public class ClusterManager implements IClusterServices {
             return null;
         }
         for (String cacheName : manager.getCacheNames()) {
-            if (!manager.isRunning(cacheName)) continue;
+            if (!manager.isRunning(cacheName)) {
+                continue;
+            }
             if (cacheName.startsWith("{" + containerName + "}_")) {
                 String[] res = cacheName.split("[{}]");
                 if (res.length >= 4 && res[1].equals(containerName)
index b8b54b45ba8d10cac4cea25e4f0139bb2ee1c5f1..a6314e06957ce17de1ea62ed0824743ae70b96ee 100644 (file)
@@ -42,18 +42,23 @@ public class IPHostId implements IHostId, Serializable {
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
+        if (this == obj) {
             return true;
-        if (obj == null)
+        }
+        if (obj == null) {
             return false;
-        if (getClass() != obj.getClass())
+        }
+        if (getClass() != obj.getClass()) {
             return false;
+        }
         IPHostId other = (IPHostId) obj;
         if (ipAddress == null) {
-            if (other.ipAddress != null)
+            if (other.ipAddress != null) {
                 return false;
-        } else if (!ipAddress.equals(other.ipAddress))
+            }
+        } else if (!ipAddress.equals(other.ipAddress)) {
             return false;
+        }
         return true;
     }
 
index e10c5d1a78310e5bc1f81393a7899ec4aefab0c2..19f3f585b197cb7a81dea5804e5e0524c77d7a5d 100644 (file)
@@ -56,23 +56,30 @@ public class IPMacHostId implements IHostId, Serializable {
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
+        if (this == obj) {
             return true;
-        if (obj == null)
+        }
+        if (obj == null) {
             return false;
-        if (getClass() != obj.getClass())
+        }
+        if (getClass() != obj.getClass()) {
             return false;
+        }
         IPMacHostId other = (IPMacHostId) obj;
         if (ipAddress == null) {
-            if (other.ipAddress != null)
+            if (other.ipAddress != null) {
                 return false;
-        } else if (!ipAddress.equals(other.ipAddress))
+            }
+        } else if (!ipAddress.equals(other.ipAddress)) {
             return false;
+        }
         if (macAddr == null) {
-            if (other.macAddr != null)
+            if (other.macAddr != null) {
                 return false;
-        } else if (!macAddr.equals(other.macAddr))
+            }
+        } else if (!macAddr.equals(other.macAddr)) {
             return false;
+        }
         return true;
     }
 
index a1d29dd27fe014696db69b0e08cadff297465d3b..59b4a084642e8c0be3e0b7262ea622e56f5361de 100644 (file)
@@ -44,8 +44,9 @@ public class HostTrackerCallable implements Callable<HostNodeConnector> {
     @Override
     public HostNodeConnector call() throws Exception {
         HostNodeConnector h = hostTracker.hostFind(trackedHost);
-        if (h != null)
+        if (h != null) {
             return h;
+        }
         hostTracker.setCallableOnPendingARP(trackedHost, this);
         Thread.sleep(2000); // wait 2sec to see if the host responds
         return hostTracker.hostQuery(trackedHost);
index 69c81242d99c1ace9cc2ebdbb8a9fd47d9ca07c8..abe8618d9b58558b4d48ea56c6fa8df0a3f07a1e 100644 (file)
@@ -38,7 +38,9 @@ public class Activator extends ComponentActivatorAbstractBase {
 
     @Override
     protected void configureGlobalInstance(Component c, Object imp) {
-        if (!imp.equals(BundleScanServiceImpl.class)) return;
+        if (!imp.equals(BundleScanServiceImpl.class)) {
+            return;
+        }
         // export service
         c.setInterface(
                 new String[] { IBundleScanService.class.getName() },
index 9cb1cb52ed36e0e8d2de80b84cc59620eb9f5430..31c81dab7ecd7c558e885f17b70d58aad756bbf0 100644 (file)
@@ -73,10 +73,14 @@ import org.slf4j.LoggerFactory;
     }
 
     private boolean matches(Pattern pattern, Set<String> values) {
-        if (pattern == null) return true;
+        if (pattern == null) {
+            return true;
+        }
         //LOGGER.debug("Matching: {} {}", pattern.toString(), values);
         for (String s : values) {
-            if (pattern.matcher(s).find()) return true;
+            if (pattern.matcher(s).find()) {
+                return true;
+            }
         }
         return false;
     }
@@ -130,7 +134,9 @@ import org.slf4j.LoggerFactory;
             Bundle initBundle, Set<String> excludes)
     {
         for (BundleInfo other : bundlesToScan) {
-            if (other.getId() == target.getId()) continue;
+            if (other.getId() == target.getId()) {
+                continue;
+            }
             if (target.isDependantOn(other)) {
                 if (!visited.contains(other)) {
                     classes.addAll(BundleScanner.loadClasses(
@@ -146,7 +152,9 @@ import org.slf4j.LoggerFactory;
 
     private boolean isDependantOn(BundleInfo other) {
         for (String pkg : importPkgs) {
-            if (other.exportPkgs.contains(pkg)) return true;
+            if (other.exportPkgs.contains(pkg)) {
+                return true;
+            }
         }
         return false;
     }
@@ -154,14 +162,18 @@ import org.slf4j.LoggerFactory;
     public List<BundleInfo> getDependencies(Collection<BundleInfo> bundles) {
         List<BundleInfo> result = new ArrayList<BundleInfo>();
         for(BundleInfo bundle : bundles) {
-            if (isDependantOn(bundle)) result.add(bundle);
+            if (isDependantOn(bundle)) {
+                result.add(bundle);
+            }
         }
         return result;
     }
 
 
     private static Set<String> parsePackages(String packageString) {
-        if (packageString == null) return Collections.emptySet();
+        if (packageString == null) {
+            return Collections.emptySet();
+        }
         String[] packages = packageString.split(",");
         Set<String> result = new HashSet<String>();
         for (int i=0; i<packages.length; i++) {
index 2fee2720c2197d5af35ec0c839ad44f5df631942..f6b604d8b68ee304a85a40c524839a01a545a670 100644 (file)
@@ -72,7 +72,9 @@ import org.slf4j.LoggerFactory;
             boolean includeDependentBundleClasses)
     {
         BundleInfo info = bundleAnnotations.get(context.getBundle().getBundleId());
-        if (info == null) return Collections.emptyList();
+        if (info == null) {
+            return Collections.emptyList();
+        }
         Pattern pattern = mergePatterns(annotations, false);
         List<Class<?>> result = null;
         if (includeDependentBundleClasses) {
@@ -254,7 +256,9 @@ import org.slf4j.LoggerFactory;
         StringBuilder errors = new StringBuilder();
         for (String name : annotatedClasses) {
             try {
-                if (excludes != null && excludes.contains(name)) continue;
+                if (excludes != null && excludes.contains(name)) {
+                    continue;
+                }
                 result.add(initBundle.loadClass(name));
             } catch (ClassNotFoundException e) {
                 errors.append(name).append(", ");
@@ -276,7 +280,9 @@ import org.slf4j.LoggerFactory;
             if (c.endsWith("*")) {
                 c = c.substring(0, c.length() - 1);
             }
-            if (regex.length() > 0) regex.append("|");
+            if (regex.length() > 0) {
+                regex.append("|");
+            }
             regex.append("^");
             if (convert2signature) {
                 regex.append("L").append(c.replaceAll("\\.", "/"));
@@ -291,12 +297,16 @@ import org.slf4j.LoggerFactory;
     }
 
     private void validate(List<Class<?>> classes) {
-        if (classes == null || classes.size() == 0) return;
+        if (classes == null || classes.size() == 0) {
+            return;
+        }
         Map<String,String> names = new HashMap<String,String>();
         StringBuilder conflictsMsg = new StringBuilder();
         for (Class<?> c : classes) {
             XmlRootElement root = c.getAnnotation(XmlRootElement.class);
-            if (root == null) continue;
+            if (root == null) {
+                continue;
+            }
             String rootName = root.name();
             if ("##default".equals(rootName)) {
                 String clsName = c.getSimpleName();
index dde3210928689278af7d7f2e3103b0e78c114b47..3f64b07ab6d61dd52168c16e9f1739590cb5fd27 100644 (file)
@@ -62,7 +62,9 @@ public class ConnectionManagerNorthbound {
     }
     @Context
     public void setSecurityContext(SecurityContext context) {
-        if (context != null && context.getUserPrincipal() != null) username = context.getUserPrincipal().getName();
+        if (context != null && context.getUserPrincipal() != null) {
+            username = context.getUserPrincipal().getName();
+        }
     }
     protected String getUserName() {
         return username;
index d7579c82e10bdd378dd603bfee9c4fde1d0ad414..3769cc7818e8e2268dc0f1a11f07cad8f5103ff8 100644 (file)
@@ -83,7 +83,9 @@ public class HostTrackerNorthbound {
 
     @Context
     public void setSecurityContext(SecurityContext context) {
-        if (context != null && context.getUserPrincipal() != null) username = context.getUserPrincipal().getName();
+        if (context != null && context.getUserPrincipal() != null) {
+            username = context.getUserPrincipal().getName();
+        }
     }
 
     protected String getUserName() {
index 9ddba67e251360996d6c72e50ad81e271c1c0f65..8aea7e57f8805ef7954cc69e30304981d52a6905 100644 (file)
@@ -54,7 +54,9 @@ public class BridgeDomainNorthbound {
 
     @Context
     public void setSecurityContext(SecurityContext context) {
-        if (context != null && context.getUserPrincipal() != null) username = context.getUserPrincipal().getName();
+        if (context != null && context.getUserPrincipal() != null) {
+          username = context.getUserPrincipal().getName();
+        }
     }
     protected String getUserName() {
         return username;
index 20f6cb40a56cb812fa5370a5dd01cc6bf2ef85e8..de291d6d9647c6536558c91fc246c3cab75ac3a9 100644 (file)
@@ -88,7 +88,9 @@ public class StaticRoutingNorthbound {
 
     @Context
     public void setSecurityContext(SecurityContext context) {
-        if (context != null && context.getUserPrincipal() != null) username = context.getUserPrincipal().getName();
+        if (context != null && context.getUserPrincipal() != null) {
+            username = context.getUserPrincipal().getName();
+        }
     }
     protected String getUserName() {
         return username;
index 4175f1e3c49984c7d90ac03b2207df946c9f7e3a..ad9d1269e50d26dde72dd579d4eaa51d00447d4b 100644 (file)
@@ -70,7 +70,9 @@ public class StatisticsNorthbound {
     }
     @Context
     public void setSecurityContext(SecurityContext context) {
-        if (context != null && context.getUserPrincipal() != null) username = context.getUserPrincipal().getName();
+        if (context != null && context.getUserPrincipal() != null) {
+            username = context.getUserPrincipal().getName();
+        }
     }
 
     protected String getUserName() {
index c5a9de3032bc15d4ccd20f4c47460d4d3bfffeb6..439519fa41b6492aa20846a1c95baa36a359e002 100644 (file)
@@ -11,45 +11,44 @@ import org.opendaylight.controller.sal.core.ConstructionException;
 import org.opendaylight.controller.sal.utils.INodeFactory;
 import org.opendaylight.controller.sal.core.Node;
 
-public class StubNodeFactory implements INodeFactory
-    {
-      void init() {
-      }
+public class StubNodeFactory implements INodeFactory {
+    void init() {
+    }
 
-      /**
-       * Function called by the dependency manager when at least one dependency
-       * become unsatisfied or when the component is shutting down because for
-       * example bundle is being stopped.
-       *
-       */
-      void destroy() {
-      }
+    /**
+     * Function called by the dependency manager when at least one dependency
+     * become unsatisfied or when the component is shutting down because for
+     * example bundle is being stopped.
+     *
+     */
+    void destroy() {
+    }
 
-      /**
-       * Function called by dependency manager after "init ()" is called and after
-       * the services provided by the class are registered in the service registry
-       *
-       */
-      void start() {
-      }
+    /**
+     * Function called by dependency manager after "init ()" is called and after
+     * the services provided by the class are registered in the service registry
+     *
+     */
+    void start() {
+    }
 
-      /**
-       * Function called by the dependency manager before the services exported by
-       * the component are unregistered, this will be followed by a "destroy ()"
-       * calls
-       *
-       */
-      void stop() {
-      }
+    /**
+     * Function called by the dependency manager before the services exported by
+     * the component are unregistered, this will be followed by a "destroy ()"
+     * calls
+     *
+     */
+    void stop() {
+    }
 
-      public Node fromString(String nodeType, String nodeId){
-          if(nodeType.equals("STUB"))
-              try{
-                  return new Node("STUB", Integer.parseInt(nodeId));
-              } catch(ConstructionException e)
-              {
-                  return null;
-              }
-          return null;
-      }
+    public Node fromString(String nodeType, String nodeId){
+        if(nodeType.equals("STUB")) {
+            try {
+                return new Node("STUB", Integer.parseInt(nodeId));
+            } catch(ConstructionException e) {
+                return null;
+            }
+        }
+        return null;
+    }
 }
index 5a637b79991fa26553e0b902571c2ecd311b7b40..c73607ae837ba6f24092ebaa2a7f272e227e0fa1 100644 (file)
@@ -103,7 +103,9 @@ public class ConnectionService implements IPluginOutConnectionService, IConnecti
 
     @Override
     public ConnectionLocality getLocalityStatus(Node node) {
-        if (this.connectionListener == null) return ConnectionLocality.NOT_CONNECTED;
+        if (this.connectionListener == null) {
+            return ConnectionLocality.NOT_CONNECTED;
+        }
         return connectionListener.getLocalityStatus(node);
     }
 
@@ -133,7 +135,9 @@ public class ConnectionService implements IPluginOutConnectionService, IConnecti
     @Override
     public Status disconnect(Node node) {
         IPluginInConnectionService s = pluginService.get(node.getType());
-        if (s != null) return s.disconnect(node);
+        if (s != null) {
+            return s.disconnect(node);
+        }
         return new Status(StatusCode.NOTFOUND);
     }
 
index 77d03aa1223abf829171a53f7682d4f8080ebcc5..e7b261c8a2527be1c133983fc32ea1b12c2bdbcb 100644 (file)
@@ -176,17 +176,19 @@ public class ConfigManager implements IConfigManager{
 
     @Override
     public boolean memberExists(String name, String poolName) {
-        if(this.pools.containsKey(poolName)){
-            if(this.pools.get(poolName).getMember(name) != null )
+        if (this.pools.containsKey(poolName)) {
+            if (this.pools.get(poolName).getMember(name) != null) {
                 return true;
+            }
         }
         return false;
     }
 
     @Override
-    public boolean memberExists(String name, String memberIP,String poolName){
-        if(!this.pools.containsKey(poolName))
+    public boolean memberExists(String name, String memberIP,String poolName) {
+        if (!this.pools.containsKey(poolName)) {
             return false;
+        }
 
         return this.pools.get(poolName).poolMemberExists(new PoolMember(name, memberIP, poolName));
     }
index e1a997b44c010b2b4e8289f4a09f7750e5ee0e6e..b4836e9f170541ffbc628a72c49979fd3596c536 100644 (file)
@@ -146,8 +146,9 @@ public class LoadBalancerService implements IListenDataPacket, IConfigManager {
      * requires
      */
     public String getContainerName() {
-        if (containerName == null)
+        if (containerName == null) {
             return GlobalConstants.DEFAULT.toString();
+        }
         return containerName;
     }
 
index 3f6ac4a8c786af11cb88bf16e4ab0c44ae8b3097..e7394f9262405b1c77f69f76e17db59077d9baae 100644 (file)
@@ -278,7 +278,9 @@ public class UserManager implements IUserManager, IObjectReader,
     private String checkPasswordRecovery() {
         final String fileDescription = "Default Network Administrator password recovery file";
         File recoveryFile = new File(UserManager.RECOVERY_FILE);
-        if (!recoveryFile.exists()) return null;
+        if (!recoveryFile.exists()) {
+            return null;
+        }
         // read the recovery file
         String pwd = null;
         try {
index 3eae43212f98bafb58f30d63fb0169a15758176c..fc515e109d1abebf95168f081ef289612648dda8 100644 (file)
@@ -359,8 +359,9 @@ public abstract class BitBufferHelper {
         int value = 0;
         for (int i = 0; i < length; i++) {
             value = array[i];
-            if (value < 0)
+            if (value < 0) {
                 value += 256;
+            }
             ret = ret
                     | (long) ((long) value << ((length - i - 1) * NetUtils.NumBitsInAByte));
         }
@@ -390,8 +391,9 @@ public abstract class BitBufferHelper {
 
         for (int i = startOffset; i < array.length; i++) {
             value = array[i];
-            if (value < 0)
+            if (value < 0) {
                 value += 256;
+            }
             ret = ret
                     | (long) ((long) value << ((array.length - i - 1) * NetUtils.NumBitsInAByte));
         }
@@ -637,8 +639,9 @@ public abstract class BitBufferHelper {
             }
         } else {
             for (i = 0; i < numBytes; i++) {
-                if (i != 0)
+                if (i != 0) {
                     InputLSBbits = (inputdata[i - 1] & getLSBMask(extraOffsetBits));
+                }
                 InputMSBbits = (byte) (inputdata[i] & (getMSBMask(NetUtils.NumBitsInAByte
                         - extraOffsetBits)));
                 InputMSBbits = (InputMSBbits >= 0) ? InputMSBbits
@@ -648,16 +651,18 @@ public abstract class BitBufferHelper {
                 InputMSBbits = InputLSBbits = 0;
             }
             if (RestBits < (NetUtils.NumBitsInAByte - extraOffsetBits)) {
-                if (numBytes != 0)
+                if (numBytes != 0) {
                     InputLSBbits = (inputdata[i - 1] & getLSBMask(extraOffsetBits));
+                }
                 InputMSBbits = (byte) (inputdata[i] & (getMSBMask(RestBits)));
                 InputMSBbits = (InputMSBbits >= 0) ? InputMSBbits
                         : InputMSBbits + 256;
                 data[startByteOffset + i] = (byte) ((data[startByteOffset + i])
                         | (InputLSBbits << (NetUtils.NumBitsInAByte - extraOffsetBits)) | (InputMSBbits >> extraOffsetBits));
             } else if (RestBits == (NetUtils.NumBitsInAByte - extraOffsetBits)) {
-                if (numBytes != 0)
+                if (numBytes != 0) {
                     InputLSBbits = (inputdata[i - 1] & getLSBMask(extraOffsetBits));
+                }
                 InputMSBbits = (byte) (inputdata[i] & (getMSBMask(NetUtils.NumBitsInAByte
                         - extraOffsetBits)));
                 InputMSBbits = (InputMSBbits >= 0) ? InputMSBbits
@@ -665,8 +670,9 @@ public abstract class BitBufferHelper {
                 data[startByteOffset + i] = (byte) (data[startByteOffset + i]
                         | (InputLSBbits << (NetUtils.NumBitsInAByte - extraOffsetBits)) | (InputMSBbits >> extraOffsetBits));
             } else {
-                if (numBytes != 0)
+                if (numBytes != 0) {
                     InputLSBbits = (inputdata[i - 1] & getLSBMask(extraOffsetBits));
+                }
                 InputMSBbits = (byte) (inputdata[i] & (getMSBMask(NetUtils.NumBitsInAByte
                         - extraOffsetBits)));
                 InputMSBbits = (InputMSBbits >= 0) ? InputMSBbits
index d617c05a5a941afe3ebb2f9b2484535835c0d6f7..cf56aebe6085dd0f8db9b4f68f5629666c3212b6 100644 (file)
@@ -74,18 +74,23 @@ abstract public class DataLinkAddress implements Serializable {
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
+        if (this == obj) {
             return true;
-        if (obj == null)
+        }
+        if (obj == null) {
             return false;
-        if (getClass() != obj.getClass())
+        }
+        if (getClass() != obj.getClass()) {
             return false;
+        }
         DataLinkAddress other = (DataLinkAddress) obj;
         if (name == null) {
-            if (other.name != null)
+            if (other.name != null) {
                 return false;
-        } else if (!name.equals(other.name))
+            }
+        } else if (!name.equals(other.name)) {
             return false;
+        }
         return true;
     }
 
index b7b72cbffd45aec28c384872d61147149c13f41c..8c5f8b9ffd4d184df0143bae647e990d81daac61 100644 (file)
@@ -99,15 +99,19 @@ public class EthernetAddress extends DataLinkAddress {
 
     @Override
     public boolean equals(Object obj) {
-        if (this == obj)
+        if (this == obj) {
             return true;
-        if (!super.equals(obj))
+        }
+        if (!super.equals(obj)) {
             return false;
-        if (getClass() != obj.getClass())
+        }
+        if (getClass() != obj.getClass()) {
             return false;
+        }
         EthernetAddress other = (EthernetAddress) obj;
-        if (!Arrays.equals(macAddress, other.macAddress))
+        if (!Arrays.equals(macAddress, other.macAddress)) {
             return false;
+        }
         return true;
     }
 
index 7badc4b294679d6cd88a1d15169c13ca369dc101..8bd420865cea058b89d141883028c70db1882925 100644 (file)
@@ -52,8 +52,9 @@ public class XmlFileStorageAdapter implements StorageAdapter, Persister {
             LOG.debug("Storage file does not exist, creating empty file");
             try {
                 boolean result = storage.createNewFile();
-                if (result == false)
+                if (result == false) {
                     throw new RuntimeException("Unable to create storage file " + storage);
+                }
             } catch (IOException e) {
                 throw new RuntimeException("Unable to create storage file " + storage, e);
             }
index 354c8c0540ea69330375e96051aadc67f76f8635..e629d20db52e0c2c65bf26c76aeb1e2dbce62eff 100644 (file)
@@ -65,8 +65,9 @@ public final class Config {
     }
 
     public static Config fromXml(File from) {
-        if(isEmpty(from))
+        if(isEmpty(from)) {
             return new Config();
+        }
 
         try {
             JAXBContext jaxbContext = JAXBContext.newInstance(Config.class);
index 8111136cfcdfedcd71a9316bf59c5c074e194cf8..720f33d79409f7845ee39b2d38ad73f562f5f2db 100644 (file)
@@ -106,8 +106,9 @@ public class LogbackStatusListener implements StatusListener, LogbackRuntimeMXBe
 
     @Override
     public void close() throws IOException {
-        if (reg != null)
+        if (reg != null) {
             reg.close();
+        }
         unregisterFromLogback();
     }
 
index 3cbbb28ab4f270e02f7344dc852252f0559b67e7..9ad8d2826f81e444e6cbf4efaea6d31be3bb3bc9 100644 (file)
@@ -253,9 +253,10 @@ public class JMXGenerator implements CodeGenerator {
     public void setMavenProject(MavenProject project) {
         this.projectBaseDir = project.getBasedir();
 
-        if (LOG != null)
+        if (LOG != null) {
             LOG.debug(getClass().getCanonicalName(), " project base dir: ",
                     projectBaseDir);
+        }
     }
 
     @VisibleForTesting
index 1576c9ddb0b117cfd96117e62cbea8f324ad37a7..3f4917f2ffcc3bab9fb7014d763aa9b0ccdb87da 100644 (file)
@@ -38,9 +38,10 @@ public class GeneralClassTemplate extends AbstractFtlTemplate {
     }
 
     static List<String> checkCardinality(List<String> extendedClass) {
-        if (extendedClass.size() > 1)
+        if (extendedClass.size() > 1) {
             throw new IllegalArgumentException(
                     "Class cannot have more than one super " + "class");
+        }
         return extendedClass;
     }
 
index 942def02c03a3c44b00cce93a77bd7acde0f69bc..53ab4ef335973029568f0820968c830d59112f17 100644 (file)
@@ -166,10 +166,11 @@ public class TemplateFactory {
                 Lists.<MethodDeclaration> newArrayList());
         sieTemplate.setJavadoc(sie.getNullableDescription());
 
-        if (sie.getNullableDescription() != null)
+        if (sie.getNullableDescription() != null) {
             sieTemplate.getAnnotations().add(
                     Annotation.createDescriptionAnnotation(sie
                             .getNullableDescription()));
+        }
         sieTemplate.getAnnotations().addAll(Annotation.createSieAnnotations(sie));
 
         return sieTemplate;
@@ -223,10 +224,11 @@ public class TemplateFactory {
                 attrProcessor.getMethods(), generateRuntime,
                 registratorFullyQualifiedName);
 
-        if (mbe.getNullableDescription() != null)
+        if (mbe.getNullableDescription() != null) {
             abstractModuleTemplate.getAnnotations().add(
                     Annotation.createDescriptionAnnotation(mbe
                             .getNullableDescription()));
+        }
         return abstractModuleTemplate;
     }
 
@@ -687,8 +689,9 @@ public class TemplateFactory {
 
 
     private static boolean needsDepResolver(AttributeIfc value) {
-        if(value instanceof TOAttribute)
+        if(value instanceof TOAttribute) {
             return true;
+        }
         if(value instanceof ListAttribute) {
             AttributeIfc innerAttribute = ((ListAttribute) value).getInnerAttribute();
             return needsDepResolver(innerAttribute);
index 6ea2ea17243b4e5580e48fccc97eb77360ca6a31..fd07e269f4abdd9ed89d14893b2ffaa482eabc7e 100644 (file)
@@ -28,17 +28,21 @@ public class Dependency {
 
     @Override
     public boolean equals(Object o) {
-        if (this == o)
+        if (this == o) {
             return true;
-        if (o == null || getClass() != o.getClass())
+        }
+        if (o == null || getClass() != o.getClass()) {
             return false;
+        }
 
         Dependency that = (Dependency) o;
 
-        if (mandatory != that.mandatory)
+        if (mandatory != that.mandatory) {
             return false;
-        if (!sie.equals(that.sie))
+        }
+        if (!sie.equals(that.sie)) {
             return false;
+        }
 
         return true;
     }
index e13c22a2ab77cf02267cac1e9a088a03ad36d090..f6ce92d5069be1adbd02050176652790def8af95 100644 (file)
@@ -281,8 +281,9 @@ public class JavaAttribute extends AbstractAttribute implements TypedAttribute {
 
     // TODO verify
     private boolean isPrimitive(String innerTypeFullyQName) {
-        if (innerTypeFullyQName.contains("."))
+        if (innerTypeFullyQName.contains(".")) {
             return false;
+        }
 
         return true;
     }
index 966aff96a050ecc2ba0e48f1d6a27736ddd861d4..7c3ebb59167f2d04881974a433a0ee546cd31aa0 100644 (file)
@@ -14,8 +14,9 @@ public class FullyQualifiedNameHelper {
 
     public static String getFullyQualifiedName(String packageName,
             String className) {
-        if (packageName.isEmpty())
+        if (packageName.isEmpty()) {
             return className;
+        }
         return packageName + "." + className;
     }
 }
index 8950b3c849fe8ed3534feddf186413a6dadaed05..1d3967f94d0b0883cfbaea548745dfa2a92fb01b 100644 (file)
@@ -104,8 +104,9 @@ public abstract class AbstractDataModification<P extends Path<P>, D> implements
     }
 
     private final void checkMutable() {
-        if (!NEW.equals(this.getStatus()))
+        if (!NEW.equals(this.getStatus())) {
             throw new IllegalStateException("Transaction was already submitted");
+        }
     }
 
     @Override
index 9001aaa4dede9ded757c68b737446ea11a09db79..0672ba2b6da5162abb2d6b3039308323c3245759 100644 (file)
@@ -80,16 +80,19 @@ public class RoutingUtils {
             }
             RouteChangeImpl<?, ?> other = (RouteChangeImpl<?, ?>) obj;
             if (announcement == null) {
-                if (other.announcement != null)
+                if (other.announcement != null) {
                     return false;
-            } else if (!announcement.equals(other.announcement))
+                }
+            } else if (!announcement.equals(other.announcement)) {
                 return false;
+            }
             if (removal == null) {
                 if (other.removal != null) {
                     return false;
                 }
-            } else if (!removal.equals(other.removal))
+            } else if (!removal.equals(other.removal)) {
                 return false;
+            }
             return true;
         }
     }
index a4017c23a89df0b4099f193e6cef4f44c2f281f9..17ce5dffcf0b97ea18c86774da3acaee428ee6ae 100644 (file)
@@ -23,8 +23,9 @@ public final class Arguments {
      */
     @SuppressWarnings("unchecked")
     public static <T> T checkInstanceOf(Object value, Class<T> type) {
-        if(!type.isInstance(value))
+        if(!type.isInstance(value)) {
             throw new IllegalArgumentException(String.format("Value %s is not of type %s", value, type));
+        }
         return (T) value;
     }
 }
index 867c7a47b5af6996c802394e98735e34a47a56c0..a9c0f69fc6e3e8e58166fff6373327a8b91b82e7 100644 (file)
@@ -114,8 +114,9 @@ public class XSQLBluePrint implements DatabaseMetaData, Serializable {
             String odlTableName) {
         Map<String, XSQLBluePrintNode> map = this.odlNameToBluePrint
                 .get(odlTableName);
-        if (map == null)
+        if (map == null) {
             return null;
+        }
         return map.values().toArray(new XSQLBluePrintNode[map.size()]);
     }
 
index 8e9ed3a26b804a4da028e75849d69a8387352e33..4a565452388648b14719df92e97ec5e412c3d416 100644 (file)
@@ -240,12 +240,15 @@ public class XSQLBluePrintNode implements Serializable {
         XSQLBluePrintNode other = (XSQLBluePrintNode) obj;
         if (odlNode != null) {
             return getBluePrintNodeName().equals(other.getBluePrintNodeName());
-        } else if (this.odlTableName == null && other.odlTableName != null)
+        } else if (this.odlTableName == null && other.odlTableName != null) {
             return false;
-        if (this.odlTableName != null && other.odlTableName == null)
+        }
+        if (this.odlTableName != null && other.odlTableName == null) {
             return false;
-        else
+        }
+        else {
             return this.odlTableName.equals(other.odlTableName);
+        }
     }
 
     @Override
index bf1244f2e3cd90787984105d5395cb7df3c9e853..137631f611051c36f2cca6db1e0cafa846c2724a 100644 (file)
@@ -73,8 +73,9 @@ public class JDBCConnection implements Connection, Runnable {
     }
 
     private void init() throws Exception {
-        if (addr.startsWith("http://"))
+        if (addr.startsWith("http://")) {
             addr = addr.substring(7);
+        }
         System.err.print("Address is:" + addr);
         socket = new Socket(addr, 40004);
         try {
index 37eacd5595975404a03cbf0390e12994d65bbe8c..d37fdb8819b9d037356a7c38b525fbe8bc6e3074 100644 (file)
@@ -66,16 +66,18 @@ public class JDBCResultSet implements Serializable, ResultSet,
     }
 
     public JDBCResultSet addSubQuery(String _sql,String logicalName) {
-        if(subQueries == null)
+        if (subQueries == null) {
             subQueries = new HashMap<String,JDBCResultSet>();
+        }
         JDBCResultSet rs = new JDBCResultSet(_sql);
         this.subQueries.put(logicalName,rs);
         return rs;
     }
 
     public Map<String,JDBCResultSet> getSubQueries() {
-        if(this.subQueries==null)
+        if (this.subQueries==null) {
             this.subQueries = new HashMap<>();
+        }
         return this.subQueries;
     }
 
@@ -381,13 +383,15 @@ public class JDBCResultSet implements Serializable, ResultSet,
         for (Object child : children) {
 
             String odlNodeName = XSQLODLUtils.getNodeIdentiofier(child);
-            if (odlNodeName == null)
+            if (odlNodeName == null) {
                 continue;
+            }
 
             XSQLBluePrintNode eNodes[] = bluePrint
                     .getBluePrintNodeByODLTableName(odlNodeName);
-            if (eNodes == null)
+            if (eNodes == null) {
                 continue;
+            }
 
             boolean match = false;
             for (XSQLBluePrintNode enode : eNodes) {
@@ -397,8 +401,9 @@ public class JDBCResultSet implements Serializable, ResultSet,
                 }
             }
 
-            if (!match)
+            if (!match) {
                 continue;
+            }
 
             if (child.getClass().getName().endsWith("ImmutableContainerNode")) {
                 result.add(child);
@@ -466,8 +471,9 @@ public class JDBCResultSet implements Serializable, ResultSet,
                     for (XSQLBluePrintNode eNode : eNodes) {
                         bpn = this.tablesInQueryMap.get(eNode
                                 .getBluePrintNodeName());
-                        if (bpn != null)
+                        if (bpn != null) {
                             break;
+                        }
                     }
                     boolean isObjectInCriteria = true;
                     if (bpn != null) {
@@ -482,8 +488,9 @@ public class JDBCResultSet implements Serializable, ResultSet,
 
                     if (isObjectInCriteria) {
                         if (root) {
-                            if (!rec.data.isEmpty())
+                            if (!rec.data.isEmpty()) {
                                 addRecord(rec.data);
+                            }
                         } else {
                             result.add(rec);
                         }
index b348d8fda8b64da5509c39346e976e59b453ed99..7b2733ccf784dbf0784cf316ac4d3343d3705f45 100644 (file)
@@ -193,10 +193,12 @@ public class JDBCServer extends Thread {
             int braketCount = 0;
             int endSubQuery = startSubQuery;
             do {
-                if (sql.charAt(endSubQuery) == '(')
+                if (sql.charAt(endSubQuery) == '(') {
                     braketCount++;
-                else if (sql.charAt(endSubQuery) == ')')
+                }
+                else if (sql.charAt(endSubQuery) == ')') {
                     braketCount--;
+                }
                 endSubQuery++;
             } while (braketCount > 0 || endSubQuery == sql.length());
             String subQuerySQL = sql.substring(startSubQuery + 1,endSubQuery - 1);
@@ -338,8 +340,9 @@ public class JDBCServer extends Thread {
             whereTo = order;
         }
 
-        if(whereTo==-1)
+        if(whereTo==-1) {
             whereTo=lowSQL.length();
+        }
 
         String whereStatement = rs.getSQL().substring(where + 5, whereTo)
                 .trim();
index e0b774f53c9008e3d8bd25772128e770b247419a..d758073a8e5839e942669428239b72d444e646d2 100644 (file)
@@ -213,12 +213,18 @@ public final class NetconfStateSchemas {
 
         @Override
         public boolean equals(final Object o) {
-            if (this == o) return true;
-            if (o == null || getClass() != o.getClass()) return false;
+            if (this == o) {
+                return true;
+            }
+            if (o == null || getClass() != o.getClass()) {
+                return false;
+            }
 
             final RemoteYangSchema that = (RemoteYangSchema) o;
 
-            if (!qname.equals(that.qname)) return false;
+            if (!qname.equals(that.qname)) {
+                return false;
+            }
 
             return true;
         }
index 175cb8e2077c83df44117e81baa7d0b0cd3ef6ae..333b42e1c5ee794b3816ebd893f851f2f4cbe205 100644 (file)
@@ -71,13 +71,21 @@ public class RemoteDeviceId {
 
     @Override
     public boolean equals(final Object o) {
-        if (this == o) return true;
-        if (!(o instanceof RemoteDeviceId)) return false;
+        if (this == o) {
+            return true;
+        }
+        if (!(o instanceof RemoteDeviceId)) {
+            return false;
+        }
 
         final RemoteDeviceId that = (RemoteDeviceId) o;
 
-        if (!name.equals(that.name)) return false;
-        if (!bindingPath.equals(that.bindingPath)) return false;
+        if (!name.equals(that.name)) {
+            return false;
+        }
+        if (!bindingPath.equals(that.bindingPath)) {
+            return false;
+        }
 
         return true;
     }
index 9442ca0c073b0e6026db7b783cd8f85b2dc36585..c07e9c78be7a24672cbca9a5c75c3ea01cb07d34 100644 (file)
@@ -76,11 +76,13 @@ public class DocProvider implements BundleActivator, ServiceTrackerCustomizer<Br
 
     @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);
index c6205cb13cdaf16f9e767fa5dd77fab693f2b194..ded3197f0f75e8150cfc7843478dbd8cf6ec34ef 100644 (file)
@@ -94,8 +94,12 @@ public final class FlowComparator {
         if (statsFlow == storedFlow) {
             return true;
         }
-        if (storedFlow == null && statsFlow != null) return false;
-        if (statsFlow == null && storedFlow != null) return false;
+        if (storedFlow == null && statsFlow != null) {
+            return false;
+        }
+        if (statsFlow == null && storedFlow != null) {
+            return false;
+        }
         if (storedFlow.getEthernetMatch() == null) {
             if (statsFlow.getEthernetMatch() != null) {
                 return false;
index 2967cf04c49c12cadb327a14ce92bc447480a8d4..b2ee63a987836102fa31ae8c97e8dac899a33198 100644 (file)
@@ -77,8 +77,9 @@ public class TransactionProvider implements AutoCloseable {
     public synchronized ObjectName getOrCreateTransaction() {
         Optional<ObjectName> ta = getTransaction();
 
-        if (ta.isPresent())
+        if (ta.isPresent()) {
             return ta.get();
+        }
         transaction = configRegistryClient.beginConfig();
         allOpenedTransactions.add(transaction);
         return transaction;
index 7618807a0e2b23808cb93e73e99d190e93fdeca4..fe7b3da770fb0b6358f6895e1174c78236320248 100644 (file)
@@ -80,8 +80,9 @@ class ConfigPersisterNotificationListener implements NotificationListener {
 
     @Override
     public void handleNotification(final Notification notification, final Object handback) {
-        if (!(notification instanceof NetconfJMXNotification))
+        if (!(notification instanceof NetconfJMXNotification)) {
             return;
+        }
 
         // Socket should not be closed at this point
         // Activator unregisters this as JMX listener before close is called