accounts = d.searchAccounts(query, null, null, true, flags);
accounts = prov.searchAccounts(d, query, null, null, true, flags);
        ArrayList<AccountQuota> doSearch() throws ServiceException {            if (mResult != null) return mResult;            ArrayList<AccountQuota> result = new ArrayList<AccountQuota>();                        String query = null;            if (!mCosId.equals("")) {                if (mCosName.equals(Provisioning.DEFAULT_COS_NAME)) {                    query = String.format("(&(zimbraMailHost=%s)((zimbraCOSId=%s)|(!(zimbraCOSId=*))))", LOCAL_HOST, mCosId);                } else {                    query = String.format("(&(zimbraMailHost=%s)(zimbraCOSId=%s))", LOCAL_HOST, mCosId);                }            } else {                query = String.format("(zimbraMailHost=%s)", LOCAL_HOST);            }                        Provisioning prov = Provisioning.getInstance();            int flags = Provisioning.SA_ACCOUNT_FLAG;            List accounts;            Domain d = mDomainId.equals("") ? null : prov.get(DomainBy.ID, mDomainId);            if (d != null) {                accounts = d.searchAccounts(query, null, null, true, flags);            } else {                accounts = prov.searchAccounts(query, null, null, true, flags);            }            Map<String, Long> quotaUsed = Mailbox.getMailboxSizes();                        for (Object obj: accounts) {                if (!(obj instanceof Account))continue;                AccountQuota aq = new AccountQuota();                            Account acct = (Account) obj;                aq.id = acct.getId();                aq.name = acct.getName();                aq.quotaLimit = acct.getLongAttr(Provisioning.A_zimbraMailQuota, 0);                aq.sortQuotaLimit = aq.quotaLimit == 0 ? Long.MAX_VALUE : aq.quotaLimit;                Long used = quotaUsed.get(acct.getId());                aq.quotaUsed = used == null ? 0 : used;                aq.percentQuotaUsed = aq.quotaLimit > 0 ? (aq.quotaUsed / (float)aq.quotaLimit) : 0;                result.add(aq);            }            final boolean sortByTotal = mSortBy.equals(SORT_TOTAL_USED);            final boolean sortByQuota = mSortBy.equals(SORT_QUOTA_LIMIT);            Comparator<AccountQuota> comparator = new Comparator<AccountQuota>() {                public int compare(AccountQuota a, AccountQuota b) {                    int comp = 0;                    if (sortByTotal) {                        if (a.quotaUsed > b.quotaUsed) comp = 1;                        else if (a.quotaUsed < b.quotaUsed) comp = -1;                    } else if (sortByQuota) {                        if (a.sortQuotaLimit > b.sortQuotaLimit) comp = 1;                        else if (a.sortQuotaLimit < b.sortQuotaLimit) comp = -1;                                                } else {                        if (a.percentQuotaUsed > b.percentQuotaUsed) comp = 1;                        else if (a.percentQuotaUsed < b.percentQuotaUsed) comp = -1;                    }                    return mSortAscending ? comp : -comp;                }            };            Collections.sort(result, comparator);            mResult = result;            return mResult;        }