mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

kenneth_suter
15.34.2007 cfc513043c5830b5a967733066068c7097b42e3c
opendj-sdk/opends/src/server/org/opends/server/admin/ManagedObjectDefinitionI18NResource.java
@@ -26,6 +26,7 @@
 */
package org.opends.server.admin;
import org.opends.messages.Message;
@@ -127,7 +128,7 @@
   * @throws MissingResourceException
   *           If the key was not found.
   */
  public String getMessage(AbstractManagedObjectDefinition<?, ?> d,
  public Message getMessage(AbstractManagedObjectDefinition<?, ?> d,
      String key) throws MissingResourceException {
    return getMessage(d, key, Locale.getDefault(), (String[]) null);
  }
@@ -149,7 +150,7 @@
   * @throws MissingResourceException
   *           If the key was not found.
   */
  public String getMessage(AbstractManagedObjectDefinition<?, ?> d,
  public Message getMessage(AbstractManagedObjectDefinition<?, ?> d,
      String key, Locale locale) throws MissingResourceException {
    return getMessage(d, key, locale, (String[]) null);
  }
@@ -174,16 +175,17 @@
   * @throws MissingResourceException
   *           If the key was not found.
   */
  public String getMessage(AbstractManagedObjectDefinition<?, ?> d,
  public Message getMessage(AbstractManagedObjectDefinition<?, ?> d,
      String key, Locale locale, String... args)
      throws MissingResourceException {
    ResourceBundle resource = getResourceBundle(d, locale);
    // TODO: use message framework directly
    if (args == null) {
      return resource.getString(key);
      return Message.raw(resource.getString(key));
    } else {
      MessageFormat mf = new MessageFormat(resource.getString(key));
      return mf.format(args);
      return Message.raw(mf.format(args));
    }
  }
@@ -205,7 +207,7 @@
   * @throws MissingResourceException
   *           If the key was not found.
   */
  public String getMessage(AbstractManagedObjectDefinition<?, ?> d,
  public Message getMessage(AbstractManagedObjectDefinition<?, ?> d,
      String key, String... args) throws MissingResourceException {
    return getMessage(d, key, Locale.getDefault(), args);
  }