Program: 67315
Project: 67315
Buggy source:
private DataSet adjustEachDataSet(DataSet ds,List<Integer> indexMap){
  Collection<Object> co;
  double[] da;
  Double[] dda;
  long[] la;
  Calendar[] ca;
  String[] sa;
  Object[] oa;
  BigNumber[] bna;
  int[] indexArray=new int[indexMap.size()];
  for (int i=0; i < indexArray.length; i++) {
    indexArray[i]=indexMap.get(i).intValue();
  }
  Object oContent=ds.getValues();
  if (ds instanceof NumberDataSet) {
    if (oContent instanceof Collection) {
      co=(Collection)oContent;
      Object[] objBuffer=new Object[indexArray.length];
      int i=0;
      for (Iterator itr=co.iterator(); itr.hasNext(); ) {
        Object o=itr.next();
        int idx=indexArray[i++];
        if (idx != -1) {
          objBuffer[idx]=o;
        }
      }
      co.clear();
      for (i=0; i < objBuffer.length; i++) {
        co.add(objBuffer[i]);
      }
    }
 else     if (oContent instanceof double[]) {
      da=(double[])oContent;
      double[] doubleBuffer=new double[indexArray.length];
      Arrays.fill(doubleBuffer,Double.NaN);
      for (int i=0; i < da.length; i++) {
        int idx=indexArray[i];
        if (idx != -1) {
          doubleBuffer[idx]=da[i];
        }
      }
      ds.setValues(doubleBuffer);
    }
 else     if (oContent instanceof Double[]) {
      dda=(Double[])oContent;
      Double[] doubleBuffer=new Double[indexArray.length];
      for (int i=0; i < dda.length; i++) {
        int idx=indexArray[i];
        if (idx != -1) {
          doubleBuffer[idx]=dda[i];
        }
      }
      ds.setValues(doubleBuffer);
    }
 else     if (oContent instanceof Number) {
      da=new double[]{((Number)oContent).doubleValue()};
      double[] doubleBuffer=new double[indexArray.length];
      Arrays.fill(doubleBuffer,Double.NaN);
      int idx=indexArray[0];
      if (idx != -1) {
        doubleBuffer[idx]=da[0];
      }
      ds.setValues(doubleBuffer);
    }
 else     if (oContent instanceof BigNumber[]) {
      bna=(BigNumber[])oContent;
      BigNumber[] bigNumberBuffer=new BigNumber[indexArray.length];
      for (int i=0; i < bna.length; i++) {
        int idx=indexArray[i];
        if (idx != -1) {
          bigNumberBuffer[idx]=bna[i];
        }
      }
      ds.setValues(bigNumberBuffer);
    }
  }
 else   if (ds instanceof DateTimeDataSet) {
    if (oContent instanceof Collection) {
      co=(Collection)oContent;
      Object[] objBuffer=new Object[indexArray.length];
      int i=0;
      for (Iterator itr=co.iterator(); itr.hasNext(); ) {
        Object o=itr.next();
        int idx=indexArray[i++];
        if (idx != -1) {
          objBuffer[idx]=o;
        }
      }
      co.clear();
      for (i=0; i < objBuffer.length; i++) {
        co.add(objBuffer[i]);
      }
    }
 else     if (oContent instanceof long[]) {
      la=(long[])oContent;
      double[] longBuffer=new double[indexArray.length];
      Arrays.fill(longBuffer,Double.NaN);
      for (int i=0; i < la.length; i++) {
        int idx=indexArray[i];
        if (idx != -1) {
          longBuffer[idx]=la[i];
        }
      }
      ds.setValues(longBuffer);
    }
 else     if (oContent instanceof Calendar[]) {
      ca=(Calendar[])oContent;
      Calendar[] calendarBuffer=new Calendar[indexArray.length];
      for (int i=0; i < ca.length; i++) {
        int idx=indexArray[i];
        if (idx != -1) {
          calendarBuffer[idx]=ca[i];
        }
      }
      ds.setValues(calendarBuffer);
    }
  }
 else   if (ds instanceof TextDataSet) {
    if (oContent instanceof Collection) {
      co=(Collection)oContent;
      Object[] objBuffer=new Object[indexArray.length];
      int i=0;
      for (Iterator itr=co.iterator(); itr.hasNext(); ) {
        Object o=itr.next();
        int idx=indexArray[i++];
        if (idx != -1) {
          objBuffer[idx]=o;
        }
      }
      co.clear();
      for (i=0; i < objBuffer.length; i++) {
        co.add(objBuffer[i]);
      }
    }
 else     if (oContent instanceof String[]) {
      sa=(String[])oContent;
      String[] stringBuffer=new String[indexArray.length];
      for (int i=0; i < sa.length; i++) {
        int idx=indexArray[i];
        if (idx != -1) {
          stringBuffer[idx]=sa[i];
        }
      }
      ds.setValues(stringBuffer);
    }
  }
 else {
    if (oContent instanceof Collection) {
      co=(Collection)oContent;
      Object[] objBuffer=new Object[indexArray.length];
      int i=0;
      for (Iterator itr=co.iterator(); itr.hasNext(); ) {
        Object o=itr.next();
        int idx=indexArray[i++];
        if (idx != -1) {
          objBuffer[idx]=o;
        }
      }
      co.clear();
      for (i=0; i < objBuffer.length; i++) {
        co.add(objBuffer[i]);
      }
    }
 else     if (oContent instanceof Object[]) {
      oa=(Object[])oContent;
      Object[] objectBuffer=new Object[indexArray.length];
      for (int i=0; i < oa.length; i++) {
        int idx=indexArray[i];
        if (idx != -1) {
          objectBuffer[idx]=oa[i];
        }
      }
      ds.setValues(objectBuffer);
    }
  }
  return ds;
}

Fixed version (ground truth):
private DataSet adjustEachDataSet(DataSet ds,List<Integer> indexMap){
  Collection<Object> co;
  double[] da;
  Double[] dda;
  long[] la;
  Calendar[] ca;
  String[] sa;
  Object[] oa;
  BigNumber[] bna;
  int[] indexArray=new int[indexMap.size()];
  for (int i=0; i < indexArray.length; i++) {
    indexArray[i]=indexMap.get(i).intValue();
  }
  Object oContent=ds.getValues();
  if (ds instanceof NumberDataSet) {
    if (oContent instanceof Collection) {
      co=(Collection)oContent;
      Object[] objBuffer=new Object[indexArray.length];
      int i=0;
      for (Iterator itr=co.iterator(); itr.hasNext(); ) {
        Object o=itr.next();
        int idx=indexArray[i++];
        if (idx != -1) {
          objBuffer[idx]=o;
        }
      }
      co.clear();
      for (i=0; i < objBuffer.length; i++) {
        co.add(objBuffer[i]);
      }
    }
 else     if (oContent instanceof double[]) {
      da=(double[])oContent;
      double[] doubleBuffer=new double[indexArray.length];
      Arrays.fill(doubleBuffer,Double.NaN);
      for (int i=0; i < da.length; i++) {
        int idx=indexArray[i];
        if (idx != -1) {
          doubleBuffer[idx]=da[i];
        }
      }
      ds.setValues(doubleBuffer);
    }
 else     if (oContent instanceof Double[]) {
      dda=(Double[])oContent;
      Double[] doubleBuffer=new Double[indexArray.length];
      for (int i=0; i < dda.length; i++) {
        int idx=indexArray[i];
        if (idx != -1) {
          doubleBuffer[idx]=dda[i];
        }
      }
      ds.setValues(doubleBuffer);
    }
 else     if (oContent instanceof Number) {
      da=new double[]{((Number)oContent).doubleValue()};
      double[] doubleBuffer=new double[indexArray.length];
      Arrays.fill(doubleBuffer,Double.NaN);
      int idx=indexArray[0];
      if (idx != -1) {
        doubleBuffer[idx]=da[0];
      }
      ds.setValues(doubleBuffer);
    }
 else     if (oContent instanceof BigNumber[]) {
      bna=(BigNumber[])oContent;
      BigNumber[] bigNumberBuffer=new BigNumber[indexArray.length];
      for (int i=0; i < bna.length; i++) {
        int idx=indexArray[i];
        if (idx != -1) {
          bigNumberBuffer[idx]=bna[i];
        }
      }
      ds.setValues(bigNumberBuffer);
    }
 else     if (oContent instanceof Number[]) {
      Number[] na=(Number[])oContent;
      Number[] numberBuffer=new Number[indexArray.length];
      for (int i=0; i < na.length; i++) {
        int idx=indexArray[i];
        if (idx != -1) {
          numberBuffer[idx]=na[i];
        }
      }
      ds.setValues(numberBuffer);
    }
  }
 else   if (ds instanceof DateTimeDataSet) {
    if (oContent instanceof Collection) {
      co=(Collection)oContent;
      Object[] objBuffer=new Object[indexArray.length];
      int i=0;
      for (Iterator itr=co.iterator(); itr.hasNext(); ) {
        Object o=itr.next();
        int idx=indexArray[i++];
        if (idx != -1) {
          objBuffer[idx]=o;
        }
      }
      co.clear();
      for (i=0; i < objBuffer.length; i++) {
        co.add(objBuffer[i]);
      }
    }
 else     if (oContent instanceof long[]) {
      la=(long[])oContent;
      double[] longBuffer=new double[indexArray.length];
      Arrays.fill(longBuffer,Double.NaN);
      for (int i=0; i < la.length; i++) {
        int idx=indexArray[i];
        if (idx != -1) {
          longBuffer[idx]=la[i];
        }
      }
      ds.setValues(longBuffer);
    }
 else     if (oContent instanceof Calendar[]) {
      ca=(Calendar[])oContent;
      Calendar[] calendarBuffer=new Calendar[indexArray.length];
      for (int i=0; i < ca.length; i++) {
        int idx=indexArray[i];
        if (idx != -1) {
          calendarBuffer[idx]=ca[i];
        }
      }
      ds.setValues(calendarBuffer);
    }
  }
 else   if (ds instanceof TextDataSet) {
    if (oContent instanceof Collection) {
      co=(Collection)oContent;
      Object[] objBuffer=new Object[indexArray.length];
      int i=0;
      for (Iterator itr=co.iterator(); itr.hasNext(); ) {
        Object o=itr.next();
        int idx=indexArray[i++];
        if (idx != -1) {
          objBuffer[idx]=o;
        }
      }
      co.clear();
      for (i=0; i < objBuffer.length; i++) {
        co.add(objBuffer[i]);
      }
    }
 else     if (oContent instanceof String[]) {
      sa=(String[])oContent;
      String[] stringBuffer=new String[indexArray.length];
      for (int i=0; i < sa.length; i++) {
        int idx=indexArray[i];
        if (idx != -1) {
          stringBuffer[idx]=sa[i];
        }
      }
      ds.setValues(stringBuffer);
    }
  }
 else {
    if (oContent instanceof Collection) {
      co=(Collection)oContent;
      Object[] objBuffer=new Object[indexArray.length];
      int i=0;
      for (Iterator itr=co.iterator(); itr.hasNext(); ) {
        Object o=itr.next();
        int idx=indexArray[i++];
        if (idx != -1) {
          objBuffer[idx]=o;
        }
      }
      co.clear();
      for (i=0; i < objBuffer.length; i++) {
        co.add(objBuffer[i]);
      }
    }
 else     if (oContent instanceof Object[]) {
      oa=(Object[])oContent;
      Object[] objectBuffer=new Object[indexArray.length];
      for (int i=0; i < oa.length; i++) {
        int idx=indexArray[i];
        if (idx != -1) {
          objectBuffer[idx]=oa[i];
        }
      }
      ds.setValues(objectBuffer);
    }
  }
  return ds;
}