protected String getString(String bundlePath, int code, Object[] args) { // We will throw a MissingResourceException if the bundle name is invalid // This happens if the code references a bundle name that just doesn't exist ResourceBundle bundle = getBundle(bundlePath); try { String m = bundle.getString(String.valueOf(code)); if (m == null) { logger.error("Failed to find message for id " + code + " in resource bundle " + bundlePath); return ""; } return MessageFormat.format(m, args); } catch (MissingResourceException e) { logger.error("Failed to find message for id " + code + " in resource bundle " + bundlePath); return ""; } }