Skip to content

Commit cc3e5fb

Browse files
author
Gary Gregory
committed
Don't use depreacted constants.
1 parent 54858b5 commit cc3e5fb

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/test/java/org/apache/commons/io/FileUtilsTestCase.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
import java.math.BigInteger;
3939
import java.net.URL;
4040
import java.nio.charset.Charset;
41+
import java.nio.charset.StandardCharsets;
4142
import java.nio.file.Files;
4243
import java.util.ArrayList;
4344
import java.util.Arrays;
@@ -2384,11 +2385,11 @@ public void testWriteByteArrayToFile_WithOffsetAndLength_WithAppendOptionTrue_Sh
23842385
final File file = TestUtils.newFile(temporaryFolder, "lines.txt");
23852386
FileUtils.writeStringToFile(file, "This line was there before you...");
23862387

2387-
final byte[] data = "SKIP_THIS_this is brand new data_AND_SKIP_THIS".getBytes(Charsets.UTF_8);
2388+
final byte[] data = "SKIP_THIS_this is brand new data_AND_SKIP_THIS".getBytes(StandardCharsets.UTF_8);
23882389
FileUtils.writeByteArrayToFile(file, data, 10, 22, true);
23892390

23902391
final String expected = "This line was there before you..." + "this is brand new data";
2391-
final String actual = FileUtils.readFileToString(file, Charsets.UTF_8);
2392+
final String actual = FileUtils.readFileToString(file, StandardCharsets.UTF_8);
23922393
assertEquals(expected, actual);
23932394
}
23942395

@@ -2397,11 +2398,11 @@ public void testWriteByteArrayToFile_WithOffsetAndLength_WithAppendOptionTrue_Sh
23972398
final File file = TestUtils.newFile(temporaryFolder, "lines.txt");
23982399
FileUtils.writeStringToFile(file, "This line was there before you...");
23992400

2400-
final byte[] data = "SKIP_THIS_this is brand new data_AND_SKIP_THIS".getBytes(Charsets.UTF_8);
2401+
final byte[] data = "SKIP_THIS_this is brand new data_AND_SKIP_THIS".getBytes(StandardCharsets.UTF_8);
24012402
FileUtils.writeByteArrayToFile(file, data, 10, 22, false);
24022403

24032404
final String expected = "this is brand new data";
2404-
final String actual = FileUtils.readFileToString(file, Charsets.UTF_8);
2405+
final String actual = FileUtils.readFileToString(file, StandardCharsets.UTF_8);
24052406
assertEquals(expected, actual);
24062407
}
24072408

0 commit comments

Comments
 (0)