diff options
author | Thomas <> | 2021-03-24 12:16:25 +0100 |
---|---|---|
committer | Thomas <> | 2021-03-24 12:16:25 +0100 |
commit | 835a395f3ecb7477b5b67e9da9bf3af58c86473a (patch) | |
tree | 916fa7705879063f6b83517d80197c37dc53caf8 /moaSig/common/src/main/java/at/gv/egovernment/moaspss/util/ResourceBundleChain.java | |
parent | a972fba0402eca3c5fcfcd1eef1979808fd716a1 (diff) | |
parent | 666d8c9f8cec7573e60a14ab039c0874f6a9ec53 (diff) | |
download | moa-sig-835a395f3ecb7477b5b67e9da9bf3af58c86473a.tar.gz moa-sig-835a395f3ecb7477b5b67e9da9bf3af58c86473a.tar.bz2 moa-sig-835a395f3ecb7477b5b67e9da9bf3af58c86473a.zip |
Merge branch 'master' of gitlab.iaik.tugraz.at:egiz/moa-sig
# Conflicts:
# moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/config/ConfigurationPartsBuilder.java
# moaSig/moa-sig-lib/src/main/java/at/gv/egovernment/moa/spss/server/config/ConfigurationProvider.java
Diffstat (limited to 'moaSig/common/src/main/java/at/gv/egovernment/moaspss/util/ResourceBundleChain.java')
-rw-r--r-- | moaSig/common/src/main/java/at/gv/egovernment/moaspss/util/ResourceBundleChain.java | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/moaSig/common/src/main/java/at/gv/egovernment/moaspss/util/ResourceBundleChain.java b/moaSig/common/src/main/java/at/gv/egovernment/moaspss/util/ResourceBundleChain.java index 1edad95..a5c7ecc 100644 --- a/moaSig/common/src/main/java/at/gv/egovernment/moaspss/util/ResourceBundleChain.java +++ b/moaSig/common/src/main/java/at/gv/egovernment/moaspss/util/ResourceBundleChain.java @@ -21,7 +21,6 @@ * that you distribute must include a readable copy of the "NOTICE" text file. */ - package at.gv.egovernment.moaspss.util; import java.util.ArrayList; @@ -32,7 +31,7 @@ import java.util.ResourceBundle; /** * A class to chain <code>ResourceBundle</code>s. - * + * * @author Patrick Peck * @version $Id$ */ @@ -40,11 +39,11 @@ public class ResourceBundleChain { /** Error message indicating the resource is not available. */ private static final String ERROR_MISSING_RESOURCE = "Missing resource"; /** The <code>ResourceBundle</code>s contained in this chain. */ - private List resourceBundles = new ArrayList(); + private final List resourceBundles = new ArrayList(); /** * Add a <code>ResourceBundle</code> to the chain. - * + * * @param resourceBundle The <code>ResourceBundle</code> to add. */ public void addResourceBundle(ResourceBundle resourceBundle) { @@ -53,13 +52,13 @@ public class ResourceBundleChain { /** * Return the value of the resource. - * + * * @param key The key to access the <code>String</code> resource. * @return The resource value. All the registered <code>ResourceBundle</code>s - * are searched in the order in which they have previously been added to this - * <code>ResourceBundleChain</code>. + * are searched in the order in which they have previously been added to + * this <code>ResourceBundleChain</code>. * @throws MissingResourceException The resource coult not be found in any of - * the bundles. + * the bundles. */ public String getString(String key) throws MissingResourceException { MissingResourceException lastException = null; @@ -68,19 +67,19 @@ public class ResourceBundleChain { // handle case where no resource bundles have been added if (resourceBundles.size() == 0) { throw new MissingResourceException( - ERROR_MISSING_RESOURCE, - this.getClass().getName(), - key); + ERROR_MISSING_RESOURCE, + this.getClass().getName(), + key); } // try to find the resource in one of the bundles; if it cannot be found, // return the exception thrown by the last bundle in the list for (iter = resourceBundles.iterator(); iter.hasNext();) { - ResourceBundle resourceBundle = (ResourceBundle) iter.next(); + final ResourceBundle resourceBundle = (ResourceBundle) iter.next(); try { - String value = resourceBundle.getString(key); + final String value = resourceBundle.getString(key); return value; - } catch (MissingResourceException e) { + } catch (final MissingResourceException e) { lastException = e; } } |