Replacing deprecated IO methods with ones that specify a charset

Standardizing with StandardCharsets.UTF_8, given that it was used in
several places of code already, and it provides compile-time checking
(as opposed to "UTF-8")
This commit is contained in:
Will Herrmann
2018-10-12 17:25:08 -05:00
parent 013ced3d7c
commit cba4e87acd
36 changed files with 161 additions and 78 deletions

View File

@ -7,6 +7,7 @@ package net.sourceforge.pmd.cpd;
import static org.junit.Assert.assertEquals;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import org.apache.commons.io.IOUtils;
import org.junit.Before;
@ -28,7 +29,7 @@ public class PythonTokenizerTest extends AbstractTokenizerTest {
@Override
public String getSampleCode() throws IOException {
return IOUtils.toString(PythonTokenizer.class.getResourceAsStream(FILENAME));
return IOUtils.toString(PythonTokenizer.class.getResourceAsStream(FILENAME), StandardCharsets.UTF_8);
}
@Test