diff --git a/pmd/regress/test/net/sourceforge/pmd/rules/VariableNamingConventionsRuleTest.java b/pmd/regress/test/net/sourceforge/pmd/rules/VariableNamingConventionsRuleTest.java index 2929994415..13a0037b77 100644 --- a/pmd/regress/test/net/sourceforge/pmd/rules/VariableNamingConventionsRuleTest.java +++ b/pmd/regress/test/net/sourceforge/pmd/rules/VariableNamingConventionsRuleTest.java @@ -11,6 +11,7 @@ public class VariableNamingConventionsRuleTest extends SimpleAggregatorTst { new TestDescriptor(TEST2, "non-finals shouldn't have underscores", 1, new VariableNamingConventionsRule()), new TestDescriptor(TEST3, "variables names should start with lowercase character", 1, new VariableNamingConventionsRule()), new TestDescriptor(TEST4, "all is well", 0, new VariableNamingConventionsRule()), + new TestDescriptor(TEST5, "local finals are ok", 0, new VariableNamingConventionsRule()), }); } @@ -34,4 +35,11 @@ public class VariableNamingConventionsRuleTest extends SimpleAggregatorTst { " private int bar = 2;" + PMD.EOL + " private static final int FOO_BAR = 2;" + PMD.EOL + "}"; + + private static final String TEST5 = + "public class Foo {" + PMD.EOL + + " private void bar() {" + PMD.EOL + + " final int STATE_READING = 0;" + PMD.EOL + + " }" + PMD.EOL + + "}"; }