aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorfmallet <freddy.mallet@gmail.com>2010-09-17 11:53:13 +0000
committerfmallet <freddy.mallet@gmail.com>2010-09-17 11:53:13 +0000
commit7215f16b54854286de9e01390efa533a104259e1 (patch)
treee5453f57e21558e2d3a6d235063aa8d2416f6e91 /plugins
parentb4ba514185fae1283073f3cc9c0f7cffd6e69a04 (diff)
downloadsonarqube-7215f16b54854286de9e01390efa533a104259e1.tar.gz
sonarqube-7215f16b54854286de9e01390efa533a104259e1.zip
When the import of a PMD configuration file fails, the full stack trace is logged in the Sonar log file.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/sonar-pmd-plugin/src/main/java/org/sonar/plugins/pmd/PmdProfileImporter.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/plugins/sonar-pmd-plugin/src/main/java/org/sonar/plugins/pmd/PmdProfileImporter.java b/plugins/sonar-pmd-plugin/src/main/java/org/sonar/plugins/pmd/PmdProfileImporter.java
index 85ad6321f71..bd25d94c34e 100644
--- a/plugins/sonar-pmd-plugin/src/main/java/org/sonar/plugins/pmd/PmdProfileImporter.java
+++ b/plugins/sonar-pmd-plugin/src/main/java/org/sonar/plugins/pmd/PmdProfileImporter.java
@@ -26,6 +26,8 @@ import org.jdom.Document;
import org.jdom.Element;
import org.jdom.Namespace;
import org.jdom.input.SAXBuilder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sonar.api.profiles.ProfileImporter;
import org.sonar.api.profiles.RulesProfile;
import org.sonar.api.resources.Java;
@@ -41,6 +43,7 @@ import org.sonar.plugins.pmd.xml.PmdRuleset;
public class PmdProfileImporter extends ProfileImporter {
private final RuleFinder ruleFinder;
+ private static Logger LOG = LoggerFactory.getLogger(PmdProfileImporter.class);
public PmdProfileImporter(RuleFinder ruleFinder) {
super(PmdConstants.REPOSITORY_KEY, PmdConstants.PLUGIN_NAME);
@@ -64,8 +67,7 @@ public class PmdProfileImporter extends ProfileImporter {
continue;
}
if (pmdRule.getRef() == null) {
- messages.addWarningText("A PMD rule without 'ref' attribute can't be imported. see '" + pmdRule.getClazz()
- + "'");
+ messages.addWarningText("A PMD rule without 'ref' attribute can't be imported. see '" + pmdRule.getClazz() + "'");
continue;
}
Rule rule = ruleFinder.find(RuleQuery.create().withRepositoryKey(PmdConstants.REPOSITORY_KEY).withConfigKey(pmdRule.getRef()));
@@ -105,7 +107,9 @@ public class PmdProfileImporter extends ProfileImporter {
}
return pmdResultset;
} catch (Exception e) {
- messages.addErrorText("The PMD configuration file is not valid : " + e.getMessage());
+ String errorMessage = "The PMD configuration file is not valid";
+ messages.addErrorText(errorMessage + " : " + e.getMessage());
+ LOG.error(errorMessage, e);
return new PmdRuleset();
}
}