Program: 75588
Project: 75588
Buggy source:
/** 
 * Return a new array of length <i>newLength</i> that is formed by either truncating or padding the input array. Elements from the input array are copied to the output array, starting from array[startIdx] until one of the following conditions is met : 1) The input array has no more elements to copy. 2) The output array has been completely filled. <i>startIdx</i> must index a valid entry in <i>array</i> unless the input array is of zero length or the output array is of zero length. If case 1) is met, the remainder of the output array is filled with new complex numbers with value 0. Copying here means shallow copying, i.e. pointers to Complex objects are copied instead of allocation of new copies. This works because Complex objects are immutable.
 * @param array An array of complex numbers.
 * @param newLength The desired size of the output array.
 * @param startIdx The starting index for the input array.
 * @return A new array of length <i>newLength</i> that is formed byeither truncating or padding <i>array</i>.
 */
public static final Complex[] resize(final Complex[] array,final int newLength,final int startIdx){
  Complex[] returnValue=new Complex[newLength];
  int copySize=Math.min(newLength,array.length - startIdx);
  if ((startIdx >= array.length) && (copySize >= 0)) {
    throw new IllegalArgumentException("String_Node_Str" + "String_Node_Str");
  }
  if (copySize > 0) {
    System.arraycopy(array,startIdx,returnValue,0,copySize);
  }
  for (int i=copySize; i < newLength; i++) {
    returnValue[i]=Complex.ZERO;
  }
  return returnValue;
}

Fixed version (ground truth):
/** 
 * Return a new array of length <i>newLength</i> that is formed by either truncating or padding the input array. Elements from the input array are copied to the output array, starting from array[startIdx] until one of the following conditions is met : 1) The input array has no more elements to copy. 2) The output array has been completely filled. <i>startIdx</i> must index a valid entry in <i>array</i> unless the input array is of zero length or the output array is of zero length. If case 1) is met, the remainder of the output array is filled with new complex numbers with value 0. Copying here means shallow copying, i.e. pointers to Complex objects are copied instead of allocation of new copies. This works because Complex objects are immutable.
 * @param array An array of complex numbers.
 * @param newLength The desired size of the output array.
 * @param startIdx The starting index for the input array.
 * @return A new array of length <i>newLength</i> that is formed byeither truncating or padding <i>array</i>.
 */
public static final Complex[] resize(final Complex[] array,final int newLength,final int startIdx){
  Complex[] returnValue=new Complex[newLength];
  int copySize=Math.min(newLength,array.length - startIdx);
  if ((startIdx >= array.length) && (copySize > 0)) {
    throw new IllegalArgumentException("String_Node_Str" + startIdx + "String_Node_Str"+ array.length+ "String_Node_Str"+ copySize+ "String_Node_Str");
  }
  if (copySize > 0) {
    System.arraycopy(array,startIdx,returnValue,0,copySize);
  }
  for (int i=copySize; i < newLength; i++) {
    returnValue[i]=Complex.ZERO;
  }
  return returnValue;
}