Revert "[core] add temporary support for maven debug output"

This reverts commit 61376f81121b678e7e49a785b6fab28553efa450.

With https://issues.apache.org/jira/browse/MPMD-246 this is not needed
anymore.
This commit is contained in:
Andreas Dangel
2017-11-24 18:10:32 +01:00
parent 71ee2b6d9e
commit 2a1b7addb4

View File

@ -279,19 +279,6 @@ public class PMD {
return context;
}
// TODO: remove this, once the maven pmd plugin can report details of processing errors
private static ScopedLogHandlersManager enableLoggingMavenDebug() {
ScopedLogHandlersManager logHandlerManager = null;
String commandLine = System.getProperty("sun.java.command");
if (commandLine != null && commandLine.startsWith("org.codehaus.plexus.classworlds.launcher.Launcher")
&& (commandLine.endsWith("-X") || commandLine.contains("-X "))) {
final Handler logHandler = new ConsoleLogHandler();
logHandlerManager = new ScopedLogHandlersManager(Level.FINE, logHandler);
LOG.setLevel(Level.FINE);
}
return logHandlerManager;
}
/**
* Run PMD on a list of files using multiple threads - if more than one is
* available
@ -310,8 +297,6 @@ public class PMD {
public static void processFiles(final PMDConfiguration configuration, final RuleSetFactory ruleSetFactory,
final List<DataSource> files, final RuleContext ctx, final List<Renderer> renderers) {
ScopedLogHandlersManager logHandlerManager = enableLoggingMavenDebug();
sortFiles(configuration, files);
// Make sure the cache is listening for analysis results
@ -332,11 +317,6 @@ public class PMD {
// Persist the analysis cache
configuration.getAnalysisCache().persist();
// see enableLoggingMavenDebug above
if (logHandlerManager != null) {
logHandlerManager.close();
}
}
private static void sortFiles(final PMDConfiguration configuration, final List<DataSource> files) {