Program: 76476
Project: 76476
Buggy source:
/** 
 * Return an object in the queue or history. The object is not removed from the queue or history. If the offset argument is zero, return the oldest object in the queue. If the offset is 1, return the second oldest object, etc. If there is no such object in the queue (the offset is greater than or equal to the current queue size), throw an exception. If the argument is -1, return the most recent object that was put in the history. If the argument is -2, return the second most recent object in the history, etc. If there is no such object in the history (the history capacity is zero or the absolute value of the offset is greater than the current size of the history queue), throw an exception.
 * @param offset The position of the desired object.
 * @return The desired object in the queue or history.
 * @exception NoSuchElementException If the offset is out of range.
 */
public Object get(int offset) throws NoSuchElementException {
  Object obj=null;
  try {
    if (offset >= 0) {
      int loc=_queueback + offset;
      if (loc > _queuefront)       throw new NoSuchElementException("String_Node_Str");
 else       if (loc >= _queuecapacity)       loc=loc % _queuecapacity;
      obj=_queuearray[loc];
    }
 else {
      obj=_historylist.at(historySize() + offset);
    }
  }
 catch (  NoSuchElementException ex) {
    String str="String_Node_Str";
    if (_container != null) {
      str="String_Node_Str" + _container.getFullName();
    }
    throw new NoSuchElementException("String_Node_Str" + offset + "String_Node_Str"+ str);
  }
  return obj;
}

Fixed version (ground truth):
/** 
 * Return an object in the queue or history. The object is not removed from the queue or history. If the offset argument is zero, return the oldest object in the queue. If the offset is 1, return the second oldest object, etc. If there is no such object in the queue (the offset is greater than or equal to the current queue size), throw an exception. If the argument is -1, return the most recent object that was put in the history. If the argument is -2, return the second most recent object in the history, etc. If there is no such object in the history (the history capacity is zero or the absolute value of the offset is greater than the current size of the history queue), throw an exception.
 * @param offset The position of the desired object.
 * @return The desired object in the queue or history.
 * @exception NoSuchElementException If the offset is out of range.
 */
public Object get(int offset) throws NoSuchElementException {
  Object obj=null;
  try {
    if (offset >= 0) {
      int loc=_queueback + offset;
      if (loc >= _queuecapacity)       loc=loc % _queuecapacity;
      if (loc >= _queuefront) {
        String str="String_Node_Str";
        if (_container != null) {
          str="String_Node_Str" + _container.getFullName();
        }
        throw new NoSuchElementException("String_Node_Str" + offset + "String_Node_Str"+ str);
      }
 else       if (loc >= _queuecapacity)       loc=loc % _queuecapacity;
      obj=_queuearray[loc];
    }
 else {
      obj=_historylist.at(historySize() + offset);
    }
  }
 catch (  NoSuchElementException ex) {
    String str="String_Node_Str";
    if (_container != null) {
      str="String_Node_Str" + _container.getFullName();
    }
    throw new NoSuchElementException("String_Node_Str" + offset + "String_Node_Str"+ str);
  }
  return obj;
}