]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3572 Remove useless property 'sonar.findbugs.generateXml'
authorEvgeny Mandrikov <mandrikov@gmail.com>
Mon, 9 Jul 2012 06:26:57 +0000 (12:26 +0600)
committerEvgeny Mandrikov <mandrikov@gmail.com>
Mon, 9 Jul 2012 06:42:47 +0000 (12:42 +0600)
plugins/sonar-findbugs-plugin/src/main/java/org/sonar/plugins/findbugs/FindbugsConfiguration.java
plugins/sonar-findbugs-plugin/src/main/java/org/sonar/plugins/findbugs/FindbugsConstants.java
plugins/sonar-findbugs-plugin/src/main/java/org/sonar/plugins/findbugs/FindbugsExecutor.java

index 70eb010cc2bb79767c46d8afb366ea31ee2d613b..a71516c92f648a8af35ff8bfb53116719c15606f 100644 (file)
@@ -33,8 +33,6 @@ import org.sonar.plugins.findbugs.xml.ClassFilter;
 import org.sonar.plugins.findbugs.xml.FindBugsFilter;
 import org.sonar.plugins.findbugs.xml.Match;
 
-import javax.annotation.CheckForNull;
-
 import java.io.*;
 import java.util.ArrayList;
 import java.util.List;
@@ -58,12 +56,8 @@ public class FindbugsConfiguration implements BatchExtension {
     this.projectClasspath = classpath;
   }
 
-  @CheckForNull
   public File getTargetXMLReport() {
-    if (settings.getBoolean(FindbugsConstants.GENERATE_XML_KEY)) {
-      return new File(project.getFileSystem().getSonarWorkingDirectory(), "findbugs-result.xml");
-    }
-    return null;
+    return new File(project.getFileSystem().getSonarWorkingDirectory(), "findbugs-result.xml");
   }
 
   public edu.umd.cs.findbugs.Project getFindbugsProject() {
index 5ba5b7963b29a07b0e7d65768d574e95fb40b184..0a228badda5092b7ad9191ebc41430f5bdcaa533 100644 (file)
@@ -28,12 +28,6 @@ public final class FindbugsConstants {
   public static final String PLUGIN_NAME = "Findbugs";
   public static final String PLUGIN_KEY = CoreProperties.FINDBUGS_PLUGIN;
 
-  /**
-   * @since 2.4
-   */
-  public static final String GENERATE_XML_KEY = "sonar.findbugs.generateXml";
-  public static final boolean GENERATE_XML_DEFAULT_VALUE = true; // TODO should be false - see SONAR-1880
-
   /**
    * @since 2.10
    */
index a6db51eabb829b6cd8159957edf01b11fd2f2f63..ea5f8844467c7f044eb775d22c4f61dfe9a5da37 100644 (file)
 package org.sonar.plugins.findbugs;
 
 import com.google.common.collect.Lists;
-import edu.umd.cs.findbugs.DetectorFactoryCollection;
-import edu.umd.cs.findbugs.FindBugs;
-import edu.umd.cs.findbugs.FindBugs2;
-import edu.umd.cs.findbugs.Plugin;
-import edu.umd.cs.findbugs.PluginException;
-import edu.umd.cs.findbugs.Priorities;
-import edu.umd.cs.findbugs.Project;
-import edu.umd.cs.findbugs.XMLBugReporter;
+import edu.umd.cs.findbugs.*;
 import edu.umd.cs.findbugs.config.UserPreferences;
 import edu.umd.cs.findbugs.plugins.DuplicatePluginIdException;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.IOUtils;
-import org.apache.commons.io.output.NullOutputStream;
 import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -94,12 +86,8 @@ public class FindbugsExecutor implements BatchExtension {
       xmlBugReporter.setAddMessages(true);
 
       File xmlReport = configuration.getTargetXMLReport();
-      if (xmlReport != null) {
-        LOG.info("Findbugs output report: " + xmlReport.getAbsolutePath());
-        xmlOutput = FileUtils.openOutputStream(xmlReport);
-      } else {
-        xmlOutput = new NullOutputStream();
-      }
+      LOG.info("Findbugs output report: " + xmlReport.getAbsolutePath());
+      xmlOutput = FileUtils.openOutputStream(xmlReport);
       xmlBugReporter.setOutputStream(new PrintStream(xmlOutput));
 
       engine.setBugReporter(xmlBugReporter);