Program: 67155
Project: 67155
Buggy source:
public void testTotalQuartile() throws Exception {
  IAggrFunction ag=buildInAggrFactory.getAggregation("String_Node_Str");
  Accumulator ac=ag.newAccumulator();
  assertEquals(IBuildInAggregation.TOTAL_QUARTILE_FUNC,ag.getName());
  assertEquals(IAggrFunction.SUMMARY_AGGR,ag.getType());
  assertEquals(2,ag.getParameterDefn().length);
  assertTrue(!ag.getParameterDefn()[0].isOptional());
  assertFalse(!ag.getParameterDefn()[1].isOptional());
  ac.start();
  for (int i=0; i < doubleArray3.length; i++) {
    ac.onRow(new Object[]{doubleArray3[i],new Double(0)});
  }
  ac.finish();
  Object value=ac.getValue();
  assertEquals(value,new Double(10));
  ac.start();
  for (int i=0; i < doubleArray3.length; i++) {
    ac.onRow(new Object[]{doubleArray3[i],new Double(1)});
  }
  ac.finish();
  value=ac.getValue();
  assertEquals(value,new Double(12.5));
  ac.start();
  for (int i=0; i < doubleArray3.length; i++) {
    ac.onRow(new Object[]{doubleArray3[i],new Double(2)});
  }
  ac.finish();
  value=ac.getValue();
  assertEquals(value,new Double(30));
  ac.start();
  for (int i=0; i < doubleArray3.length; i++) {
    ac.onRow(new Object[]{doubleArray3[i],new Double(3)});
  }
  ac.finish();
  value=ac.getValue();
  assertEquals(value,new Double(85));
  ac.start();
  for (int i=0; i < doubleArray3.length; i++) {
    ac.onRow(new Object[]{doubleArray3[i],new Double(4)});
  }
  ac.finish();
  value=ac.getValue();
  assertEquals(value,new Double(300));
  try {
    ac.start();
    for (int i=0; i < doubleArray3.length; i++) {
      ac.onRow(new Object[]{doubleArray3[i],new Double(5)});
    }
    ac.finish();
    fail("String_Node_Str");
  }
 catch (  DataException e) {
  }
  ac=ag.newAccumulator();
  ac.start();
  for (int i=0; i < bigDecimalArray.length; i++) {
    ac.onRow(new Object[]{bigDecimalArray[i],new Double(1)});
  }
  ac.finish();
  Object ret=ac.getValue();
  assertTrue(ret instanceof BigDecimal);
  assertTrue(new BigDecimal("String_Node_Str").compareTo((BigDecimal)ret) == 0);
}

Fixed version (ground truth):
public void testTotalQuartile() throws Exception {
  IAggrFunction ag=buildInAggrFactory.getAggregation("String_Node_Str");
  Accumulator ac=ag.newAccumulator();
  assertEquals(IBuildInAggregation.TOTAL_QUARTILE_FUNC,ag.getName());
  assertEquals(IAggrFunction.SUMMARY_AGGR,ag.getType());
  assertEquals(2,ag.getParameterDefn().length);
  assertTrue(!ag.getParameterDefn()[0].isOptional());
  assertFalse(ag.getParameterDefn()[1].isOptional());
  ac.start();
  for (int i=0; i < doubleArray3.length; i++) {
    ac.onRow(new Object[]{doubleArray3[i],new Double(0)});
  }
  ac.finish();
  Object value=ac.getValue();
  assertEquals(value,new Double(10));
  ac.start();
  for (int i=0; i < doubleArray3.length; i++) {
    ac.onRow(new Object[]{doubleArray3[i],new Double(1)});
  }
  ac.finish();
  value=ac.getValue();
  assertEquals(value,new Double(12.5));
  ac.start();
  for (int i=0; i < doubleArray3.length; i++) {
    ac.onRow(new Object[]{doubleArray3[i],new Double(2)});
  }
  ac.finish();
  value=ac.getValue();
  assertEquals(value,new Double(30));
  ac.start();
  for (int i=0; i < doubleArray3.length; i++) {
    ac.onRow(new Object[]{doubleArray3[i],new Double(3)});
  }
  ac.finish();
  value=ac.getValue();
  assertEquals(value,new Double(85));
  ac.start();
  for (int i=0; i < doubleArray3.length; i++) {
    ac.onRow(new Object[]{doubleArray3[i],new Double(4)});
  }
  ac.finish();
  value=ac.getValue();
  assertEquals(value,new Double(300));
  try {
    ac.start();
    for (int i=0; i < doubleArray3.length; i++) {
      ac.onRow(new Object[]{doubleArray3[i],new Double(5)});
    }
    ac.finish();
    fail("String_Node_Str");
  }
 catch (  DataException e) {
  }
  ac=ag.newAccumulator();
  ac.start();
  for (int i=0; i < bigDecimalArray.length; i++) {
    ac.onRow(new Object[]{bigDecimalArray[i],new Double(1)});
  }
  ac.finish();
  Object ret=ac.getValue();
  assertTrue(ret instanceof BigDecimal);
  assertTrue(new BigDecimal("String_Node_Str").compareTo((BigDecimal)ret) == 0);
}