diff --git a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/rule/bestpractices/xml/UnusedLocalVariable.xml b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/rule/bestpractices/xml/UnusedLocalVariable.xml index 0377753927..4e21cf9b26 100644 --- a/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/rule/bestpractices/xml/UnusedLocalVariable.xml +++ b/pmd-apex/src/test/resources/net/sourceforge/pmd/lang/apex/rule/bestpractices/xml/UnusedLocalVariable.xml @@ -37,6 +37,16 @@ public class Foo { String x = 'blah'; return [SELECT Id FROM Account WHERE Name = :x]; } + + public String usageInBlocks(Boolean y) { + String x = 'used variable'; + + if (y) { + return x; + } else { + return 'some other string'; + } + } } ]]>