private void checkLocation(int where, int len) throws BadLocationException
void checkLocation(int where, int len) throws BadLocationException
  private void checkLocation(int where, int len) throws BadLocationException  {    if (where < 0)      throw new BadLocationException("Invalid location", 1);    else if (where > this.count)      throw new BadLocationException("Invalid location", this.count);    else if ((where + len)>this.count)      throw new BadLocationException("Invalid range", this.count);  }