}
  void removeImpl(int offset, int length) throws BadLocationException  {    // The RI silently ignores all requests that have a negative length.    // Don't ask my why, but that's how it is.    if (length > 0)      {        if (offset < 0 || offset > getLength())          throw new BadLocationException("Invalid remove position", offset);        if (offset + length > getLength())          throw new BadLocationException("Invalid remove length", offset);        DefaultDocumentEvent event =      new DefaultDocumentEvent(offset, length,			       DocumentEvent.EventType.REMOVE);        try      {    writeLock();                // The order of the operations below is critical!                removeUpdate(event);        UndoableEdit temp = content.remove(offset, length);            postRemoveUpdate(event);    fireRemoveUpdate(event);  }    finally      {        writeUnlock();      }   }  }