Add exceptions for the executable member.

@param member the member to write exceptions for.
@param htmltree the content tree to which the exceptions information will be added.
334389
protected void addExceptions(ExecutableMemberDoc member, Content htmltree, int indentSize) {
        Type[] exceptions = member.thrownExceptionTypes();
        if (exceptions.length > 0) {
            LinkInfoImpl memberTypeParam = new LinkInfoImpl(configuration,
                    LinkInfoImpl.Kind.MEMBER, member);
            String indent = makeSpace(indentSize + 1 - 7);
            htmltree.addContent(DocletConstants.NL);
            htmltree.addContent(indent);
            htmltree.addContent("throws ");
            indent = makeSpace(indentSize + 1);
            Content link = writer.getLink(new LinkInfoImpl(configuration,
                    LinkInfoImpl.Kind.MEMBER, exceptions[0]));
            htmltree.addContent(link);
            for(int i = 1; i < exceptions.length; i++) {
                htmltree.addContent(",");
                htmltree.addContent(DocletConstants.NL);
                htmltree.addContent(indent);
                Content exceptionLink = writer.getLink(new LinkInfoImpl(
                        configuration, LinkInfoImpl.Kind.MEMBER, exceptions[i]));
                htmltree.addContent(exceptionLink);
            }
        }
    }
1084891
protected void addClassListing(HtmlTree contentTree) {
        List<PackageElement> packagesIn = ElementFilter.packagesIn(mdle.getEnclosedElements());
        SortedSet<TypeElement> interfaces = new TreeSet<>(utils.makeGeneralPurposeComparator());
        SortedSet<TypeElement> classes = new TreeSet<>(utils.makeGeneralPurposeComparator());
        SortedSet<TypeElement> enums = new TreeSet<>(utils.makeGeneralPurposeComparator());
        SortedSet<TypeElement> exceptions = new TreeSet<>(utils.makeGeneralPurposeComparator());
        SortedSet<TypeElement> errors = new TreeSet<>(utils.makeGeneralPurposeComparator());
        SortedSet<TypeElement> annotationTypes = new TreeSet<>(utils.makeGeneralPurposeComparator());
        for (PackageElement pkg : packagesIn) {
            if (utils.isIncluded(pkg)) {
                interfaces.addAll(utils.getInterfaces(pkg));
                classes.addAll(utils.getOrdinaryClasses(pkg));
                enums.addAll(utils.getEnums(pkg));
                exceptions.addAll(utils.getExceptions(pkg));
                errors.addAll(utils.getErrors(pkg));
                annotationTypes.addAll(utils.getAnnotationTypes(pkg));
            }
        }
        addClassKindListing(interfaces, contents.interfaces, contentTree);
        addClassKindListing(classes, contents.classes, contentTree);
        addClassKindListing(enums, contents.enums, contentTree);
        addClassKindListing(exceptions, contents.exceptions, contentTree);
        addClassKindListing(errors, contents.errors, contentTree);
        addClassKindListing(annotationTypes, contents.annotationTypes, contentTree);
    }
208332
protected void addDescription(Element member, Content dlTree, SearchIndexItem si) {

        si.setContainingPackage(utils.getPackageName(utils.containingPackage(member)));
        si.setContainingClass(utils.getSimpleName(utils.getEnclosingTypeElement(member)));
        String name = utils.getSimpleName(member);
        if (utils.isExecutableElement(member)) {
            ExecutableElement ee = (ExecutableElement)member;
            name = name + utils.flatSignature(ee);
            si.setLabel(name);
            if (!((utils.signature(ee)).equals(utils.flatSignature(ee)))) {
                si.setUrl(getName(getAnchor(ee)));
            }

        }  else {
            si.setLabel(name);
        }
        si.setCategory(resources.getText("doclet.Members"));
        Content span = HtmlTree.SPAN(HtmlStyle.memberNameLink,
                getDocLink(LinkInfoImpl.Kind.INDEX, member, name));
        Content dt = HtmlTree.DT(span);
        dt.addContent(" - ");
        addMemberDesc(member, dt);
        dlTree.addContent(dt);
        Content dd = new HtmlTree(HtmlTag.DD);
        addComment(member, dd);
        dlTree.addContent(dd);
    }
910426
def add_flow_exception(exc):
  
  global _flow_exceptions
  if not isinstance(exc, type) or not issubclass(exc, Exception):
    raise TypeError('Expected an Exception subclass, got %r' % (exc,))
  as_set = set(_flow_exceptions)
  as_set.add(exc)
  _flow_exceptions = tuple(as_set)
746665
public void addException(Exception e) {
        if (exceptions == null) {
            exceptions = new ArrayList<>();
        }
        exceptions.add(e);
        log.error(e.getMessage(), e);
    }
1264284
public void addException(Exception exception) {
        LOGGER.log(Level.FINE, "Adding exception", exception);
        exceptionsToPublish.add(exception);
    }
933833
public void putExceptionThrownRule(ExceptionThrownRule exceptionThrownRule) {
        exceptionThrownRuleList.add(exceptionThrownRule);

        String[] exceptionTypes = exceptionThrownRule.getExceptionTypes();
        if (exceptionTypes != null) {
            for (String exceptionType : exceptionTypes) {
                if (exceptionType != null) {
                    if (!exceptionThrownRuleMap.containsKey(exceptionType)) {
                        exceptionThrownRuleMap.put(exceptionType, exceptionThrownRule);
                    }
                }
            }
        } else {
            defaultExceptionThrownRule = exceptionThrownRule;
        }
    }
1079784
protected void addIndexComment(Element member, Content contentTree) {
        List<? extends DocTree> tags = utils.getFirstSentenceTrees(member);
        addIndexComment(member, tags, contentTree);
    }
1364720
public void setTree(CmsTree<CmsTreeItem> tree) {

        m_tree = tree;
        for (Widget widget : m_children) {
            if (widget instanceof CmsTreeItem) {
                ((CmsTreeItem)widget).setTree(tree);
            }
        }
    }
566222
public void onNodeFailed(final IExecutionNode node, final Throwable t) {
        // TODO do something with the exception

        if (node.equals(this.theLastNode)) {
            printFailed("FAILED: " + format(this.theLastNode));
        } else {

            // print the last one first
            if (this.theLastNode != null) {
                printStarted("Starting: " + format(this.theLastNode));
            }

            printFailed("FAILED: " + format(node));
        }
        this.theLastNode = null;
    }
15997
public void doTag()
            throws JspException, IOException
    {
        if (hasErrors()) {
            reportErrors();
            return;
        }

        // See if there is a TreeRoot already defined.
        _expr = new ExpressionHandling(this);
        TreeElement root = null;
        try {
            root = getTreeRoot(_expr);
        }
        catch (IllegalExpressionException iee) {
            String s = Bundle.getString("TreeRootError", new Object[]{_dataSource, iee.getMessage()});
            registerTagError(s, null);
            return;
        }
        if (hasErrors()) {
            reportErrors();
            return;
        }

        // If we don't have a root element, then we need to create it by processing the body which contains
        // /*<TreeItems>*/ tags that define the tree.
        if (root == null) {
            getBufferBody(false);

            // check to see if we should exit due to an error occuring
            // write out any error text and return.
            if (_errorText != null) {
                write(_errorText.toString());
                if (hasErrors())
                    reportErrors();
            }
        }

        // Set the image Root if it is not set.
        PageContext pageContext = getPageContext();
        if (_iState.getImageRoot() == null)
            _iState.setImageRoot(((HttpServletRequest) pageContext.getRequest()).getContextPath() + "/" +
                    TagConfig.getTreeImageLocation());

        //  errors should have been caught above
        TreeElement treeRoot = getTreeRoot(_expr);

        // if the tree root hasn't been defined, then we need to update the object that is
        // pointed at by the dataSource expression.
        if (treeRoot == null) {
            if (_rootNode != null) {
                try {
                    String datasource = "{" + _dataSource + "}";
                    _expr.updateExpression(datasource, _rootNode, pageContext);
                }
                catch (ExpressionUpdateException e) {
                    String s = Bundle.getString("Tags_UnableToWriteTree", new Object[]{_dataSource, e.getMessage()});
                    registerTagError(s, null);
                    reportErrors();
                    return;
                }
                treeRoot = _rootNode;
            }

            // indicate an update error and return
            if (treeRoot == null) {
                String s = Bundle.getString("Tags_TreeNoAttribute", _dataSource);
                registerTagError(s, null);
                reportErrors();
                return;
            }

        }

        // set the root image
        if (treeRoot instanceof ITreeRootElement) {
            ITreeRootElement tre = (ITreeRootElement) treeRoot;
            if (tre.getRootNodeExpandedImage() == null) {
                tre.setRootNodeExpandedImage((_rootNodeExpandedImage != null) ?
                        _rootNodeExpandedImage : InheritableState.IMAGE_ROOT_EXPANDED);
            }
            if (tre.getRootNodeCollapsedImage() == null) {
                tre.setRootNodeCollapsedImage((_rootNodeCollapsedImage != null) ?
                        _rootNodeCollapsedImage : InheritableState.IMAGE_ROOT_COLLAPSED);
            }
        }

        // if we are running the tree at the client, then
        // we need to register the tree with the NameService
        if (_trs.runAtClient) {
            // it's currently not legal to have a runAtClient but not be an instance of INameable which is
            // implemented by the ITreeRootElement.
            if (!(treeRoot instanceof INameable)) {
                String s = Bundle.getString("Tags_TreeRunAtClientRoot", null);
                registerTagError(s, null);
                reportErrors();
                return;
            }

            // name the tree if it hasn't been named already
            // or if no longer stored in the NameService, add it.
            INameable in = (INameable) treeRoot;
            String o = in.getObjectName();
            NameService ns = NameService.instance(pageContext.getSession());
            if (o == null) {
                ns.nameObject("Tree", in);
                ns.put(in);
            }
            else if (ns.get(o) == null) {
                ns.put(in);
            }
        }


        // prepare to render the tree
        HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
        HttpServletResponse response = (HttpServletResponse) pageContext.getResponse();
        InternalStringBuilder sb = new InternalStringBuilder(1024);
        StringBuilderRenderAppender writer = new StringBuilderRenderAppender(sb);

        // this is the treeId from the request.  If there was an tree expansion this will be
        // non-null and it identifies what tree had the expansion request.
        // we need to qualify the tree based upon the tagId
        assert(_trs.tagId != null);
        _trs.tagId = getIdForTagId(_trs.tagId);

        String treeId = request.getParameter(TreeElement.TREE_ID);
        if (treeId != null && _trs.tagId.equals(treeId)) {
            TreeHelpers.processTreeRequest(treeId, treeRoot, request, response);
        }

        // check for the nodes that are expanded...
        // Add the script support for the tree.
        if (_trs.runAtClient) {
            IScriptReporter sr = getScriptReporter();
            if (sr == null) {
                String s = Bundle.getString("Tags_TreeRunAtClientSC", null);
                registerTagError(s, null);
                reportErrors();
                return;
            }

            ScriptRequestState srs = ScriptRequestState.getScriptRequestState(request);
            if (!srs.isFeatureWritten(CoreScriptFeature.DYNAMIC_INIT)) {
                String s = Bundle.getString("Tags_TreeHtmlRunAtClient", null);
                registerTagError(s, null);
                reportErrors();
                return;
            }

            assert(treeRoot instanceof ITreeRootElement);
            ITreeRootElement tre = (ITreeRootElement) treeRoot;

            Object[] args = new Object[8];
            args[0] = _iState.getImageRoot() + "/";
            args[1] = tre.getObjectName();
            args[2] = _iState.getNodeCollapsedImage();
            args[3] = _iState.getNodeExpandedImage();
            args[4] = _iState.getLastNodeCollapsedImage();
            args[5] = _iState.getLastNodeExpandedImage();
            args[6] = Bundle.getString("Tags_TreeAltTextExpand", null);
            args[7] = Bundle.getString("Tags_TreeAltTextCollapse", null);
            srs.writeFeature(sr, writer, CoreScriptFeature.TREE_INIT, false, false, args);

            AjaxUrlInfo ajaxInfo = URLRewriterService.getAjaxUrl(pageContext.getServletContext(),request,treeRoot);
            if (ajaxInfo.getCommandPrefix() != null) {
                args = new Object[2];
                args[0] = tre.getObjectName();
                args[1] = ajaxInfo.getCommandPrefix();
                srs.writeFeature(sr,writer, CoreScriptFeature.AJAX_PREFIX, false,false,args);
            }
            if (ajaxInfo.getAjaxParameter() != null) {
                args = new Object[2];
                args[0] = tre.getObjectName();
                args[1] = ajaxInfo.getAjaxParameter();
                srs.writeFeature(sr,writer, CoreScriptFeature.AJAX_PARAM, false,false,args);
            }

            tre.setTreeRenderState(_trs);
            tre.setInheritableState(_iState);
        }

        // create a containing tree level <div> and place the tree level styles on it.
        _divState.styleClass = _treeStyleClass;
        _divState.style = _treeStyle;
        String divId = null;
        if (_renderTagIdLookup) {
            _divState.id = _trs.tagId;
            divId = _divState.id;
        }

        // if we are running on the client then we need to output the tree name into the top level tree <div> tag
        if (_trs.runAtClient) {
            _divState.registerAttribute(AbstractHtmlState.ATTR_GENERAL, "netui:treeName",
                    ((INameable) treeRoot).getObjectName());
        }

        TagRenderingBase divRenderer = TagRenderingBase.Factory.getRendering(TagRenderingBase.DIV_TAG, request);
        divRenderer.doStartTag(writer, _divState);
        sb.append("\n");

        // Render the tree.
        AttributeRenderer extraAttrs = new AttributeRenderer();
        String treeRendererClassName = TagConfig.getTreeRendererClassName();
        TreeRenderer tr = TreeRendererFactory.getInstance(treeRendererClassName);
        if (tr == null) {
            tr = new TreeRenderer();
        }
        tr.init(_trs, request, response, pageContext.getServletContext());
        tr.setTreeRenderSupport(new TagTreeRenderSupport(this));
        tr.render(writer, treeRoot, 0, extraAttrs, _iState);
        if (hasErrors()) {
            reportErrors();
            return;
        }

        // finish the tree representation and write it
        divRenderer.doEndTag(writer);
        sb.append("\n");
        write(sb.toString());

        if (!(treeRoot instanceof ITreeRootElement)) {
            boolean error = false;
            if (_rootNodeExpandedImage != null) {
                String s = Bundle.getString("Tags_TreeRootImageError", null);
                registerTagError(s, null);
                error = true;
            }
            if (_rootNodeCollapsedImage != null) {
                String s = Bundle.getString("Tags_TreeRootImageError", null);
                registerTagError(s, null);
                error = true;
            }
            if (error) {
                reportErrors();
            }            
        }

        // check to see if we are writing out the java.
        if (_renderTagIdLookup) {
            String jsOut = renderDefaultJavaScript(request, divId);
            if (jsOut != null)
                write(jsOut);
        }
    }
1037811
protected void addClassList(Content contentTree) throws IOException {
        String[] classTableHeader = new String[] {
            configuration.getText("doclet.0_and_1",
                    configuration.getText("doclet.Class"),
                    configuration.getText("doclet.Description"))
        };
        Iterator<String> itp = usingPackageToUsedClasses.keySet().iterator();
        while (itp.hasNext()) {
            String packageName = itp.next();
            PackageDoc usingPackage = configuration.root.packageNamed(packageName);
            HtmlTree li = new HtmlTree(HtmlTag.LI);
            li.addStyle(HtmlStyle.blockList);
            if (usingPackage != null) {
                li.addContent(getMarkerAnchor(usingPackage.name()));
            }
            String tableSummary = configuration.getText("doclet.Use_Table_Summary",
                    configuration.getText("doclet.classes"));
            Content table = HtmlTree.TABLE(HtmlStyle.useSummary, 0, 3, 0, tableSummary,
                    getTableCaption(configuration.getResource(
                    "doclet.ClassUse_Classes.in.0.used.by.1",
                    getPackageLink(pkgdoc, Util.getPackageName(pkgdoc)),
                    getPackageLink(usingPackage, Util.getPackageName(usingPackage)))));
            table.addContent(getSummaryTableHeader(classTableHeader, "col"));
            Content tbody = new HtmlTree(HtmlTag.TBODY);
            Iterator<ClassDoc> itc =
                    usingPackageToUsedClasses.get(packageName).iterator();
            for (int i = 0; itc.hasNext(); i++) {
                HtmlTree tr = new HtmlTree(HtmlTag.TR);
                if (i % 2 == 0) {
                    tr.addStyle(HtmlStyle.altColor);
                } else {
                    tr.addStyle(HtmlStyle.rowColor);
                }
                addClassRow(itc.next(), packageName, tr);
                tbody.addContent(tr);
            }
            table.addContent(tbody);
            li.addContent(table);
            contentTree.addContent(li);
        }
    }
1059317
private void addChildrenForOUNode(CmsOrganizationalUnit item) {

        List<Object> itemsToRemove = new ArrayList<Object>();

        Collection<?> childCol = m_treeContainer.getChildren(item);
        if (childCol != null) {
            itemsToRemove.addAll(childCol);
        }

        try {
            if (m_app.isOUManagable(item.getName())) {

                List<I_CmsOuTreeType> types = m_app.getTreeTypeProvider().getTreeTypes();
                for (I_CmsOuTreeType type : types) {
                    if (!type.isValidForOu(m_cms, item.getName())) {
                        continue;
                    }
                    if (type.isOrgUnit()) {
                        continue;
                    }
                    String itemId = type.getId() + item.getName();
                    Item newItem = m_treeContainer.addItem(itemId);
                    itemsToRemove.remove(itemId);
                    if (newItem != null) {
                        newItem.getItemProperty(PROP_NAME).setValue(getIconCaptionHTML(itemId, type));
                        newItem.getItemProperty(PROP_TYPE).setValue(type);
                        m_treeContainer.setParent(itemId, item);
                        setChildrenAllowed(itemId, type.isExpandable());
                    }
                }
            }
            List<CmsOrganizationalUnit> ous = OpenCms.getOrgUnitManager().getOrganizationalUnits(
                m_cms,
                item.getName(),
                false);
            List<CmsOrganizationalUnit> webOus = new ArrayList<CmsOrganizationalUnit>();
            for (CmsOrganizationalUnit ou : ous) {
                if (m_app.isParentOfManagableOU(ou.getName())) {
                    itemsToRemove.remove(ou);
                    if (ou.hasFlagWebuser()) {
                        webOus.add(ou);
                    } else {
                        addOuToTree(ou, item);
                    }
                }
            }
            for (CmsOrganizationalUnit ou : webOus) {
                if (m_app.isParentOfManagableOU(ou.getName())) {
                    itemsToRemove.remove(ou);
                    addOuToTree(ou, item);
                }
            }
        } catch (CmsException e) {
            LOG.error("Can't read ou", e);
        }
        for (Object it : itemsToRemove) {
            m_treeContainer.removeItemRecursively(it);
        }
    }
117785
protected RuntimeException runtimeException(final Exception exception) {
        if (exception instanceof RuntimeException) {
            throw (RuntimeException) exception;
        } else {
            throw new RuntimeException(exception);
        }
    }
726507
public void buildMemberDetails(XMLNode node, Content classContentTree) {
        Content memberDetailsTree = writer.getMemberTreeHeader();
        buildChildren(node, memberDetailsTree);
        classContentTree.addContent(writer.getMemberDetailsTree(memberDetailsTree));
    }
674796
public void addTop(Content htmlTree) {
        Content top = new RawHtml(replaceDocRootDir(configuration.top));
        fixedNavDiv.addContent(top);
    }
891063
protected void addAnnotations(ExecutableMemberDoc member, Content htmlTree) {
		WriterUtils.addAnnotations(member, htmlTree, this.configuration, this.writer);
	}