< prev index next >
src/java.base/share/classes/java/util/ResourceBundle.java
Print this page
rev 56290 : 8230648: Replace @exception tag with @throws in java.base
Summary: Minor coding style update of javadoc tag in any file in java.base
Reviewed-by: prappo, lancea
@@ -510,13 +510,13 @@
* <blockquote>
* <code>(String) {@link #getObject(java.lang.String) getObject}(key)</code>.
* </blockquote>
*
* @param key the key for the desired string
- * @exception NullPointerException if <code>key</code> is <code>null</code>
- * @exception MissingResourceException if no object for the given key can be found
- * @exception ClassCastException if the object found for the given key is not a string
+ * @throws NullPointerException if <code>key</code> is <code>null</code>
+ * @throws MissingResourceException if no object for the given key can be found
+ * @throws ClassCastException if the object found for the given key is not a string
* @return the string for the given key
*/
public final String getString(String key) {
return (String) getObject(key);
}
@@ -527,13 +527,13 @@
* <blockquote>
* <code>(String[]) {@link #getObject(java.lang.String) getObject}(key)</code>.
* </blockquote>
*
* @param key the key for the desired string array
- * @exception NullPointerException if <code>key</code> is <code>null</code>
- * @exception MissingResourceException if no object for the given key can be found
- * @exception ClassCastException if the object found for the given key is not a string array
+ * @throws NullPointerException if <code>key</code> is <code>null</code>
+ * @throws MissingResourceException if no object for the given key can be found
+ * @throws ClassCastException if the object found for the given key is not a string array
* @return the string array for the given key
*/
public final String[] getStringArray(String key) {
return (String[]) getObject(key);
}
@@ -545,12 +545,12 @@
* If not successful, and the parent resource bundle is not null,
* it calls the parent's <code>getObject</code> method.
* If still not successful, it throws a MissingResourceException.
*
* @param key the key for the desired object
- * @exception NullPointerException if <code>key</code> is <code>null</code>
- * @exception MissingResourceException if no object for the given key can be found
+ * @throws NullPointerException if <code>key</code> is <code>null</code>
+ * @throws MissingResourceException if no object for the given key can be found
* @return the object for the given key
*/
public final Object getObject(String key) {
Object obj = handleGetObject(key);
if (obj == null) {
@@ -839,13 +839,13 @@
* <blockquote>
* <code>getBundle(baseName, Locale.getDefault(), callerModule)</code>,
* </blockquote>
*
* @param baseName the base name of the resource bundle, a fully qualified class name
- * @exception java.lang.NullPointerException
+ * @throws java.lang.NullPointerException
* if <code>baseName</code> is <code>null</code>
- * @exception MissingResourceException
+ * @throws MissingResourceException
* if no resource bundle for the specified base name can be found
* @return a resource bundle for the given base name and the default locale
*
* @see <a href="#default_behavior">Resource Bundle Search and Loading Strategy</a>
* @see <a href="#resource-bundle-modules">Resource Bundles and Named Modules</a>
@@ -913,13 +913,13 @@
*
* @param baseName
* the base name of the resource bundle, a fully qualified class name
* @param locale
* the locale for which a resource bundle is desired
- * @exception NullPointerException
+ * @throws NullPointerException
* if <code>baseName</code> or <code>locale</code> is <code>null</code>
- * @exception MissingResourceException
+ * @throws MissingResourceException
* if no resource bundle for the specified base name can be found
* @return a resource bundle for the given base name and locale
*
* @see <a href="#default_behavior">Resource Bundle Search and Loading Strategy</a>
* @see <a href="#resource-bundle-modules">Resource Bundles and Named Modules</a>
@@ -1262,13 +1262,13 @@
*
* @param baseName the base name of the resource bundle, a fully qualified class name
* @param locale the locale for which a resource bundle is desired
* @param loader the class loader from which to load the resource bundle
* @return a resource bundle for the given base name and locale
- * @exception java.lang.NullPointerException
+ * @throws java.lang.NullPointerException
* if <code>baseName</code>, <code>locale</code>, or <code>loader</code> is <code>null</code>
- * @exception MissingResourceException
+ * @throws MissingResourceException
* if no resource bundle for the specified base name can be found
* @since 1.2
* @revised 9
* @spec JPMS
* @see <a href="#resource-bundle-modules">Resource Bundles and Named Modules</a>
@@ -2248,11 +2248,11 @@
/**
* Removes all resource bundles from the cache that have been loaded
* by the given class loader.
*
* @param loader the class loader
- * @exception NullPointerException if <code>loader</code> is null
+ * @throws NullPointerException if <code>loader</code> is null
* @since 1.6
* @see ResourceBundle.Control#getTimeToLive(String,Locale)
*/
public static final void clearCache(ClassLoader loader) {
Objects.requireNonNull(loader);
@@ -2269,11 +2269,11 @@
* Gets an object for the given key from this resource bundle.
* Returns null if this resource bundle does not contain an
* object for the given key.
*
* @param key the key for the desired object
- * @exception NullPointerException if <code>key</code> is <code>null</code>
+ * @throws NullPointerException if <code>key</code> is <code>null</code>
* @return the object for the given key, or null
*/
protected abstract Object handleGetObject(String key);
/**
@@ -2291,11 +2291,11 @@
* @param key
* the resource <code>key</code>
* @return <code>true</code> if the given <code>key</code> is
* contained in this <code>ResourceBundle</code> or its
* parent bundles; <code>false</code> otherwise.
- * @exception NullPointerException
+ * @throws NullPointerException
* if <code>key</code> is <code>null</code>
* @since 1.6
*/
public boolean containsKey(String key) {
if (key == null) {
@@ -2596,13 +2596,13 @@
* @param formats
* the formats to be returned by the
* <code>ResourceBundle.Control.getFormats</code> method
* @return a <code>ResourceBundle.Control</code> supporting the
* specified <code>formats</code>
- * @exception NullPointerException
+ * @throws NullPointerException
* if <code>formats</code> is <code>null</code>
- * @exception IllegalArgumentException
+ * @throws IllegalArgumentException
* if <code>formats</code> is unknown
*/
public static final Control getControl(List<String> formats) {
if (formats.equals(Control.FORMAT_PROPERTIES)) {
return SingleFormatControl.PROPERTIES_ONLY;
@@ -2631,13 +2631,13 @@
* the formats to be returned by the
* <code>ResourceBundle.Control.getFormats</code> method
* @return a <code>ResourceBundle.Control</code> supporting the
* specified <code>formats</code> with no fallback
* <code>Locale</code> support
- * @exception NullPointerException
+ * @throws NullPointerException
* if <code>formats</code> is <code>null</code>
- * @exception IllegalArgumentException
+ * @throws IllegalArgumentException
* if <code>formats</code> is unknown
*/
public static final Control getNoFallbackControl(List<String> formats) {
if (formats.equals(Control.FORMAT_DEFAULT)) {
return NoFallbackControl.NO_FALLBACK;
@@ -2677,11 +2677,11 @@
* @param baseName
* the base name of the resource bundle, a fully qualified class
* name
* @return a <code>List</code> of <code>String</code>s containing
* formats for loading resource bundles.
- * @exception NullPointerException
+ * @throws NullPointerException
* if <code>baseName</code> is null
* @see #FORMAT_DEFAULT
* @see #FORMAT_CLASS
* @see #FORMAT_PROPERTIES
*/
@@ -2864,11 +2864,11 @@
* qualified class name
* @param locale
* the locale for which a resource bundle is desired
* @return a <code>List</code> of candidate
* <code>Locale</code>s for the given <code>locale</code>
- * @exception NullPointerException
+ * @throws NullPointerException
* if <code>baseName</code> or <code>locale</code> is
* <code>null</code>
*/
public List<Locale> getCandidateLocales(String baseName, Locale locale) {
if (baseName == null) {
@@ -3032,11 +3032,11 @@
* unable to find any resource bundles (except for the
* base bundle)
* @return a <code>Locale</code> for the fallback search,
* or <code>null</code> if no further fallback search
* is desired.
- * @exception NullPointerException
+ * @throws NullPointerException
* if <code>baseName</code> or <code>locale</code>
* is <code>null</code>
*/
public Locale getFallbackLocale(String baseName, Locale locale) {
if (baseName == null) {
@@ -3125,33 +3125,33 @@
* the flag to indicate bundle reloading; <code>true</code>
* if reloading an expired resource bundle,
* <code>false</code> otherwise
* @return the resource bundle instance,
* or <code>null</code> if none could be found.
- * @exception NullPointerException
+ * @throws NullPointerException
* if <code>bundleName</code>, <code>locale</code>,
* <code>format</code>, or <code>loader</code> is
* <code>null</code>, or if <code>null</code> is returned by
* {@link #toBundleName(String, Locale) toBundleName}
- * @exception IllegalArgumentException
+ * @throws IllegalArgumentException
* if <code>format</code> is unknown, or if the resource
* found for the given parameters contains malformed data.
- * @exception ClassCastException
+ * @throws ClassCastException
* if the loaded class cannot be cast to <code>ResourceBundle</code>
- * @exception IllegalAccessException
+ * @throws IllegalAccessException
* if the class or its nullary constructor is not
* accessible.
- * @exception InstantiationException
+ * @throws InstantiationException
* if the instantiation of a class fails for some other
* reason.
- * @exception ExceptionInInitializerError
+ * @throws ExceptionInInitializerError
* if the initialization provoked by this method fails.
- * @exception SecurityException
+ * @throws SecurityException
* If a security manager is present and creation of new
* instances is denied. See {@link Class#newInstance()}
* for details.
- * @exception IOException
+ * @throws IOException
* if an error occurred when reading resources using
* any I/O operations
* @see java.util.spi.ResourceBundleProvider#getBundle(String, Locale)
* @revised 9
* @spec JPMS
@@ -3293,11 +3293,11 @@
* @return the time (0 or a positive millisecond offset from the
* cached time) to get loaded bundles expired in the cache,
* {@link #TTL_NO_EXPIRATION_CONTROL} to disable the
* expiration control, or {@link #TTL_DONT_CACHE} to disable
* caching.
- * @exception NullPointerException
+ * @throws NullPointerException
* if <code>baseName</code> or <code>locale</code> is
* <code>null</code>
*/
public long getTimeToLive(String baseName, Locale locale) {
if (baseName == null || locale == null) {
@@ -3348,11 +3348,11 @@
* @param loadTime
* the time when <code>bundle</code> was loaded and put
* in the cache
* @return <code>true</code> if the expired bundle needs to be
* reloaded; <code>false</code> otherwise.
- * @exception NullPointerException
+ * @throws NullPointerException
* if <code>baseName</code>, <code>locale</code>,
* <code>format</code>, <code>loader</code>, or
* <code>bundle</code> is <code>null</code>
*/
public boolean needsReload(String baseName, Locale locale,
@@ -3435,11 +3435,11 @@
* qualified class name
* @param locale
* the locale for which a resource bundle should be
* loaded
* @return the bundle name for the resource bundle
- * @exception NullPointerException
+ * @throws NullPointerException
* if <code>baseName</code> or <code>locale</code>
* is <code>null</code>
* @see java.util.spi.AbstractResourceBundleProvider#toBundleName(String, Locale)
*/
public String toBundleName(String baseName, Locale locale) {
@@ -3493,11 +3493,11 @@
* @param bundleName
* the bundle name
* @param suffix
* the file type suffix
* @return the converted resource name
- * @exception NullPointerException
+ * @throws NullPointerException
* if {@code bundleName} or {@code suffix}
* is {@code null}
*/
public final String toResourceName(String bundleName, String suffix) {
StringBuilder sb = new StringBuilder(bundleName.length() + 1 + suffix.length());
< prev index next >