Skip to content

Commit 2f79dc6

Browse files
committed
Prefer StandardCharsets.UTF_8 over custom constant
1 parent 11508b2 commit 2f79dc6

File tree

1 file changed

+2
-3
lines changed
  • modernizer-maven-plugin/src/main/java/org/gaul/modernizer_maven_plugin

1 file changed

+2
-3
lines changed

modernizer-maven-plugin/src/main/java/org/gaul/modernizer_maven_plugin/Utils.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import java.io.IOException;
2222
import java.io.InputStream;
2323
import java.io.InputStreamReader;
24-
import java.nio.charset.Charset;
24+
import java.nio.charset.StandardCharsets;
2525
import java.util.ArrayList;
2626
import java.util.Collection;
2727
import java.util.Collections;
@@ -33,7 +33,6 @@
3333
import org.objectweb.asm.Opcodes;
3434

3535
final class Utils {
36-
static final Charset UTF_8 = Charset.forName("UTF-8");
3736
static final int ASM_API = Opcodes.ASM9;
3837

3938
static <T> T checkNotNull(T reference) {
@@ -77,7 +76,7 @@ static void closeQuietly(Closeable closeable) {
7776
static Collection<String> readAllLines(InputStream is) throws IOException {
7877
Collection<String> lines = new ArrayList<String>();
7978
BufferedReader reader = new BufferedReader(new InputStreamReader(is,
80-
UTF_8));
79+
StandardCharsets.UTF_8));
8180
while (true) {
8281
String line = reader.readLine();
8382
if (line == null) {

0 commit comments

Comments
 (0)