Program: 11898
Project: 11898
Buggy source:
/** 
 * Adds each object from start to end of the array at each successive index in the list  and returns whether any objects were added; it does no ranging checking or uniqueness checking. This implementation delegates to   {@link #assign assign},   {@link #didAdd didAdd}, and   {@link #didChange didChange}. In addition to the normal effects,  this override implementation generates notifications as   {@link #isNotificationRequired required} and delegates to  {@link #inverseAdd inverseAdd} as {@link #hasInverse required}.
 * @param index the index at which to add.
 * @param objects the objects to be added.
 * @param start the index of first object to be added.
 * @param end the index past the last object to be added.
 * @return whether any objects were added.
 * @see #addAllUnique(int,Collection)
 * @see #isNotificationRequired
 * @see #hasInverse
 * @see #inverseAdd
 */
public boolean addAllUnique(int index,Object[] objects,int start,int end){
  int collectionSize=end - start;
  if (collectionSize == 0) {
    return false;
  }
 else {
    if (isNotificationRequired()) {
      boolean oldIsSet=isSet();
      doAddAllUnique(index,objects,start,end);
      NotificationImpl notification;
      if (collectionSize == 0) {
        notification=createNotification(Notification.ADD,null,objects[0],index,oldIsSet);
      }
 else {
        if (start != 0 || end != objects.length) {
          Object[] actualObjects=new Object[collectionSize];
          for (int i=0, j=start; j < end; ++i, ++j) {
            actualObjects[i]=objects[j];
          }
          notification=createNotification(Notification.ADD_MANY,null,actualObjects,index,oldIsSet);
        }
 else {
          notification=createNotification(Notification.ADD_MANY,null,objects,index,oldIsSet);
        }
      }
      if (hasInverse()) {
        NotificationChain notifications=createNotificationChain(collectionSize);
        int lastIndex=index + collectionSize;
        for (int i=index; i < lastIndex; ++i) {
          Object value=delegateGet(i);
          notifications=inverseAdd(value,notifications);
          notifications=shadowAdd(value,notifications);
        }
        if (notifications == null) {
          dispatchNotification(notification);
        }
 else {
          notifications.add(notification);
          notifications.dispatch();
        }
      }
 else {
        dispatchNotification(notification);
      }
    }
 else {
      doAddAllUnique(index,objects,start,end);
      if (hasInverse()) {
        NotificationChain notifications=createNotificationChain(collectionSize);
        int lastIndex=index + collectionSize;
        for (int i=index; i < lastIndex; ++i) {
          notifications=inverseAdd(delegateGet(i),notifications);
        }
        if (notifications != null)         notifications.dispatch();
      }
    }
    return true;
  }
}

Fixed version (ground truth):
/** 
 * Adds each object from start to end of the array at each successive index in the list  and returns whether any objects were added; it does no ranging checking or uniqueness checking. This implementation delegates to   {@link #assign assign},   {@link #didAdd didAdd}, and   {@link #didChange didChange}. In addition to the normal effects,  this override implementation generates notifications as   {@link #isNotificationRequired required} and delegates to  {@link #inverseAdd inverseAdd} as {@link #hasInverse required}.
 * @param index the index at which to add.
 * @param objects the objects to be added.
 * @param start the index of first object to be added.
 * @param end the index past the last object to be added.
 * @return whether any objects were added.
 * @see #addAllUnique(int,Collection)
 * @see #isNotificationRequired
 * @see #hasInverse
 * @see #inverseAdd
 */
public boolean addAllUnique(int index,Object[] objects,int start,int end){
  int collectionSize=end - start;
  if (collectionSize == 0) {
    return false;
  }
 else {
    if (isNotificationRequired()) {
      boolean oldIsSet=isSet();
      doAddAllUnique(index,objects,start,end);
      NotificationImpl notification;
      if (collectionSize == 1) {
        notification=createNotification(Notification.ADD,null,objects[0],index,oldIsSet);
      }
 else {
        if (start != 0 || end != objects.length) {
          Object[] actualObjects=new Object[collectionSize];
          for (int i=0, j=start; j < end; ++i, ++j) {
            actualObjects[i]=objects[j];
          }
          notification=createNotification(Notification.ADD_MANY,null,Arrays.asList(actualObjects),index,oldIsSet);
        }
 else {
          notification=createNotification(Notification.ADD_MANY,null,Arrays.asList(objects),index,oldIsSet);
        }
      }
      if (hasInverse()) {
        NotificationChain notifications=createNotificationChain(collectionSize);
        int lastIndex=index + collectionSize;
        for (int i=index; i < lastIndex; ++i) {
          Object value=delegateGet(i);
          notifications=inverseAdd(value,notifications);
          notifications=shadowAdd(value,notifications);
        }
        if (notifications == null) {
          dispatchNotification(notification);
        }
 else {
          notifications.add(notification);
          notifications.dispatch();
        }
      }
 else {
        dispatchNotification(notification);
      }
    }
 else {
      doAddAllUnique(index,objects,start,end);
      if (hasInverse()) {
        NotificationChain notifications=createNotificationChain(collectionSize);
        int lastIndex=index + collectionSize;
        for (int i=index; i < lastIndex; ++i) {
          notifications=inverseAdd(delegateGet(i),notifications);
        }
        if (notifications != null)         notifications.dispatch();
      }
    }
    return true;
  }
}