Program: 26074
Project: 26074
Buggy source:
/** 
 * Shallow copy a region of element object contents from one array to the other. <p> shallowCopy will copy all fields from each of the source elements to the corresponding fields in each of the corresponding destination elements. If the same array is both the src and dst then the copy will happen as if a temporary intermediate array was used. If <code>allowFinalFieldOverwrite</code> is specified as <code>true</code>, even final fields will be copied.
 * @param src array to copy.
 * @param srcOffset offset index in src where the region begins.
 * @param dst array into which the copy should occur.
 * @param dstOffset offset index in the dst where the region begins.
 * @param count of structure elements to copy.
 * @param allowFinalFieldOverwrite allow final fields to be overwritten during a copy operation.
 * @throws IllegalArgumentException if source or destination arrays have more than one dimension, orif final fields are discovered and all allowFinalFieldOverwrite is not true.
 * @throws ArrayStoreException if the element classes in src and dst are not identical.
 */
public static void shallowCopy(final StructuredArray src,final long srcOffset,final StructuredArray dst,final long dstOffset,final long count,final boolean allowFinalFieldOverwrite){
  if (src.getElementClass() != dst.getElementClass()) {
    String msg=String.format("String_Node_Str",src.getClass(),dst.getClass());
    throw new ArrayStoreException(msg);
  }
  if ((src.getDimensionCount() > 1) || (dst.getDimensionCount() > 1)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final Field[] fields=src.fields;
  if (!allowFinalFieldOverwrite && dst.hasFinalFields) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (((srcOffset + count) < Integer.MAX_VALUE) && ((dstOffset + count) < Integer.MAX_VALUE)) {
    if (dst == src && (dstOffset >= srcOffset && (dstOffset + count) >= srcOffset)) {
      for (int srcIdx=(int)(srcOffset + count), dstIdx=(int)(dstOffset + count), limit=(int)(srcOffset - 1); srcIdx > limit; srcIdx--, dstIdx--) {
        reverseShallowCopy(src.get(srcIdx),dst.get(dstIdx),fields);
      }
    }
 else {
      for (int srcIdx=(int)srcOffset, dstIdx=(int)dstOffset, limit=(int)(srcOffset + count); srcIdx < limit; srcIdx++, dstIdx++) {
        shallowCopy(src.get(srcIdx),dst.get(dstIdx),fields);
      }
    }
  }
 else {
    if (dst == src && (dstOffset >= srcOffset && (dstOffset + count) >= srcOffset)) {
      for (long srcIdx=srcOffset + count, dstIdx=dstOffset + count, limit=srcOffset - 1; srcIdx > limit; srcIdx--, dstIdx--) {
        reverseShallowCopy(src.get(srcIdx),dst.get(dstIdx),fields);
      }
    }
 else {
      for (long srcIdx=srcOffset, dstIdx=dstOffset, limit=srcOffset + count; srcIdx < limit; srcIdx++, dstIdx++) {
        shallowCopy(src.get(srcIdx),dst.get(dstIdx),fields);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Shallow copy a region of element object contents from one array to the other. <p> shallowCopy will copy all fields from each of the source elements to the corresponding fields in each of the corresponding destination elements. If the same array is both the src and dst then the copy will happen as if a temporary intermediate array was used. If <code>allowFinalFieldOverwrite</code> is specified as <code>true</code>, even final fields will be copied.
 * @param src array to copy.
 * @param srcOffset offset index in src where the region begins.
 * @param dst array into which the copy should occur.
 * @param dstOffset offset index in the dst where the region begins.
 * @param count of structure elements to copy.
 * @param allowFinalFieldOverwrite allow final fields to be overwritten during a copy operation.
 * @throws IllegalArgumentException if source or destination arrays have more than one dimension, orif final fields are discovered and all allowFinalFieldOverwrite is not true.
 * @throws ArrayStoreException if the element classes in src and dst are not identical.
 */
public static void shallowCopy(final StructuredArray src,final long srcOffset,final StructuredArray dst,final long dstOffset,final long count,final boolean allowFinalFieldOverwrite){
  if (src.getElementClass() != dst.getElementClass()) {
    String msg=String.format("String_Node_Str",src.getClass(),dst.getClass());
    throw new ArrayStoreException(msg);
  }
  if ((src.getDimensionCount() > 1) || (dst.getDimensionCount() > 1)) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final Field[] fields=src.fields;
  if (!allowFinalFieldOverwrite && dst.hasFinalFields) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (((srcOffset + count) < Integer.MAX_VALUE) && ((dstOffset + count) < Integer.MAX_VALUE)) {
    if (dst == src && (dstOffset >= srcOffset && (dstOffset + count) >= srcOffset)) {
      int srcIdx=(int)(srcOffset + count) - 1;
      int dstIdx=(int)(dstOffset + count) - 1;
      int limit=(int)(srcOffset - 1);
      for (; srcIdx > limit; srcIdx--, dstIdx--) {
        reverseShallowCopy(src.get(srcIdx),dst.get(dstIdx),fields);
      }
    }
 else {
      for (int srcIdx=(int)srcOffset, dstIdx=(int)dstOffset, limit=(int)(srcOffset + count); srcIdx < limit; srcIdx++, dstIdx++) {
        shallowCopy(src.get(srcIdx),dst.get(dstIdx),fields);
      }
    }
  }
 else {
    if (dst == src && (dstOffset >= srcOffset && (dstOffset + count) >= srcOffset)) {
      for (long srcIdx=srcOffset + count, dstIdx=dstOffset + count, limit=srcOffset - 1; srcIdx > limit; srcIdx--, dstIdx--) {
        reverseShallowCopy(src.get(srcIdx),dst.get(dstIdx),fields);
      }
    }
 else {
      for (long srcIdx=srcOffset, dstIdx=dstOffset, limit=srcOffset + count; srcIdx < limit; srcIdx++, dstIdx++) {
        shallowCopy(src.get(srcIdx),dst.get(dstIdx),fields);
      }
    }
  }
}