Fix findbugs violations in openflowjava
[openflowplugin.git] / openflowjava / openflow-protocol-impl / src / main / java / org / opendaylight / openflowjava / protocol / impl / serialization / factories / MultipartRequestInputFactory.java
index acfdb157f02f02f0aad2853c8579b212cfc08da7..1a7a115bb988a13fa67e738a1286eac97baa0ab3 100644 (file)
@@ -9,6 +9,7 @@
 package org.opendaylight.openflowjava.protocol.impl.serialization.factories;
 
 import io.netty.buffer.ByteBuf;
+import java.nio.charset.StandardCharsets;
 import java.util.List;
 import org.opendaylight.openflowjava.protocol.api.extensibility.OFSerializer;
 import org.opendaylight.openflowjava.protocol.api.extensibility.SerializerRegistry;
@@ -263,8 +264,9 @@ public class MultipartRequestInputFactory implements OFSerializer<MultipartReque
                     output.writeShort(EncodeConstants.EMPTY_LENGTH);
                     output.writeByte(currTableFeature.getTableId());
                     output.writeZero(PADDING_IN_MULTIPART_REQUEST_TABLE_FEATURES_BODY);
-                    output.writeBytes(currTableFeature.getName().getBytes());
-                    output.writeZero(32 - currTableFeature.getName().getBytes().length);
+                    final byte[] nameBytes = currTableFeature.getName().getBytes(StandardCharsets.UTF_8);
+                    output.writeBytes(nameBytes);
+                    output.writeZero(32 - nameBytes.length);
                     output.writeLong(currTableFeature.getMetadataMatch().longValue());
                     output.writeLong(currTableFeature.getMetadataWrite().longValue());
                     output.writeInt(createTableConfigBitmask(currTableFeature.getConfig()));