Synopsis: | Don't use duplicate String literals; use constants instead |
Language: | Java |
Severity Level: | 3 |
Category: | StringandStringBuffer |
Description: |
Code containing duplicate String literals can usually be improved by declaring the String as a constant field.public class Foo { private void bar() { buz("Howdy"); buz("Howdy"); buz("Howdy"); buz("Howdy"); } private void buz(String x) {} } |