if (tc.searchTagsets.size() == 0)
if (tc.searchTagsets.size() == 0) {
        static TagConstraints getTagContraints(int mailboxId, DbSearchConstraints c, Connection conn) throws ServiceException {            TagConstraints tc = c.tagConstraints = new TagConstraints();            if (ListUtil.isEmpty(c.tags) && ListUtil.isEmpty(c.excludeTags))                return tc;            int setFlagMask = 0;            long setTagMask = 0;            if (!ListUtil.isEmpty(c.tags))                for (Tag curTag : c.tags)                    if (curTag.getId() == Flag.ID_FLAG_UNREAD) {                        tc.unread = Boolean.TRUE;                     } else if (curTag instanceof Flag) {                        setFlagMask |= curTag.getBitmask();                    } else {                        setTagMask |= curTag.getBitmask();                    }            int flagMask = setFlagMask;            long tagMask = setTagMask;            if (!ListUtil.isEmpty(c.excludeTags))                                 for (Tag t : c.excludeTags)                     if (t.getId() == Flag.ID_FLAG_UNREAD) {                        tc.unread = Boolean.FALSE;                    } else if (t instanceof Flag) {                        flagMask |= t.getBitmask();                    } else {                        tagMask |= t.getBitmask();                    }            TagsetCache tcFlags = getFlagsetCache(conn, mailboxId);            TagsetCache tcTags  = getTagsetCache(conn, mailboxId);            if (setTagMask != 0 || tagMask != 0) {                tc.searchTagsets = tcTags.getMatchingTagsets(tagMask, setTagMask);                // if no items match the specified tags...                if (tc.searchTagsets.size() == 0)                    tc.noMatches = true;            }            if (setFlagMask != 0 || flagMask != 0) {                tc.searchFlagsets = tcFlags.getMatchingTagsets(flagMask, setFlagMask);                // if no items match the specified flags...                if (tc.searchFlagsets.size() == 0)                    tc.noMatches = true;            }            return tc;        }