Program: 69582
Project: 69582
Buggy source:
public ICachedObject createInstance(Object[] fields){
  GroupBoundaryInfo groupBoundaryInfo=new GroupBoundaryInfo(((Integer)fields[0]).intValue(),((Integer)fields[1]).intValue());
  Object[] sortKeys=null;
  int sortKeysTotalLength=1;
  if (fields[2] != null) {
    sortKeys=new Object[((Integer)fields[2]).intValue()];
    System.arraycopy(fields,3,sortKeys,0,sortKeys.length);
    sortKeysTotalLength=sortKeys.length + 1;
  }
  boolean[] sortDirections=null;
  if (fields[2 + sortKeysTotalLength] != null) {
    sortDirections=new boolean[((Integer)fields[2 + sortKeysTotalLength]).intValue()];
    for (int i=0; i < sortDirections.length; i++) {
      sortDirections[i]=((Boolean)fields[3 + sortKeysTotalLength + i]).booleanValue();
    }
  }
  int[] sortStrength=null;
  if (fields[2 + sortKeysTotalLength * 2] != null) {
    sortStrength=new int[((Integer)fields[2 + sortKeysTotalLength * 2]).intValue()];
    for (int i=0; i < sortStrength.length; i++) {
      sortStrength[i]=((Integer)fields[3 + sortKeysTotalLength * 2 + i]).intValue();
    }
  }
  ULocale[] locales=null;
  if (fields[2 + sortKeysTotalLength * 3] != null) {
    locales=new ULocale[((Integer)fields[2 + sortKeysTotalLength * 3]).intValue()];
    for (int i=0; i < sortStrength.length; i++) {
      Object locale=fields[3 + sortKeysTotalLength * 3 + i];
      if (locale != null)       locales[i]=new ULocale((String)locale);
    }
  }
  groupBoundaryInfo.setSortCondition(sortKeys,sortDirections,sortStrength,locales);
  groupBoundaryInfo.setAccepted(((Boolean)fields[fields.length - 1]).booleanValue());
  return groupBoundaryInfo;
}

Fixed version (ground truth):
public ICachedObject createInstance(Object[] fields){
  GroupBoundaryInfo groupBoundaryInfo=new GroupBoundaryInfo(((Integer)fields[0]).intValue(),((Integer)fields[1]).intValue());
  Object[] sortKeys=null;
  int sortKeysTotalLength=1;
  if (fields[2] != null) {
    sortKeys=new Object[((Integer)fields[2]).intValue()];
    System.arraycopy(fields,3,sortKeys,0,sortKeys.length);
    sortKeysTotalLength=sortKeys.length + 1;
  }
  boolean[] sortDirections=null;
  if (fields[2 + sortKeysTotalLength] != null) {
    sortDirections=new boolean[((Integer)fields[2 + sortKeysTotalLength]).intValue()];
    for (int i=0; i < sortDirections.length; i++) {
      sortDirections[i]=((Boolean)fields[3 + sortKeysTotalLength + i]).booleanValue();
    }
  }
  int[] sortStrength=null;
  ULocale[] locales=null;
  if (fields[2 + sortKeysTotalLength * 2] != null) {
    sortStrength=new int[((Integer)fields[2 + sortKeysTotalLength * 2]).intValue()];
    for (int i=0; i < sortStrength.length; i++) {
      sortStrength[i]=((Integer)fields[3 + sortKeysTotalLength * 2 + i]).intValue();
    }
    locales=new ULocale[sortStrength.length];
    for (int i=0; i < sortStrength.length; i++) {
      Object locale=fields[2 + sortKeysTotalLength * 3 + i];
      if (locale != null)       locales[i]=new ULocale((String)locale);
    }
  }
  groupBoundaryInfo.setSortCondition(sortKeys,sortDirections,sortStrength,locales);
  groupBoundaryInfo.setAccepted(((Boolean)fields[fields.length - 1]).booleanValue());
  return groupBoundaryInfo;
}