HIGUCHI Yuta
Committed by Gerrit Code Review

Use StandardCharsets where possible

Change-Id: I7fd997b2ce57ad1704d988e55966bacac954f00a
......@@ -44,7 +44,7 @@ import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.nio.file.NoSuchFileException;
import java.util.List;
import java.util.Locale;
......@@ -213,7 +213,7 @@ public class ApplicationArchive
// Returns the substring of maximum possible length from the specified bytes.
private String substring(byte[] bytes, int length) {
return new String(bytes, 0, Math.min(bytes.length, length), Charset.forName("UTF-8"));
return new String(bytes, 0, Math.min(bytes.length, length), StandardCharsets.UTF_8);
}
/**
......
......@@ -30,7 +30,7 @@
package org.onlab.packet;
import java.nio.ByteBuffer;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
/**
......@@ -124,8 +124,7 @@ public class LLDPOrganizationalTLV extends LLDPTLV {
* @return This LLDP Organizationally Specific TLV.
*/
public LLDPOrganizationalTLV setInfoString(final String infoString) {
final byte[] infoStringBytes = infoString.getBytes(Charset
.forName("UTF-8"));
final byte[] infoStringBytes = infoString.getBytes(StandardCharsets.UTF_8);
return this.setInfoString(infoStringBytes);
}
......