findbugs: DM_CONVERT_CASE RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE 00/66700/1
authorIsaku Yamahata <isaku.yamahata@intel.com>
Thu, 21 Dec 2017 05:47:31 +0000 (21:47 -0800)
committerIsaku Yamahata <isaku.yamahata@intel.com>
Thu, 21 Dec 2017 06:16:55 +0000 (22:16 -0800)
Change-Id: Iefb307926b33684f142419da7decbe8702844e52
Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>
neutron-hostconfig/ovs/src/main/java/org/opendaylight/neutron/hostconfig/ovs/NeutronHostconfigOvsListener.java
neutron-hostconfig/vpp/src/main/java/org/opendaylight/neutron/hostconfig/vpp/NeutronHostconfigVppListener.java

index 9135b477f7ad7f5439fa744829bf215ae29281ad..cfeeea34bc6b9ee92a8656e11148cc0dec604c5e 100644 (file)
@@ -12,6 +12,7 @@ import com.google.common.base.Preconditions;
 import com.google.common.collect.Maps;
 
 import java.util.Collection;
+import java.util.Locale;
 import java.util.Map;
 import javax.annotation.Nonnull;
 import javax.annotation.PostConstruct;
@@ -135,11 +136,11 @@ public class NeutronHostconfigOvsListener implements ClusteredDataTreeChangeList
                     // suffix OS_HOST_CONFIG_CONFIG_KEY_PREFIX.length()
                     String hostType = openvswitchExternalIds.getExternalIdKey().substring(
                             OS_HOST_CONFIG_CONFIG_KEY_PREFIX.length());
-                    if (null != hostType && hostType.length() > 0) {
+                    if (hostType.length() > 0) {
                         if (hostType.length() > HOST_TYPE_STR_LEN) {
                             hostType = hostType.substring(0, HOST_TYPE_STR_LEN);
                         }
-                        hostType = "ODL " + hostType.toUpperCase();
+                        hostType = "ODL " + hostType.toUpperCase(Locale.ROOT);
                         if (null != openvswitchExternalIds.getExternalIdValue()) {
                             config.put(hostType, openvswitchExternalIds.getExternalIdValue());
                         }
index 7400ef44f234ad530a23e41ce9eb810c955798c0..fb40b2ac4832fc499198d26a26622aeab78c98ef 100644 (file)
@@ -14,6 +14,7 @@ import java.net.URI;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
@@ -67,7 +68,7 @@ public class NeutronHostconfigVppListener implements ClusteredDataTreeChangeList
     public NeutronHostconfigVppListener(final DataBroker dataBroker, String spath, String sname, String vhostMode) {
         LOG.info("Initializing Neutron-Hostconfig-Vpp-Listener");
         this.dataBroker = Preconditions.checkNotNull(dataBroker);
-        final String vhostModeChecked = Preconditions.checkNotNull(vhostMode).toLowerCase();
+        final String vhostModeChecked = Preconditions.checkNotNull(vhostMode).toLowerCase(Locale.ROOT);
         Preconditions.checkArgument(vhostModeChecked.equals("server") || vhostModeChecked.equals("client"),
                 "Supported values for vhostuser-mode are client and server.");
         this.socketInfo =