if (length <= 0) return;
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);
  void removeImpl(int offset, int length) throws BadLocationException  {    // Prevent some unneccessary method invocation (observed in the RI).     if (length <= 0)      return;        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();      }   }