Program: 64740
Project: 64740
Buggy source:
public void test_func(double[] x,double[] f,int nx,int mx,int func_num) throws Exception {
  int cf_num=10, i, j;
  if (ini_flag == 1) {
    if ((n_flag != nx) || (func_flag != func_num)) {
      ini_flag=0;
    }
  }
  if (ini_flag == 0) {
    y=new double[nx];
    z=new double[nx];
    x_bound=new double[nx];
    for (i=0; i < nx; i++)     x_bound[i]=100.0;
    if (!(nx == 2 || nx == 10 || nx == 20 || nx == 30 || nx == 50 || nx == 100)) {
      System.out.println("String_Node_Str");
    }
    if (nx == 2 && ((func_num >= 17 && func_num <= 22) || (func_num >= 29 && func_num <= 30))) {
      System.out.println("String_Node_Str");
    }
    File fpt=new File(Configuration.cec2014SupportDataDirectory + "String_Node_Str" + func_num+ "String_Node_Str"+ nx+ "String_Node_Str");
    Scanner input=new Scanner(fpt);
    if (!fpt.exists()) {
      System.out.println("String_Node_Str");
    }
    if (func_num < 23) {
      M=new double[nx * nx];
      for (i=0; i < nx * nx; i++) {
        M[i]=input.nextDouble();
      }
    }
 else {
      M=new double[cf_num * nx * nx];
      for (i=0; i < cf_num * nx * nx; i++) {
        M[i]=input.nextDouble();
      }
    }
    input.close();
    if (func_num < 23) {
      fpt=new File(Configuration.cec2014SupportDataDirectory + "String_Node_Str" + func_num+ "String_Node_Str");
      input=new Scanner(fpt);
      if (!fpt.exists()) {
        System.out.println("String_Node_Str");
      }
      OShift=new double[nx];
      for (i=0; i < nx; i++) {
        OShift[i]=input.nextDouble();
        if (OShift == null) {
          System.out.println("String_Node_Str");
        }
      }
      input.close();
    }
 else {
      OShift=new double[nx * cf_num];
      fpt=new File(Configuration.cec2014SupportDataDirectory + "String_Node_Str" + func_num+ "String_Node_Str");
      FileReader reader=new FileReader(fpt);
      BufferedReader br=new BufferedReader(reader);
      String[] s=new String[100];
      for (i=0; i < cf_num; i++) {
        s[i]=br.readLine();
        String[] array=s[i].split("String_Node_Str");
        double[] temp=new double[array.length - 1];
        for (int k=0; k < array.length - 1; k++) {
          temp[k]=Double.parseDouble(array[k + 1]);
        }
        for (j=0; j < nx; j++) {
          OShift[i * nx + j]=temp[j];
        }
      }
      br.close();
      reader.close();
      input.close();
    }
    input.close();
    if (func_num >= 17 && func_num <= 22) {
      fpt=new File(Configuration.cec2014SupportDataDirectory + "String_Node_Str" + func_num+ "String_Node_Str"+ nx+ "String_Node_Str");
      input=new Scanner(fpt);
      if (!fpt.exists()) {
        System.out.println("String_Node_Str");
      }
      SS=new int[nx];
      for (i=0; i < nx; i++) {
        SS[i]=input.nextInt();
      }
    }
 else     if (func_num == 29 || func_num == 30) {
      fpt=new File(Configuration.cec2014SupportDataDirectory + "String_Node_Str" + func_num+ "String_Node_Str"+ nx+ "String_Node_Str");
      input=new Scanner(fpt);
      if (!fpt.exists()) {
        System.out.println("String_Node_Str");
      }
      SS=new int[nx * cf_num];
      for (i=0; i < nx * cf_num; i++) {
        SS[i]=input.nextInt();
      }
    }
    input.close();
    n_flag=nx;
    func_flag=func_num;
    ini_flag=1;
  }
  double[] t=new double[nx];
  for (i=0; i < mx; i++) {
    for (j=0; j < nx; j++) {
      t[j]=x[i * nx + j];
    }
switch (func_num) {
case 1:
      f[i]=ellips_func(t,f[i],nx,OShift,M,1,1);
    f[i]+=100.0;
  break;
case 2:
f[i]=bent_cigar_func(t,f[i],nx,OShift,M,1,1);
f[i]+=200.0;
break;
case 3:
f[i]=discus_func(t,f[i],nx,OShift,M,1,1);
f[i]+=300.0;
break;
case 4:
f[i]=rosenbrock_func(t,f[i],nx,OShift,M,1,1);
f[i]+=400.0;
break;
case 5:
f[i]=ackley_func(t,f[i],nx,OShift,M,1,1);
f[i]+=500.0;
break;
case 6:
f[i]=weierstrass_func(t,f[i],nx,OShift,M,1,1);
f[i]+=600.0;
break;
case 7:
f[i]=griewank_func(t,f[i],nx,OShift,M,1,1);
f[i]+=700.0;
break;
case 8:
f[i]=rastrigin_func(t,f[i],nx,OShift,M,1,0);
f[i]+=800.0;
break;
case 9:
f[i]=rastrigin_func(t,f[i],nx,OShift,M,1,1);
f[i]+=900.0;
break;
case 10:
f[i]=schwefel_func(t,f[i],nx,OShift,M,1,0);
f[i]+=1000.0;
break;
case 11:
f[i]=schwefel_func(t,f[i],nx,OShift,M,1,1);
f[i]+=1100.0;
break;
case 12:
f[i]=katsuura_func(t,f[i],nx,OShift,M,1,1);
f[i]+=1200.0;
break;
case 13:
f[i]=happycat_func(t,f[i],nx,OShift,M,1,1);
f[i]+=1300.0;
break;
case 14:
f[i]=hgbat_func(t,f[i],nx,OShift,M,1,1);
f[i]+=1400.0;
break;
case 15:
f[i]=grie_rosen_func(t,f[i],nx,OShift,M,1,1);
f[i]+=1500.0;
break;
case 16:
f[i]=escaffer6_func(t,f[i],nx,OShift,M,1,1);
f[i]+=1600.0;
break;
case 17:
f[i]=hf01(t,f[i],nx,OShift,M,SS,1,1);
f[i]+=1700.0;
break;
case 18:
f[i]=hf02(t,f[i],nx,OShift,M,SS,1,1);
f[i]+=1800.0;
break;
case 19:
f[i]=hf03(t,f[i],nx,OShift,M,SS,1,1);
f[i]+=1900.0;
break;
case 20:
f[i]=hf04(t,f[i],nx,OShift,M,SS,1,1);
f[i]+=2000.0;
break;
case 21:
f[i]=hf05(t,f[i],nx,OShift,M,SS,1,1);
f[i]+=2100.0;
break;
case 22:
f[i]=hf06(t,f[i],nx,OShift,M,SS,1,1);
f[i]+=2200.0;
break;
case 23:
f[i]=cf01(t,f[i],nx,OShift,M,1);
f[i]+=2300.0;
break;
case 24:
f[i]=cf02(t,f[i],nx,OShift,M,1);
f[i]+=2400.0;
break;
case 25:
f[i]=cf03(t,f[i],nx,OShift,M,1);
f[i]+=2500.0;
break;
case 26:
f[i]=cf04(t,f[i],nx,OShift,M,1);
f[i]+=2600.0;
break;
case 27:
f[i]=cf05(t,f[i],nx,OShift,M,1);
f[i]+=2700.0;
break;
case 28:
f[i]=cf06(t,f[i],nx,OShift,M,1);
f[i]+=2800.0;
break;
case 29:
f[i]=cf07(t,f[i],nx,OShift,M,SS,1);
f[i]+=2900.0;
break;
case 30:
f[i]=cf08(t,f[i],nx,OShift,M,SS,1);
f[i]+=3000.0;
break;
default :
System.out.println("String_Node_Str");
f[i]=0.0;
break;
}
}
}

Fixed version (ground truth):
public void test_func(double[] x,double[] f,int nx,int mx,int func_num) throws Exception {
  int cf_num=10, i, j;
  if (ini_flag == 1) {
    if ((n_flag != nx) || (func_flag != func_num)) {
      ini_flag=0;
    }
  }
  if (ini_flag == 0) {
    y=new double[nx];
    z=new double[nx];
    x_bound=new double[nx];
    for (i=0; i < nx; i++)     x_bound[i]=100.0;
    if (!(nx == 2 || nx == 10 || nx == 20 || nx == 30 || nx == 50 || nx == 100)) {
      System.out.println("String_Node_Str");
    }
    if (nx == 2 && ((func_num >= 17 && func_num <= 22) || (func_num >= 29 && func_num <= 30))) {
      System.out.println("String_Node_Str");
    }
    java.util.Locale locale=Locale.ENGLISH;
    File fpt=new File(Configuration.cec2014SupportDataDirectory + "String_Node_Str" + func_num+ "String_Node_Str"+ nx+ "String_Node_Str");
    Scanner input=new Scanner(fpt);
    if (!fpt.exists()) {
      System.out.println("String_Node_Str");
    }
    input.useLocale(locale);
    if (func_num < 23) {
      M=new double[nx * nx];
      for (i=0; i < nx * nx; i++) {
        M[i]=input.nextDouble();
      }
    }
 else {
      M=new double[cf_num * nx * nx];
      for (i=0; i < cf_num * nx * nx; i++) {
        M[i]=input.nextDouble();
      }
    }
    input.close();
    if (func_num < 23) {
      fpt=new File(Configuration.cec2014SupportDataDirectory + "String_Node_Str" + func_num+ "String_Node_Str");
      input=new Scanner(fpt);
      if (!fpt.exists()) {
        System.out.println("String_Node_Str");
      }
      input.useLocale(locale);
      OShift=new double[nx];
      for (i=0; i < nx; i++) {
        OShift[i]=input.nextDouble();
        if (OShift == null) {
          System.out.println("String_Node_Str");
        }
      }
      input.close();
    }
 else {
      OShift=new double[nx * cf_num];
      fpt=new File(Configuration.cec2014SupportDataDirectory + "String_Node_Str" + func_num+ "String_Node_Str");
      FileReader reader=new FileReader(fpt);
      BufferedReader br=new BufferedReader(reader);
      String[] s=new String[100];
      for (i=0; i < cf_num; i++) {
        s[i]=br.readLine();
        String[] array=s[i].split("String_Node_Str");
        double[] temp=new double[array.length - 1];
        for (int k=0; k < array.length - 1; k++) {
          temp[k]=Double.parseDouble(array[k + 1]);
        }
        for (j=0; j < nx; j++) {
          OShift[i * nx + j]=temp[j];
        }
      }
      br.close();
      reader.close();
      input.close();
    }
    input.close();
    if (func_num >= 17 && func_num <= 22) {
      fpt=new File(Configuration.cec2014SupportDataDirectory + "String_Node_Str" + func_num+ "String_Node_Str"+ nx+ "String_Node_Str");
      input=new Scanner(fpt);
      if (!fpt.exists()) {
        System.out.println("String_Node_Str");
      }
      input.useLocale(locale);
      SS=new int[nx];
      for (i=0; i < nx; i++) {
        SS[i]=input.nextInt();
      }
    }
 else     if (func_num == 29 || func_num == 30) {
      fpt=new File(Configuration.cec2014SupportDataDirectory + "String_Node_Str" + func_num+ "String_Node_Str"+ nx+ "String_Node_Str");
      input=new Scanner(fpt);
      if (!fpt.exists()) {
        System.out.println("String_Node_Str");
      }
      input.useLocale(locale);
      SS=new int[nx * cf_num];
      for (i=0; i < nx * cf_num; i++) {
        SS[i]=input.nextInt();
      }
    }
    input.close();
    n_flag=nx;
    func_flag=func_num;
    ini_flag=1;
  }
  double[] t=new double[nx];
  for (i=0; i < mx; i++) {
    for (j=0; j < nx; j++) {
      t[j]=x[i * nx + j];
    }
switch (func_num) {
case 1:
      f[i]=ellips_func(t,f[i],nx,OShift,M,1,1);
    f[i]+=100.0;
  break;
case 2:
f[i]=bent_cigar_func(t,f[i],nx,OShift,M,1,1);
f[i]+=200.0;
break;
case 3:
f[i]=discus_func(t,f[i],nx,OShift,M,1,1);
f[i]+=300.0;
break;
case 4:
f[i]=rosenbrock_func(t,f[i],nx,OShift,M,1,1);
f[i]+=400.0;
break;
case 5:
f[i]=ackley_func(t,f[i],nx,OShift,M,1,1);
f[i]+=500.0;
break;
case 6:
f[i]=weierstrass_func(t,f[i],nx,OShift,M,1,1);
f[i]+=600.0;
break;
case 7:
f[i]=griewank_func(t,f[i],nx,OShift,M,1,1);
f[i]+=700.0;
break;
case 8:
f[i]=rastrigin_func(t,f[i],nx,OShift,M,1,0);
f[i]+=800.0;
break;
case 9:
f[i]=rastrigin_func(t,f[i],nx,OShift,M,1,1);
f[i]+=900.0;
break;
case 10:
f[i]=schwefel_func(t,f[i],nx,OShift,M,1,0);
f[i]+=1000.0;
break;
case 11:
f[i]=schwefel_func(t,f[i],nx,OShift,M,1,1);
f[i]+=1100.0;
break;
case 12:
f[i]=katsuura_func(t,f[i],nx,OShift,M,1,1);
f[i]+=1200.0;
break;
case 13:
f[i]=happycat_func(t,f[i],nx,OShift,M,1,1);
f[i]+=1300.0;
break;
case 14:
f[i]=hgbat_func(t,f[i],nx,OShift,M,1,1);
f[i]+=1400.0;
break;
case 15:
f[i]=grie_rosen_func(t,f[i],nx,OShift,M,1,1);
f[i]+=1500.0;
break;
case 16:
f[i]=escaffer6_func(t,f[i],nx,OShift,M,1,1);
f[i]+=1600.0;
break;
case 17:
f[i]=hf01(t,f[i],nx,OShift,M,SS,1,1);
f[i]+=1700.0;
break;
case 18:
f[i]=hf02(t,f[i],nx,OShift,M,SS,1,1);
f[i]+=1800.0;
break;
case 19:
f[i]=hf03(t,f[i],nx,OShift,M,SS,1,1);
f[i]+=1900.0;
break;
case 20:
f[i]=hf04(t,f[i],nx,OShift,M,SS,1,1);
f[i]+=2000.0;
break;
case 21:
f[i]=hf05(t,f[i],nx,OShift,M,SS,1,1);
f[i]+=2100.0;
break;
case 22:
f[i]=hf06(t,f[i],nx,OShift,M,SS,1,1);
f[i]+=2200.0;
break;
case 23:
f[i]=cf01(t,f[i],nx,OShift,M,1);
f[i]+=2300.0;
break;
case 24:
f[i]=cf02(t,f[i],nx,OShift,M,1);
f[i]+=2400.0;
break;
case 25:
f[i]=cf03(t,f[i],nx,OShift,M,1);
f[i]+=2500.0;
break;
case 26:
f[i]=cf04(t,f[i],nx,OShift,M,1);
f[i]+=2600.0;
break;
case 27:
f[i]=cf05(t,f[i],nx,OShift,M,1);
f[i]+=2700.0;
break;
case 28:
f[i]=cf06(t,f[i],nx,OShift,M,1);
f[i]+=2800.0;
break;
case 29:
f[i]=cf07(t,f[i],nx,OShift,M,SS,1);
f[i]+=2900.0;
break;
case 30:
f[i]=cf08(t,f[i],nx,OShift,M,SS,1);
f[i]+=3000.0;
break;
default :
System.out.println("String_Node_Str");
f[i]=0.0;
break;
}
}
}