]> source.dussan.org Git - sonarqube.git/commitdiff
Property sonar.showProfiling must export properties file instead of XML
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Tue, 4 Nov 2014 22:36:06 +0000 (23:36 +0100)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Tue, 4 Nov 2014 22:36:06 +0000 (23:36 +0100)
sonar-batch/src/main/java/org/sonar/batch/profiling/PhasesSumUpTimeProfiler.java

index 6e538f887ad00f8ca53237fa24054ca85dfd6d33..e1cc04ec070b10c69d65f06da0e82002cd456438 100644 (file)
@@ -119,7 +119,7 @@ public class PhasesSumUpTimeProfiler implements ProjectAnalysisHandler, SensorEx
       println("");
       println(" -------- End of profiling of module " + module.getName() + " --------");
       println("");
-      String fileName = module.getKey() + "-profiler.xml";
+      String fileName = module.getKey() + "-profiler.properties";
       dumpToFile(props, fileName);
       totalProfiling.merge(currentModuleProfiling);
       if (module.isRoot() && !module.getModules().isEmpty()) {
@@ -145,19 +145,19 @@ public class PhasesSumUpTimeProfiler implements ProjectAnalysisHandler, SensorEx
     println("");
     println(" ======== End of profiling of total execution ========");
     println("");
-    String fileName = "total-execution-profiler.xml";
+    String fileName = "total-execution-profiler.properties";
     dumpToFile(props, fileName);
   }
 
   private void dumpToFile(Properties props, String fileName) {
     FileOutputStream fos = null;
+    File file = new File(out, fileName);
     try {
-      File file = new File(out, fileName);
       fos = new FileOutputStream(file);
-      props.storeToXML(fos, "SonarQube");
-      println("Results stored in " + file.getAbsolutePath());
+      props.store(fos, "SonarQube");
+      println("Profiling data stored in " + file.getAbsolutePath());
     } catch (Exception e) {
-      throw new IllegalStateException("Unable to store profiler output", e);
+      throw new IllegalStateException("Unable to store profiler output: " + file, e);
     } finally {
       Closeables.closeQuietly(fos);
     }