ResourceBundle bundle = null;
ResourceBundle bundle;
    public static ResourceBundle getBundle(final String bundleName, final String requestParamLang, final Cookie[] cookies,            final String serviceLang, final String browserLang, final String moriaLang) {        /* Validate parameters. */        if (bundleName == null || bundleName.equals("")) {            throw new IllegalArgumentException("bundleName must be a non-empty string.");        }        if (moriaLang == null || moriaLang.equals("")) {            throw new IllegalArgumentException("moriaDefaultLang must be a non-empty string.");        }        /* Build array of preferred language selections. */        Vector langSelections = new Vector();        /* Parameter. */        if (requestParamLang != null && !requestParamLang.equals("")) {            langSelections.add(requestParamLang);        }        /* Cookies. */        if (cookies != null) {            String cookieValue = getCookieValue("lang", cookies);            if (cookieValue != null) {                langSelections.add(cookieValue);            }        }        /* Service. */        if (serviceLang != null && !serviceLang.equals("")) {            langSelections.add(serviceLang);        }        /* Browser. */        if (browserLang != null && !browserLang.equals("")) {            String[] browserLangs = sortedAcceptLang(browserLang);            for (int i = 0; i < browserLangs.length; i++) {                langSelections.add(browserLangs[i]);            }        }        /* Moria. */        if (moriaLang != null && !moriaLang.equals("")) {            langSelections.add(moriaLang);        }        ResourceBundle bundle = null;        for (Enumeration e = langSelections.elements(); e.hasMoreElements();) {            bundle = locateBundle(bundleName, (String) e.nextElement());            if (bundle != null) {                return bundle;            }        }        throw new MissingResourceException("ResourceBundle not found", "ResourceBundle", "bundleName");    }