Fix findbugs violations in applications
[openflowplugin.git] / applications / topology-lldp-discovery / src / main / java / org / opendaylight / openflowplugin / applications / topology / lldp / utils / LLDPDiscoveryUtils.java
index 5d39586995d1ed02a801f03193db1a8bcffc55e1..054128e52f5ba755d209e7d72f2d57eb6c9f70c9 100644 (file)
@@ -16,6 +16,7 @@ import com.google.common.hash.Hashing;
 import java.lang.management.ManagementFactory;
 import java.nio.ByteBuffer;
 import java.nio.charset.Charset;
+import java.nio.charset.StandardCharsets;
 import java.security.NoSuchAlgorithmException;
 import java.util.Arrays;
 import java.util.Objects;
@@ -156,7 +157,7 @@ public final class LLDPDiscoveryUtils {
         }
         final String pureValue = nodeConnectorId + finalKey;
 
-        final byte[] pureBytes = pureValue.getBytes();
+        final byte[] pureBytes = pureValue.getBytes(StandardCharsets.UTF_8);
         HashFunction hashFunction = Hashing.md5();
         Hasher hasher = hashFunction.newHasher();
         HashCode hashedValue = hasher.putBytes(pureBytes).hash();