for (MPartInfo p : base.getChildren()) {
for (MPartInfo p : children) {
    private static MPartInfo getBodySubpart(MPartInfo base, boolean preferHtml) {        // short-circuit malformed messages        if (!base.hasChildren())            return null;        // go through top-level children, stopping at first text part we are interested in        MPartInfo alternative = null;        for (MPartInfo p : base.getChildren()) {            boolean isAttachment = p.getDisposition().equals(Part.ATTACHMENT);            // the Content-Type we want and the one we'd settle for...            String wantType = preferHtml ? CT_TEXT_HTML  : CT_TEXT_PLAIN;            String altType  = preferHtml ? CT_TEXT_PLAIN : CT_TEXT_HTML;            if (p.getContentType().match(wantType) && !isAttachment) {                return p;            } else if (p.getContentType().match(altType) && !isAttachment) {                if (alternative == null)                    alternative = p;            } else if (p.getContentType().match(CT_MULTIPART_WILD)) {                MPartInfo subpart = getBodySubpart(p, preferHtml);                if (subpart == null)                	continue;                if (subpart.getContentType().match(wantType))                    return subpart;                if (alternative == null)                    alternative = subpart;            }        }        return alternative;    }