I’ve been closely following the discussion on the Java Rule S1943 changes for 11 FileWriter or FileReaders as discussed here: Java Rule S1943 should take into account if a FileWriter or FileReader is created with a charset - #3 by Adam_Lu. Jira ticket: SONARJAVA-3772.
I believe the new rule is effective already. But I’m only seeing that the FileWriter or FileReader constructors are no longer being reported as an issue, but whenever I declare a variable of type FileWriter or FileReader the report still complains. I believe this should also be fixed.
versions used: SonarQube
FileReader fileReader = new FileReader(file, StandardCharsets.ISO_8859_1);
SonarQube now would not complain about the usages of the FileReader constructor, but it still complains about the variable
fileReader by reporting
Remove this use of "java.io.FileReader".