[java] RedundantFieldInitializer can not detect a special case for char initialize: char foo = '\0'; #2441
Labels
a:false-negative
PMD doesn't flag a problematic piece of code
Milestone
Affects PMD Version:
6.22.0
Rule:
RedundantFieldInitializer
Description:
RedundantFieldInitializer can not detect a special case for
char
initialize:char foo = '\0';
The reason for the undetectability is that
'\0'
can't convert to int directly, invalue = (int) literal.getImage().charAt(1);
in pmd-java-6.22.0-sources.jar!\net\sourceforge\pmd\lang\java\rule\performance\RedundantFieldInitializerRule.java_93Code Sample demonstrating the issue:
Expected outcome:
false-negative
Running PMD through:
CLI
The text was updated successfully, but these errors were encountered: