From c0a4006decf4c42207918e47e65498ef1922705d Mon Sep 17 00:00:00 2001 From: Tom Copeland Date: Wed, 14 Dec 2005 22:20:47 +0000 Subject: [PATCH] More code in the framework, less code in the rule... good times git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@4064 51baf565-9d33-0410-a72c-fc3788e3496d --- pmd/etc/bug_closer.txt | 3 +- pmd/rulesets/scratchpad.xml | 43 ++++++++----------- pmd/rulesets/unusedcode.xml | 2 - .../pmd/ast/ASTVariableDeclaratorId.java | 11 +++++ .../pmd/rules/UnusedLocalVariableRule.java | 37 +++------------- .../ScopeAndDeclarationFinder.java | 4 +- 6 files changed, 40 insertions(+), 60 deletions(-) diff --git a/pmd/etc/bug_closer.txt b/pmd/etc/bug_closer.txt index 8ef13246c9..51bfd3aa4c 100644 --- a/pmd/etc/bug_closer.txt +++ b/pmd/etc/bug_closer.txt @@ -7,4 +7,5 @@ that contains this fix. Thanks, Tom -Using PMD? Get the book, "PMD Applied"! http://pmdapplied.com/ \ No newline at end of file +Using PMD? Get the book, "PMD Applied"! http://pmdapplied.com/ + diff --git a/pmd/rulesets/scratchpad.xml b/pmd/rulesets/scratchpad.xml index 9b3f4ac5bb..3d8a15df02 100644 --- a/pmd/rulesets/scratchpad.xml +++ b/pmd/rulesets/scratchpad.xml @@ -6,33 +6,26 @@ These are new rules that are still in progress - - - Assigning a "null" to a variable (outside of its declaration) is usually - bad form. Some times, the assignment is an indication that the programmer doesn't - completely understand what is going on in the code. NOTE: This sort of assignment - may in rare cases be useful to encourage garbage collection. If that's what you're using - it for, by all means, disregard this rule :-) - + + + Detects when a local variable is declared and/or assigned, but not used. + 3 - - - - + + + + +