assert false : "Unexpected bad caret location: " + dot; return;
AssertionError ae; ae = new AssertionError("Unexpected bad caret location: " + dot); ae.initCause(e); throw ae;
  public void paint(Graphics g)  {    JTextComponent comp = getComponent();    if (comp == null)      return;    int dot = getDot();    Rectangle rect = null;    try      {	rect = textComponent.modelToView(dot);      }    catch (BadLocationException e)      {        assert false : "Unexpected bad caret location: " + dot;	return;      }    if (rect == null)      return;        // Check if paint has possibly been called directly, without a previous    // call to damage(). In this case we need to do some cleanup first.    if ((x != rect.x) || (y != rect.y))      {        repaint(); // Erase previous location of caret.        x = rect.x;        y = rect.y;        width = 1;        height = rect.height;      }        // Now draw the caret on the new position if visible.    if (visible)      {	g.setColor(textComponent.getCaretColor());	g.drawLine(rect.x, rect.y, rect.x, rect.y + rect.height);      }  }