resources.report.rules.pmd.AvoidDuplicateLiterals.html Maven / Gradle / Ivy
AvoidDuplicateLiterals
AvoidDuplicateLiterals
Code containing duplicate String literals can usually be improved by declaring the String as a constant field.
This rule is defined by the following Java class: net.sourceforge.pmd.lang.java.rule.strings.AvoidDuplicateLiteralsRule
Example(s):
private void bar() {
buz("Howdy");
buz("Howdy");
buz("Howdy");
buz("Howdy");
}
private void buz(String x) {}