Skip to content

Commit 831447d

Browse files
refactor: replace Charset.forName() with StandardCharsets constants for improved readability (#3122)
1 parent f4e89e2 commit 831447d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

core/src/main/java/feign/Util.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import java.nio.CharBuffer;
3535
import java.nio.charset.CharacterCodingException;
3636
import java.nio.charset.Charset;
37+
import java.nio.charset.StandardCharsets;
3738
import java.util.ArrayList;
3839
import java.util.Arrays;
3940
import java.util.Collection;
@@ -74,11 +75,11 @@ public class Util {
7475
public static final String ENCODING_DEFLATE = "deflate";
7576

7677
/** UTF-8: eight-bit UCS Transformation Format. */
77-
public static final Charset UTF_8 = Charset.forName("UTF-8");
78+
public static final Charset UTF_8 = StandardCharsets.UTF_8;
7879

7980
// com.google.common.base.Charsets
8081
/** ISO-8859-1: ISO Latin Alphabet Number 1 (ISO-LATIN-1). */
81-
public static final Charset ISO_8859_1 = Charset.forName("ISO-8859-1");
82+
public static final Charset ISO_8859_1 = StandardCharsets.ISO_8859_1;
8283

8384
private static final int BUF_SIZE = 0x800; // 2K chars (4K bytes)
8485

0 commit comments

Comments
 (0)