Skip to content

Commit f98a1dd

Browse files
committed
Fix deprecation warnings
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/io/trunk@1470205 13f79535-47bb-0310-9956-ffa450edef68
1 parent 354f627 commit f98a1dd

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/test/java/org/apache/commons/io/input/TailerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ public void testTailer() throws Exception {
210210
listener.clear();
211211

212212
// Check file does actually have all the lines
213-
lines = FileUtils.readLines(file);
213+
lines = FileUtils.readLines(file, "UTF-8");
214214
assertEquals("3 line count", 3, lines.size());
215215
assertEquals("3 line 1", "Line one", lines.get(0));
216216
assertEquals("3 line 2", "Line two", lines.get(1));

src/test/java/org/apache/commons/io/output/LockableFileWriterTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import java.io.Writer;
2222
import java.nio.charset.UnsupportedCharsetException;
2323

24+
import org.apache.commons.io.Charsets;
2425
import org.apache.commons.io.IOUtils;
2526
import org.apache.commons.io.testtools.FileBasedTestCase;
2627

@@ -108,13 +109,13 @@ public void testAlternateLockDir() throws IOException {
108109
LockableFileWriter lfw2 = null;
109110
try {
110111
// open a valid locakable writer
111-
lfw1 = new LockableFileWriter(file, true, altLockDir.getAbsolutePath());
112+
lfw1 = new LockableFileWriter(file, "UTF-8" ,true, altLockDir.getAbsolutePath());
112113
assertTrue(file.exists());
113114
assertTrue(altLockFile.exists());
114115

115116
// try to open a second writer
116117
try {
117-
lfw2 = new LockableFileWriter(file, true, altLockDir.getAbsolutePath());
118+
lfw2 = new LockableFileWriter(file, Charsets.UTF_8, true, altLockDir.getAbsolutePath());
118119
fail("Somehow able to open a locked file. ");
119120
} catch(final IOException ioe) {
120121
final String msg = ioe.getMessage();

0 commit comments

Comments
 (0)