Files
openide/java/java-tests/testData/inspection/charsetObjectCanBeUsed/beforeCharsetTryWithResources.java
Tagir Valeev a9a07c536f CharsetObjectCanBeUsedInspection: take into account exceptions thrown by resource list
Fixes IDEA-202559 "Replace with StandardCharsets.UTF_8" produces uncompilable source
2018-11-21 15:26:00 +07:00

13 lines
293 B
Java

// "Replace with 'StandardCharsets.UTF_8'" "true"
import java.io.*;
class Test {
void test(String inputFile) {
try (InputStream inputStream = new FileInputStream(inputFile)) {
new InputStreamReader(inputStream, "<caret>UTF-8");
}
catch (IOException ignored) {
}
}
}