#vulnerable code 
                              private void outputTracerReport() {
    OutputStreamWriter output = new OutputStreamWriter(this.err);
    try {
      int runtime = 0;
      int runs = 0;
      int changes = 0;
      int diff = 0;
      int gzDiff = 0;

      // header
      output.write("Summary:\n");
      output.write("pass,runtime,runs,chancingRuns,reduction,gzReduction\n");
      Map<String, Stats> runtimeMap = compiler.tracker.getStats();
      for (Entry<String, Stats> entry : runtimeMap.entrySet()) {
        String key = entry.getKey();
        Stats stats = entry.getValue();

        output.write(key);
        output.write(",");
        output.write(String.valueOf(stats.runtime));
        runtime += stats.runtime;
        output.write(",");
        output.write(String.valueOf(stats.runs));
        runs += stats.runs;
        output.write(",");
        output.write(String.valueOf(stats.changes));
        changes += stats.changes;
        output.write(",");
        output.write(String.valueOf(stats.diff));
        diff += stats.diff;
        output.write(",");
        output.write(String.valueOf(stats.gzDiff));
        gzDiff += stats.gzDiff;
        output.write("\n");
      }
      output.write("TOTAL");
      output.write(",");
      output.write(String.valueOf(runtime));
      output.write(",");
      output.write(String.valueOf(runs));
      output.write(",");
      output.write(String.valueOf(changes));
      output.write(",");
      output.write(String.valueOf(diff));
      output.write(",");
      output.write(String.valueOf(gzDiff));
      output.write("\n");
      output.write("\n");

      output.write("Log:\n");
      output.write(
          "pass,runtime,runs,chancingRuns,reduction,gzReduction,size,gzSize\n");
      List<Stats> runtimeLog = compiler.tracker.getLog();
      for (Stats stats : runtimeLog) {
        output.write(stats.pass);
        output.write(",");
        output.write(String.valueOf(stats.runtime));
        output.write(",");
        output.write(String.valueOf(stats.runs));
        output.write(",");
        output.write(String.valueOf(stats.changes));
        output.write(",");
        output.write(String.valueOf(stats.diff));
        output.write(",");
        output.write(String.valueOf(stats.gzDiff));
        output.write(",");
        output.write(String.valueOf(stats.size));
        output.write(",");
        output.write(String.valueOf(stats.gzSize));
        output.write("\n");
      }
      output.write("\n");
      output.close();
    } catch (IOException e) {
      e.printStackTrace();
    }
  } 
                            #location 74 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                              private void outputTracerReport() {
    JvmMetrics.maybeWriteJvmMetrics(this.err, "verbose:pretty:all");

    OutputStreamWriter output = new OutputStreamWriter(this.err);
    try {
      int runtime = 0;
      int runs = 0;
      int changes = 0;
      int diff = 0;
      int gzDiff = 0;

      // header
      output.write("Summary:\n");
      output.write("pass,runtime,runs,chancingRuns,reduction,gzReduction\n");
      Map<String, Stats> runtimeMap = compiler.tracker.getStats();
      for (Entry<String, Stats> entry : runtimeMap.entrySet()) {
        String key = entry.getKey();
        Stats stats = entry.getValue();

        output.write(key);
        output.write(",");
        output.write(String.valueOf(stats.runtime));
        runtime += stats.runtime;
        output.write(",");
        output.write(String.valueOf(stats.runs));
        runs += stats.runs;
        output.write(",");
        output.write(String.valueOf(stats.changes));
        changes += stats.changes;
        output.write(",");
        output.write(String.valueOf(stats.diff));
        diff += stats.diff;
        output.write(",");
        output.write(String.valueOf(stats.gzDiff));
        gzDiff += stats.gzDiff;
        output.write("\n");
      }
      output.write("TOTAL");
      output.write(",");
      output.write(String.valueOf(runtime));
      output.write(",");
      output.write(String.valueOf(runs));
      output.write(",");
      output.write(String.valueOf(changes));
      output.write(",");
      output.write(String.valueOf(diff));
      output.write(",");
      output.write(String.valueOf(gzDiff));
      output.write("\n");
      output.write("\n");

      output.write("Log:\n");
      output.write(
          "pass,runtime,runs,chancingRuns,reduction,gzReduction,size,gzSize\n");
      List<Stats> runtimeLog = compiler.tracker.getLog();
      for (Stats stats : runtimeLog) {
        output.write(stats.pass);
        output.write(",");
        output.write(String.valueOf(stats.runtime));
        output.write(",");
        output.write(String.valueOf(stats.runs));
        output.write(",");
        output.write(String.valueOf(stats.changes));
        output.write(",");
        output.write(String.valueOf(stats.diff));
        output.write(",");
        output.write(String.valueOf(stats.gzDiff));
        output.write(",");
        output.write(String.valueOf(stats.size));
        output.write(",");
        output.write(String.valueOf(stats.gzSize));
        output.write("\n");
      }
      output.write("\n");
      output.close();
    } catch (IOException e) {
      e.printStackTrace();
    }
  }