int max = mod.getChildCount(curr);
int max = 0; if (!mod.isLeaf(curr)) max = mod.getChildCount(curr);
  int paintRecursive(Graphics g, int indentation, int descent, int childNumber,                     int depth, JTree tree, TreeModel mod, Object curr)  {    Rectangle clip = g.getClipBounds();		if (indentation > clip.x + clip.width + rightChildIndent				|| descent > clip.y + clip.height + getRowHeight())      return descent;		int halfHeight = getRowHeight() / 2;    int halfWidth = rightChildIndent / 2;    int y0 = descent + halfHeight;      int heightOfLine = descent + halfHeight;      boolean isRootVisible = tree.isRootVisible();            if (mod.isLeaf(curr))      {         paintNode(g, indentation + 4, descent, tree, curr, true);			descent += getRowHeight();      }      else      {         if (depth > 0 || isRootVisible)          {            paintNode(g, indentation + 4, descent, tree, curr, false);				descent += getRowHeight();            y0 += halfHeight;          }        int max = mod.getChildCount(curr);        if (tree.isExpanded(new TreePath(getPathToRoot(curr, 0))))         {            for (int i = 0; i < max; i++)          {               int indent = indentation + rightChildIndent;               if (!isRootVisible && depth == 0)                  indent = 0;                else if ((!isRootVisible && !curr.equals(mod.getRoot()))                         || isRootVisible)               {				g.setColor(getHashColor());               heightOfLine = descent + halfHeight;                    g.drawLine(indentation + halfWidth, heightOfLine,                               indentation + rightChildIndent, heightOfLine);               }                                  descent = paintRecursive(g, indent, descent, i, depth + 1,                                         tree, mod, mod.getChild(curr, i));          }      }      }    if (tree.isExpanded(new TreePath(getPathToRoot(curr, 0))))      if (y0 != heightOfLine && mod.getChildCount(curr) > 0)      {			g.setColor(getHashColor());            g.drawLine(indentation + halfWidth, y0, indentation + halfWidth,                  heightOfLine);      }            return descent;   }