diff --git a/pmd/bin/build.xml b/pmd/bin/build.xml index b370b2688c..b705ec9976 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 411f01286e..22315fdbce 100644 --- a/pmd/etc/changelog.txt +++ b/pmd/etc/changelog.txt @@ -5,7 +5,8 @@ Fixed bug 1227001 - AvoidCallingFinalize no longer flags calls to finalize() wit 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. The Ant task now accepts the short names of rulesets (e.g., unusedcode for rulesets/unusedcode.xml). -Removed unnecessary '.html' suffix to HTML renderer when the linkPrefix attribute is used. +Removed redundant calls to PMD.setExcludeMarker() from the Ant task. +Removed unnecessary '.html' suffix from displayed filenames when the linkPrefix attribute is used with the HTML renderer. Moved AvoidCallingFinalize from the design ruleset to the finalize ruleset. Deleted redundant ExplicitCallToFinalize rule. diff --git a/pmd/src/net/sourceforge/pmd/ant/PMDTask.java b/pmd/src/net/sourceforge/pmd/ant/PMDTask.java index 8d5d70c831..712d9c23af 100644 --- a/pmd/src/net/sourceforge/pmd/ant/PMDTask.java +++ b/pmd/src/net/sourceforge/pmd/ant/PMDTask.java @@ -119,9 +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) { @@ -134,7 +134,6 @@ public class PMDTask extends Task { } catch (RuleSetNotFoundException e) { throw new BuildException(e.getMessage()); } - logRulesUsed(rules); PMD pmd; @@ -145,6 +144,10 @@ public class PMDTask extends Task { } else { pmd = new PMD(); } + if (excludeMarker != null) { + log("Setting exclude marker to be " + excludeMarker, Project.MSG_VERBOSE); + pmd.setExcludeMarker(excludeMarker); + } RuleContext ctx = new RuleContext(); ctx.setReport(new Report()); @@ -156,10 +159,6 @@ public class PMDTask extends Task { File file = new File(ds.getBasedir() + System.getProperty("file.separator") + srcFiles[j]); log("Processing file " + file.getAbsoluteFile().toString(), Project.MSG_VERBOSE); ctx.setSourceCodeFilename(shortFilenames ? srcFiles[j] : file.getAbsolutePath()); - if (excludeMarker != null) { - log("Setting exclude marker to be " + excludeMarker, Project.MSG_VERBOSE); - pmd.setExcludeMarker(excludeMarker); - } try { pmd.processFile(new BufferedInputStream(new FileInputStream(file)), encoding, rules, ctx); } catch (FileNotFoundException fnfe) {