From 2a1b7addb4d7b1f60131470c749a6aa46fe75f22 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 24 Nov 2017 18:10:32 +0100 Subject: [PATCH] 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. --- .../main/java/net/sourceforge/pmd/PMD.java | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/pmd-core/src/main/java/net/sourceforge/pmd/PMD.java b/pmd-core/src/main/java/net/sourceforge/pmd/PMD.java index b0ad4a55bc..8fd49f5a2b 100644 --- a/pmd-core/src/main/java/net/sourceforge/pmd/PMD.java +++ b/pmd-core/src/main/java/net/sourceforge/pmd/PMD.java @@ -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 files, final RuleContext ctx, final List 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 files) {