Program: 64530
Project: 64530
Buggy source:
/** 
 * Program to generate data representing the distribution of points generated by a SBX crossover operator. The parameters to be introduced by the command line are: - numberOfSolutions: number of solutions to generate - granularity: number of subdivisions to be considered. - distributionIndex: distribution index of the polynomial mutation operator - outputFile: file containing the results
 * @param args Command line arguments
 */
public static void main(String[] args) throws FileNotFoundException {
  if (args.length != 4) {
    throw new JMetalException("String_Node_Str");
  }
  int numberOfPoints=Integer.valueOf(args[0]);
  int granularity=Integer.valueOf(args[1]);
  double distributionIndex=Double.valueOf(args[2]);
  String outputFileName=args[3];
  IntegerProblem problem;
  problem=new NMMin(1,-50,50,-100,100);
  CrossoverOperator<IntegerSolution> crossover=new IntegerSBXCrossover(1.0,distributionIndex);
  IntegerSolution solution1=problem.createSolution();
  IntegerSolution solution2=problem.createSolution();
  solution1.setVariableValue(0,-50);
  solution2.setVariableValue(0,50);
  List<IntegerSolution> parents=Arrays.asList(solution1,solution2);
  List<IntegerSolution> population=new ArrayList<>(numberOfPoints);
  for (int i=0; i < numberOfPoints; i++) {
    List<IntegerSolution> solutions=(List<IntegerSolution>)crossover.execute(parents);
    population.add(solutions.get(0));
    population.add(solutions.get(1));
  }
  Collections.sort(population,new VariableComparator());
  new SolutionListOutput(population).setSeparator("String_Node_Str").setVarFileOutputContext(new DefaultFileOutputContext("String_Node_Str")).print();
  double[][] classifier=classify(population,problem,granularity);
  BufferedWriter bufferedWriter=new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outputFileName)));
  try {
    for (int i=0; i < classifier.length; i++) {
      bufferedWriter.write(classifier[i][0] + "String_Node_Str" + classifier[i][1]);
      bufferedWriter.newLine();
    }
    bufferedWriter.close();
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * Program to generate data representing the distribution of points generated by a SBX crossover operator. The parameters to be introduced by the command line are: - numberOfSolutions: number of solutions to generate - granularity: number of subdivisions to be considered. - distributionIndex: distribution index of the polynomial mutation operator - outputFile: file containing the results
 * @param args Command line arguments
 */
public static void main(String[] args) throws FileNotFoundException {
  if (args.length != 4) {
    throw new JMetalException("String_Node_Str");
  }
  int numberOfPoints=Integer.valueOf(args[0]);
  int granularity=Integer.valueOf(args[1]);
  double distributionIndex=Double.valueOf(args[2]);
  String outputFileName=args[3];
  IntegerProblem problem;
  problem=new NMMin(1,-50,50,-100,100);
  CrossoverOperator<IntegerSolution> crossover=new IntegerSBXCrossover(1.0,distributionIndex);
  IntegerSolution solution1=problem.createSolution();
  IntegerSolution solution2=problem.createSolution();
  solution1.setVariableValue(0,-50);
  solution2.setVariableValue(0,50);
  List<IntegerSolution> parents=Arrays.asList(solution1,solution2);
  List<IntegerSolution> population=new ArrayList<>(numberOfPoints);
  for (int i=0; i < numberOfPoints; i++) {
    List<IntegerSolution> solutions=(List<IntegerSolution>)crossover.execute(parents);
    population.add(solutions.get(0));
    population.add(solutions.get(1));
  }
  Collections.sort(population,new VariableComparator());
  new SolutionListOutput(population).setSeparator("String_Node_Str").setVarFileOutputContext(new DefaultFileOutputContext("String_Node_Str")).print();
  double[][] classifier=classify(population,problem,granularity);
  BufferedWriter bufferedWriter=new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outputFileName)));
  try {
    for (int i=0; i < classifier.length; i++) {
      bufferedWriter.write(classifier[i][0] + "String_Node_Str" + classifier[i][1]);
      bufferedWriter.newLine();
    }
    bufferedWriter.close();
  }
 catch (  IOException e) {
    throw new JMetalException("String_Node_Str",e);
  }
}