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

Nicolas Capponi
26.31.2013 ac0ef777f930132975d25416e9a928eee2e77dce
opendj-admin/src/main/java/org/opends/server/admin/ManagedObjectDefinitionI18NResource.java
@@ -43,7 +43,7 @@
    // Application-wide set of instances.
    private static final Map<String, ManagedObjectDefinitionI18NResource> INSTANCES =
            new HashMap<String, ManagedObjectDefinitionI18NResource>();
        new HashMap<String, ManagedObjectDefinitionI18NResource>();
    /**
     * Gets the internationalized resource instance which can be used to
@@ -107,8 +107,7 @@
     *             If the provided managed object definition was the
     *             {@link TopCfgDefn}.
     */
    public LocalizableMessage getMessage(AbstractManagedObjectDefinition<?, ?> d, String key)
            throws MissingResourceException, UnsupportedOperationException {
    public LocalizableMessage getMessage(AbstractManagedObjectDefinition<?, ?> d, String key) {
        return getMessage(d, key, Locale.getDefault(), (String[]) null);
    }
@@ -130,8 +129,7 @@
     *             If the provided managed object definition was the
     *             {@link TopCfgDefn}.
     */
    public LocalizableMessage getMessage(AbstractManagedObjectDefinition<?, ?> d, String key, Locale locale)
            throws MissingResourceException, UnsupportedOperationException {
    public LocalizableMessage getMessage(AbstractManagedObjectDefinition<?, ?> d, String key, Locale locale) {
        return getMessage(d, key, locale, (String[]) null);
    }
@@ -156,7 +154,7 @@
     *             {@link TopCfgDefn}.
     */
    public LocalizableMessage getMessage(AbstractManagedObjectDefinition<?, ?> d, String key, Locale locale,
            String... args) throws MissingResourceException, UnsupportedOperationException {
        String... args) {
        ResourceBundle resource = getResourceBundle(d, locale);
        // TODO: use message framework directly
@@ -185,8 +183,7 @@
     *             If the provided managed object definition was the
     *             {@link TopCfgDefn}.
     */
    public LocalizableMessage getMessage(AbstractManagedObjectDefinition<?, ?> d, String key, String... args)
            throws MissingResourceException, UnsupportedOperationException {
    public LocalizableMessage getMessage(AbstractManagedObjectDefinition<?, ?> d, String key, String... args) {
        return getMessage(d, key, Locale.getDefault(), args);
    }
@@ -250,7 +247,7 @@
     *            The resource bundle to be used.
     */
    synchronized void setResourceBundle(AbstractManagedObjectDefinition<?, ?> d, Locale locale,
            ResourceBundle resoureBundle) {
        ResourceBundle resoureBundle) {
        // First get the locale-resource mapping, creating it if
        // necessary.
        Map<Locale, ResourceBundle> map = resources.get(d);
@@ -265,11 +262,10 @@
    // Retrieve the resource bundle associated with a managed object and
    // locale, lazily loading it if necessary.
    private synchronized ResourceBundle getResourceBundle(AbstractManagedObjectDefinition<?, ?> d, Locale locale)
            throws MissingResourceException, UnsupportedOperationException {
    private synchronized ResourceBundle getResourceBundle(AbstractManagedObjectDefinition<?, ?> d, Locale locale) {
        if (d.isTop()) {
            throw new UnsupportedOperationException("I18n resources are not available for the "
                    + "Top configuration definition");
                + "Top configuration definition");
        }
        // First get the locale-resource mapping, creating it if
@@ -285,8 +281,8 @@
        ResourceBundle resourceBundle = map.get(locale);
        if (resourceBundle == null) {
            String baseName = prefix + "." + d.getClass().getName();
            resourceBundle = ResourceBundle.getBundle(baseName, locale, ClassLoaderProvider.getInstance()
                    .getClassLoader());
            resourceBundle =
                ResourceBundle.getBundle(baseName, locale, ClassLoaderProvider.getInstance().getClassLoader());
            map.put(locale, resourceBundle);
        }