Affects PMD Version:
7.24.0
Rule:
https://docs.pmd-code.org/latest/pmd_rules_java_bestpractices.html#usestandardcharsets
Description:
Java 22 added 32 bit encodings to StandardCharsets, these are not supported by the UseStandardCharsetsRule rule. The fix for this should depend on javaLevel.
Code Sample demonstrating the issue:
void main() {
byte[] bytes = "foo".getBytes("UTF-32");
}
Expected outcome:
PMD should report a violation at line 2, but doesn't. This is a false-negative.
Running PMD through: CLI
Affects PMD Version:
7.24.0
Rule:
https://docs.pmd-code.org/latest/pmd_rules_java_bestpractices.html#usestandardcharsets
Description:
Java 22 added 32 bit encodings to
StandardCharsets, these are not supported by theUseStandardCharsetsRulerule. The fix for this should depend onjavaLevel.Code Sample demonstrating the issue:
Expected outcome:
PMD should report a violation at line 2, but doesn't. This is a false-negative.
Running PMD through: CLI