Program: 26446
Project: 26446
Buggy source:
public static void main(String[] args){
  if (args.length == 0) {
    System.err.println("String_Node_Str");
    return;
  }
  System.setProperty("String_Node_Str","String_Node_Str");
  try {
    java.util.logging.LogManager.getLogManager().readConfiguration(ReportGenerator.class.getResourceAsStream("String_Node_Str"));
  }
 catch (  IOException ioe) {
    System.err.println("String_Node_Str");
    ioe.printStackTrace();
  }
  List<String> paths=new java.util.ArrayList<String>();
  List<String> customDataCharts=new java.util.ArrayList<String>();
  List<String> customSummaryCharts=new java.util.ArrayList<String>();
  List<String> multiplexedFieldCharts=new java.util.ArrayList<String>();
  List<String> multiplexedTypeCharts=new java.util.ArrayList<String>();
  String intervalsFile="String_Node_Str";
  boolean summaryCharts=true;
  boolean dataSetCharts=true;
  long startTime=Interval.DEFAULT.getStart();
  long endTime=Interval.DEFAULT.getEnd();
  boolean writeRawData=false;
  boolean writeChartData=false;
  for (int i=0; i < args.length; i++) {
    String arg=args[i];
    char c=arg.charAt(0);
    if (c == '-') {
      nextarg:       for (int j=1; j < arg.length(); j++) {
        c=arg.charAt(j);
switch (c) {
case 's':
          try {
            startTime=parseTime(args,++i,'s');
            break nextarg;
          }
 catch (          IllegalArgumentException iae) {
            System.err.println(iae.getMessage());
            return;
          }
case 'e':
        try {
          endTime=parseTime(args,++i,'e');
          break nextarg;
        }
 catch (        IllegalArgumentException iae) {
          System.err.println(iae.getMessage());
          return;
        }
case 'd':
{
        ++i;
        if (i > args.length) {
          System.err.println("String_Node_Str" + '-' + 'd');
          return;
        }
        customDataCharts.add(args[i]);
        break nextarg;
      }
case 'a':
{
      ++i;
      if (i > args.length) {
        System.err.println("String_Node_Str" + '-' + 'a');
        return;
      }
      customSummaryCharts.add(args[i]);
      break nextarg;
    }
case 'i':
{
    ++i;
    if (i > args.length) {
      System.err.println("String_Node_Str" + '-' + 's');
      return;
    }
    intervalsFile=args[i];
    break nextarg;
  }
case '-':
{
  if (j == 1) {
    String param=arg.substring(2);
    if ("String_Node_Str".equals(param)) {
      dataSetCharts=false;
    }
 else     if ("String_Node_Str".equals(param)) {
      summaryCharts=false;
    }
 else     if ("String_Node_Str".equals(param)) {
      ++i;
      if (i > args.length) {
        System.err.println("String_Node_Str" + '-' + '-'+ "String_Node_Str");
        return;
      }
      multiplexedFieldCharts.add(args[i]);
    }
 else     if ("String_Node_Str".equals(param)) {
      ++i;
      if (i > args.length) {
        System.err.println("String_Node_Str" + '-' + '-'+ "String_Node_Str");
        return;
      }
      multiplexedTypeCharts.add(args[i]);
    }
 else     if ("String_Node_Str".equals(param)) {
      writeRawData=true;
    }
 else     if ("String_Node_Str".equals(param)) {
      writeChartData=true;
    }
 else {
      System.err.println("String_Node_Str" + "String_Node_Str" + '-' + '-'+ param);
    }
    break nextarg;
  }
 else {
    System.err.println("String_Node_Str" + "String_Node_Str" + arg);
    break;
  }
}
default :
System.err.println("String_Node_Str" + "String_Node_Str" + '-' + c);
}
}
}
 else {
paths.add(arg);
}
}
if (!summaryCharts && !dataSetCharts && customDataCharts.isEmpty()&& customSummaryCharts.isEmpty()) {
System.err.println("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
return;
}
if (paths.isEmpty()) {
System.err.println("String_Node_Str");
return;
}
List<String> filesToParse=new java.util.ArrayList<String>();
for (String path : paths) {
File pathToParse=new File(path);
FileHelper.recurseDirectories(java.util.Collections.singletonList(pathToParse),CombinedFileFilter.getInstance(false),filesToParse);
if (filesToParse.isEmpty()) {
System.err.println('\'' + pathToParse.toString() + "String_Node_Str");
return;
}
}
ReportGenerator generator=new ReportGenerator(customSummaryCharts,customDataCharts,multiplexedFieldCharts,multiplexedTypeCharts);
File outputDirectory=null;
if (paths.size() == 1) {
outputDirectory=new File(paths.get(0));
}
 else {
outputDirectory=new File(System.getProperty("String_Node_Str"));
}
generator.outputDirectory=outputDirectory.isDirectory() ? outputDirectory : outputDirectory.getParentFile();
generator.writeChartData=writeChartData;
generator.parse(filesToParse);
if (!"String_Node_Str".equals(intervalsFile)) {
try {
generator.getIntervalManager().loadFromFile(new File(intervalsFile),0);
}
 catch (IOException ioe) {
System.err.println("String_Node_Str" + intervalsFile + "String_Node_Str");
ioe.printStackTrace();
}
}
generator.createIntervalIfNecessary(startTime,endTime);
if (generator.getIntervalManager().getIntervalCount() != 0) {
for (Interval interval : generator.getIntervalManager().getIntervals()) {
generator.createReport(interval,summaryCharts,dataSetCharts);
if (writeRawData) {
generator.writeRawData(interval);
}
}
}
 else {
generator.createReport(Interval.DEFAULT,summaryCharts,dataSetCharts);
}
System.out.println("String_Node_Str");
if (writeRawData) {
System.out.println();
if (generator.getIntervalManager().getIntervalCount() != 0) {
for (Interval interval : generator.getIntervalManager().getIntervals()) {
generator.writeRawData(interval);
}
}
 else {
generator.writeRawData(Interval.DEFAULT);
}
}
System.out.println("String_Node_Str");
}

Fixed version (ground truth):
public static void main(String[] args){
  if (args.length == 0) {
    System.err.println("String_Node_Str");
    return;
  }
  System.setProperty("String_Node_Str","String_Node_Str");
  try {
    java.util.logging.LogManager.getLogManager().readConfiguration(ReportGenerator.class.getResourceAsStream("String_Node_Str"));
  }
 catch (  IOException ioe) {
    System.err.println("String_Node_Str");
    ioe.printStackTrace();
  }
  List<String> paths=new java.util.ArrayList<String>();
  List<String> customDataCharts=new java.util.ArrayList<String>();
  List<String> customSummaryCharts=new java.util.ArrayList<String>();
  List<String> multiplexedFieldCharts=new java.util.ArrayList<String>();
  List<String> multiplexedTypeCharts=new java.util.ArrayList<String>();
  String intervalsFile="String_Node_Str";
  boolean summaryCharts=true;
  boolean dataSetCharts=true;
  long startTime=Interval.DEFAULT.getStart();
  long endTime=Interval.DEFAULT.getEnd();
  boolean writeRawData=false;
  boolean writeChartData=false;
  for (int i=0; i < args.length; i++) {
    String arg=args[i];
    char c=arg.charAt(0);
    if (c == '-') {
      nextarg:       for (int j=1; j < arg.length(); j++) {
        c=arg.charAt(j);
switch (c) {
case 's':
          try {
            startTime=parseTime(args,++i,'s');
            break nextarg;
          }
 catch (          IllegalArgumentException iae) {
            System.err.println(iae.getMessage());
            return;
          }
case 'e':
        try {
          endTime=parseTime(args,++i,'e');
          break nextarg;
        }
 catch (        IllegalArgumentException iae) {
          System.err.println(iae.getMessage());
          return;
        }
case 'd':
{
        ++i;
        if (i > args.length) {
          System.err.println("String_Node_Str" + '-' + 'd');
          return;
        }
        customDataCharts.add(args[i]);
        break nextarg;
      }
case 'a':
{
      ++i;
      if (i > args.length) {
        System.err.println("String_Node_Str" + '-' + 'a');
        return;
      }
      customSummaryCharts.add(args[i]);
      break nextarg;
    }
case 'i':
{
    ++i;
    if (i > args.length) {
      System.err.println("String_Node_Str" + '-' + 's');
      return;
    }
    intervalsFile=args[i];
    break nextarg;
  }
case '-':
{
  if (j == 1) {
    String param=arg.substring(2);
    if ("String_Node_Str".equals(param)) {
      dataSetCharts=false;
    }
 else     if ("String_Node_Str".equals(param)) {
      summaryCharts=false;
    }
 else     if ("String_Node_Str".equals(param)) {
      ++i;
      if (i > args.length) {
        System.err.println("String_Node_Str" + '-' + '-'+ "String_Node_Str");
        return;
      }
      multiplexedFieldCharts.add(args[i]);
    }
 else     if ("String_Node_Str".equals(param)) {
      ++i;
      if (i > args.length) {
        System.err.println("String_Node_Str" + '-' + '-'+ "String_Node_Str");
        return;
      }
      multiplexedTypeCharts.add(args[i]);
    }
 else     if ("String_Node_Str".equals(param)) {
      writeRawData=true;
    }
 else     if ("String_Node_Str".equals(param)) {
      writeChartData=true;
    }
 else {
      System.err.println("String_Node_Str" + "String_Node_Str" + '-' + '-'+ param);
    }
    break nextarg;
  }
 else {
    System.err.println("String_Node_Str" + "String_Node_Str" + arg);
    break;
  }
}
default :
System.err.println("String_Node_Str" + "String_Node_Str" + '-' + c);
}
}
}
 else {
paths.add(arg);
}
}
if (!summaryCharts && !dataSetCharts && customDataCharts.isEmpty()&& customSummaryCharts.isEmpty()) {
System.err.println("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
return;
}
if (paths.isEmpty()) {
System.err.println("String_Node_Str");
return;
}
List<String> filesToParse=new java.util.ArrayList<String>();
for (String path : paths) {
File pathToParse=new File(path);
FileHelper.recurseDirectories(java.util.Collections.singletonList(pathToParse),CombinedFileFilter.getInstance(false),filesToParse);
if (filesToParse.isEmpty()) {
System.err.println('\'' + pathToParse.toString() + "String_Node_Str");
return;
}
}
ReportGenerator generator=new ReportGenerator(customSummaryCharts,customDataCharts,multiplexedFieldCharts,multiplexedTypeCharts);
File outputDirectory=null;
if (paths.size() == 1) {
outputDirectory=new File(paths.get(0));
}
 else {
outputDirectory=new File(System.getProperty("String_Node_Str"));
}
generator.outputDirectory=outputDirectory.isDirectory() ? outputDirectory : outputDirectory.getParentFile();
generator.writeChartData=writeChartData;
generator.parse(filesToParse);
if (!"String_Node_Str".equals(intervalsFile)) {
try {
generator.getIntervalManager().loadFromFile(new File(intervalsFile),0);
}
 catch (IOException ioe) {
System.err.println("String_Node_Str" + intervalsFile + "String_Node_Str");
ioe.printStackTrace();
}
}
generator.createIntervalIfNecessary(startTime,endTime);
if (generator.getIntervalManager().getIntervalCount() != 0) {
for (Interval interval : generator.getIntervalManager().getIntervals()) {
generator.createReport(interval,summaryCharts,dataSetCharts);
}
}
 else {
generator.createReport(Interval.DEFAULT,summaryCharts,dataSetCharts);
}
System.out.println("String_Node_Str");
if (writeRawData) {
System.out.println();
if (generator.getIntervalManager().getIntervalCount() != 0) {
for (Interval interval : generator.getIntervalManager().getIntervals()) {
generator.writeRawData(interval);
}
}
 else {
generator.writeRawData(Interval.DEFAULT);
}
}
System.out.println("String_Node_Str");
}