Program: 107996
Project: 107996
Buggy source:
/** 
 * @throws IOException
 */
@Test public void test() throws IOException {
  boolean benchmark=false;
  List<String> arguments=ManagementFactory.getRuntimeMXBean().getInputArguments();
  for (  String argument : arguments) {
    if (argument.startsWith("String_Node_Str")) {
      benchmark=true;
      break;
    }
  }
  final Data data=getDataObject(testCase);
  final ARXAnonymizer anonymizer=new ARXAnonymizer();
  testCase.config.setPracticalMonotonicity(testCase.practical);
  ARXResult result=anonymizer.anonymize(data,testCase.config);
  if (testCase.hashcode != -1) {
    try {
      result.optimize(result.getOutput());
    }
 catch (    RollbackRequiredException e) {
      throw new RuntimeException(e);
    }
  }
  if (benchmark) {
    String version=System.getProperty("String_Node_Str");
    String path=System.getProperty("String_Node_Str");
    if (path == null || path.length() == 0) {
      path="String_Node_Str";
    }
    String testClass=this.getClass().getSimpleName();
    final int REPETITIONS=5;
    long time=System.currentTimeMillis();
    long time2=0;
    for (int i=0; i < REPETITIONS; i++) {
      data.getHandle().release();
      result=anonymizer.anonymize(data,testCase.config);
      try {
        result.optimize(result.getOutput());
      }
 catch (      RollbackRequiredException e) {
        throw new RuntimeException(e);
      }
      time2+=result.getTime();
    }
    time=(System.currentTimeMillis() - time) / REPETITIONS;
    time2/=REPETITIONS;
    StringBuilder line=new StringBuilder();
    line.append(Resources.getVersion());
    line.append("String_Node_Str");
    line.append(version);
    line.append("String_Node_Str");
    line.append(testClass);
    line.append("String_Node_Str");
    line.append(testCase.id);
    line.append("String_Node_Str");
    line.append(time);
    line.append("String_Node_Str");
    line.append(time2);
    output(line.toString(),path + "String_Node_Str" + version+ "String_Node_Str"+ timestamp+ "String_Node_Str"+ testClass+ "String_Node_Str");
  }
  if (testCase.hashcode != -1) {
    int hashcode=23;
    DataHandle handle=result.getOutput();
    for (int row=0; row < handle.getNumRows(); row++) {
      for (int column=0; column < handle.getNumColumns(); column++) {
        hashcode=(37 * hashcode) + handle.getValue(row,column).hashCode();
      }
    }
    assertEquals("String_Node_Str",hashcode,testCase.hashcode);
    return;
  }
  if (testCase.optimalTransformation == null) {
    assertTrue(result.getGlobalOptimum() == null);
  }
 else {
    String lossActual=result.getGlobalOptimum().getMaximumInformationLoss().toString();
    String lossExpected=testCase.optimalInformationLoss;
    assertEquals(testCase.dataset + "String_Node_Str" + lossExpected+ "String_Node_Str"+ lossActual+ "String_Node_Str"+ result.getGlobalOptimum().getMinimumInformationLoss().toString()+ "String_Node_Str",lossExpected,lossActual);
    if (!Arrays.equals(result.getGlobalOptimum().getTransformation(),testCase.optimalTransformation)) {
      System.err.println("String_Node_Str");
      System.err.println("String_Node_Str" + Arrays.toString(testCase.optimalTransformation) + "String_Node_Str"+ Arrays.toString(result.getGlobalOptimum().getTransformation()));
      System.err.println("String_Node_Str" + testCase.toString());
    }
  }
  if (testCase.statistics != null) {
    int[] statistics=new int[7];
    for (    ARXNode[] level : result.getLattice().getLevels()) {
      for (      ARXNode arxNode : level) {
        statistics[0]++;
        if (arxNode.isChecked()) {
          statistics[1]++;
        }
        if (arxNode.getAnonymity() == Anonymity.ANONYMOUS) {
          statistics[2]++;
        }
        if (arxNode.getAnonymity() == Anonymity.NOT_ANONYMOUS) {
          statistics[3]++;
        }
        if (arxNode.getAnonymity() == Anonymity.PROBABLY_ANONYMOUS) {
          statistics[4]++;
        }
        if (arxNode.getAnonymity() == Anonymity.PROBABLY_NOT_ANONYMOUS) {
          statistics[5]++;
        }
        if (arxNode.getMaximumInformationLoss() == arxNode.getMinimumInformationLoss()) {
          statistics[6]++;
        }
      }
    }
    String algorithmConfiguration=getAlgorithmConfiguration(testCase.config);
    assertEquals(algorithmConfiguration + "String_Node_Str",testCase.statistics[0],statistics[0]);
    assertEquals(algorithmConfiguration + "String_Node_Str",testCase.statistics[1],statistics[1]);
    assertEquals(algorithmConfiguration + "String_Node_Str",testCase.statistics[2],statistics[2]);
    assertEquals(algorithmConfiguration + "String_Node_Str",testCase.statistics[3],statistics[3]);
    assertEquals(algorithmConfiguration + "String_Node_Str",testCase.statistics[4],statistics[4]);
    assertEquals(algorithmConfiguration + "String_Node_Str",testCase.statistics[5],statistics[5]);
    assertEquals(algorithmConfiguration + "String_Node_Str",testCase.statistics[6],statistics[6]);
  }
}

Fixed version (ground truth):
/** 
 * @throws IOException
 */
@Test public void test() throws IOException {
  boolean benchmark=false;
  List<String> arguments=ManagementFactory.getRuntimeMXBean().getInputArguments();
  for (  String argument : arguments) {
    if (argument.startsWith("String_Node_Str")) {
      benchmark=true;
      break;
    }
  }
  final Data data=getDataObject(testCase);
  final ARXAnonymizer anonymizer=new ARXAnonymizer();
  testCase.config.setPracticalMonotonicity(testCase.practical);
  ARXResult result=anonymizer.anonymize(data,testCase.config);
  if (testCase.hashcode != -1) {
    try {
      result.optimize(result.getOutput());
    }
 catch (    RollbackRequiredException e) {
      throw new RuntimeException(e);
    }
  }
  if (benchmark) {
    String version=System.getProperty("String_Node_Str");
    String path=System.getProperty("String_Node_Str");
    if (path == null || path.length() == 0) {
      path="String_Node_Str";
    }
    String testClass=this.getClass().getSimpleName();
    final int REPETITIONS=5;
    long time=System.currentTimeMillis();
    long time2=0;
    for (int i=0; i < REPETITIONS; i++) {
      data.getHandle().release();
      result=anonymizer.anonymize(data,testCase.config);
      if (testCase.hashcode != -1) {
        try {
          result.optimize(result.getOutput());
        }
 catch (        RollbackRequiredException e) {
          throw new RuntimeException(e);
        }
      }
      time2+=result.getTime();
    }
    time=(System.currentTimeMillis() - time) / REPETITIONS;
    time2/=REPETITIONS;
    StringBuilder line=new StringBuilder();
    line.append(Resources.getVersion());
    line.append("String_Node_Str");
    line.append(version);
    line.append("String_Node_Str");
    line.append(testClass);
    line.append("String_Node_Str");
    line.append(testCase.id);
    line.append("String_Node_Str");
    line.append(time);
    line.append("String_Node_Str");
    line.append(time2);
    output(line.toString(),path + "String_Node_Str" + version+ "String_Node_Str"+ timestamp+ "String_Node_Str"+ testClass+ "String_Node_Str");
  }
  if (testCase.hashcode != -1) {
    int hashcode=23;
    DataHandle handle=result.getOutput();
    for (int row=0; row < handle.getNumRows(); row++) {
      for (int column=0; column < handle.getNumColumns(); column++) {
        hashcode=(37 * hashcode) + handle.getValue(row,column).hashCode();
      }
    }
    assertEquals("String_Node_Str",hashcode,testCase.hashcode);
    return;
  }
  if (testCase.optimalTransformation == null) {
    assertTrue(result.getGlobalOptimum() == null);
  }
 else {
    String lossActual=result.getGlobalOptimum().getMaximumInformationLoss().toString();
    String lossExpected=testCase.optimalInformationLoss;
    assertEquals(testCase.dataset + "String_Node_Str" + lossExpected+ "String_Node_Str"+ lossActual+ "String_Node_Str"+ result.getGlobalOptimum().getMinimumInformationLoss().toString()+ "String_Node_Str",lossExpected,lossActual);
    if (!Arrays.equals(result.getGlobalOptimum().getTransformation(),testCase.optimalTransformation)) {
      System.err.println("String_Node_Str");
      System.err.println("String_Node_Str" + Arrays.toString(testCase.optimalTransformation) + "String_Node_Str"+ Arrays.toString(result.getGlobalOptimum().getTransformation()));
      System.err.println("String_Node_Str" + testCase.toString());
    }
  }
  if (testCase.statistics != null) {
    int[] statistics=new int[7];
    for (    ARXNode[] level : result.getLattice().getLevels()) {
      for (      ARXNode arxNode : level) {
        statistics[0]++;
        if (arxNode.isChecked()) {
          statistics[1]++;
        }
        if (arxNode.getAnonymity() == Anonymity.ANONYMOUS) {
          statistics[2]++;
        }
        if (arxNode.getAnonymity() == Anonymity.NOT_ANONYMOUS) {
          statistics[3]++;
        }
        if (arxNode.getAnonymity() == Anonymity.PROBABLY_ANONYMOUS) {
          statistics[4]++;
        }
        if (arxNode.getAnonymity() == Anonymity.PROBABLY_NOT_ANONYMOUS) {
          statistics[5]++;
        }
        if (arxNode.getMaximumInformationLoss() == arxNode.getMinimumInformationLoss()) {
          statistics[6]++;
        }
      }
    }
    String algorithmConfiguration=getAlgorithmConfiguration(testCase.config);
    assertEquals(algorithmConfiguration + "String_Node_Str",testCase.statistics[0],statistics[0]);
    assertEquals(algorithmConfiguration + "String_Node_Str",testCase.statistics[1],statistics[1]);
    assertEquals(algorithmConfiguration + "String_Node_Str",testCase.statistics[2],statistics[2]);
    assertEquals(algorithmConfiguration + "String_Node_Str",testCase.statistics[3],statistics[3]);
    assertEquals(algorithmConfiguration + "String_Node_Str",testCase.statistics[4],statistics[4]);
    assertEquals(algorithmConfiguration + "String_Node_Str",testCase.statistics[5],statistics[5]);
    assertEquals(algorithmConfiguration + "String_Node_Str",testCase.statistics[6],statistics[6]);
  }
}