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:
@ -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
|
||||
|
Reference in New Issue
Block a user