diff --git a/pmd/bin/build.xml b/pmd/bin/build.xml index 3640c87f4d..5d270de802 100644 --- a/pmd/bin/build.xml +++ b/pmd/bin/build.xml @@ -71,7 +71,7 @@ - + diff --git a/pmd/etc/changelog.txt b/pmd/etc/changelog.txt index 77d1ff3dc2..c451e98069 100644 --- a/pmd/etc/changelog.txt +++ b/pmd/etc/changelog.txt @@ -1,8 +1,9 @@ ????, 2005 - 3.3: Implemented RFE 1220171 - rule definitions can now contain a link to an external URL for more information on that rule - for example, a link to the rule's web page. Thanks to Wouter Zelle for designing and implementing this! -Fixed bug 1226858 - JUnitAssertionsShouldIncludeMessage now checks calls to assertFalse. +Fixed bug 1226858 - JUnitAssertionsShouldIncludeMessage now checks calls to assertFalse. +Fixed a bug in RuleSetFactory that missed some override cases; thx to Wouter Zelle for the report and a fix. Improved UseCorrectExceptionLogging; thx to Wouter Zelle for the new XPath. -Fixed a bug in RuleSetFactory that missed some override cases. +The Ant task now accepts the short names of rulesets (e.g., unusedcode for rulesets/unusedcode.xml). June 21, 2005 - 3.2: New rules: UseCorrectExceptionLogging (logging-jakarta-commons ruleset), AvoidPrintStackTrace (logging-java ruleset), CompareObjectsWithEquals (design ruleset) diff --git a/pmd/src/net/sourceforge/pmd/SimpleRuleSetNameMapper.java b/pmd/src/net/sourceforge/pmd/SimpleRuleSetNameMapper.java index ef469a179c..bbee5b2800 100644 --- a/pmd/src/net/sourceforge/pmd/SimpleRuleSetNameMapper.java +++ b/pmd/src/net/sourceforge/pmd/SimpleRuleSetNameMapper.java @@ -51,6 +51,7 @@ public class SimpleRuleSetNameMapper { nameMap.put("finalizers", "rulesets/finalizers.xml"); nameMap.put("imports", "rulesets/imports.xml"); nameMap.put("logging-java", "rulesets/logging-java.xml"); + nameMap.put("logging-jakarta", "rulesets/logging-jakarta-commons.xml"); nameMap.put("junit", "rulesets/junit.xml"); nameMap.put("javabeans", "rulesets/javabeans.xml"); nameMap.put("naming", "rulesets/naming.xml"); diff --git a/pmd/src/net/sourceforge/pmd/ant/PMDTask.java b/pmd/src/net/sourceforge/pmd/ant/PMDTask.java index 2aff76e913..8d5d70c831 100644 --- a/pmd/src/net/sourceforge/pmd/ant/PMDTask.java +++ b/pmd/src/net/sourceforge/pmd/ant/PMDTask.java @@ -13,6 +13,7 @@ import net.sourceforge.pmd.RuleSetFactory; import net.sourceforge.pmd.RuleSetNotFoundException; import net.sourceforge.pmd.TargetJDK1_3; import net.sourceforge.pmd.TargetJDK1_5; +import net.sourceforge.pmd.SimpleRuleSetNameMapper; import net.sourceforge.pmd.renderers.Renderer; import net.sourceforge.pmd.renderers.TextRenderer; import org.apache.tools.ant.AntClassLoader; @@ -118,7 +119,9 @@ public class PMDTask extends Task { public void execute() throws BuildException { validate(); + ruleSetFiles = new SimpleRuleSetNameMapper(ruleSetFiles).getRuleSets(); RuleSet rules; + try { RuleSetFactory ruleSetFactory = new RuleSetFactory(); if (classpath == null) {