8028368: There is no description whether or not java.util.ResourceBundle is thread-safe
authornaoto
Mon, 02 Dec 2013 11:29:07 -0800
changeset 21949 d97fd8123cbe
parent 21948 e8a1289096cd
child 21950 db3c826749f7
8028368: There is no description whether or not java.util.ResourceBundle is thread-safe Reviewed-by: okutsu
jdk/src/share/classes/java/util/ListResourceBundle.java
jdk/src/share/classes/java/util/PropertyResourceBundle.java
jdk/src/share/classes/java/util/ResourceBundle.java
--- a/jdk/src/share/classes/java/util/ListResourceBundle.java	Mon Dec 02 14:19:25 2013 +0000
+++ b/jdk/src/share/classes/java/util/ListResourceBundle.java	Mon Dec 02 11:29:07 2013 -0800
@@ -105,6 +105,12 @@
  * }
  * </pre>
  * </blockquote>
+ *
+ * <p>
+ * The implementation of a {@code ListResourceBundle} subclass must be thread-safe
+ * if it's simultaneously used by multiple threads. The default implementations
+ * of the methods in this class are thread-safe.
+ *
  * @see ResourceBundle
  * @see PropertyResourceBundle
  * @since JDK1.1
--- a/jdk/src/share/classes/java/util/PropertyResourceBundle.java	Mon Dec 02 14:19:25 2013 +0000
+++ b/jdk/src/share/classes/java/util/PropertyResourceBundle.java	Mon Dec 02 11:29:07 2013 -0800
@@ -100,6 +100,11 @@
  * </blockquote>
  *
  * <p>
+ * The implementation of a {@code PropertyResourceBundle} subclass must be
+ * thread-safe if it's simultaneously used by multiple threads. The default
+ * implementations of the non-abstract methods in this class are thread-safe.
+ *
+ * <p>
  * <strong>Note:</strong> PropertyResourceBundle can be constructed either
  * from an InputStream or a Reader, which represents a property file.
  * Constructing a PropertyResourceBundle instance from an InputStream requires
--- a/jdk/src/share/classes/java/util/ResourceBundle.java	Mon Dec 02 14:19:25 2013 +0000
+++ b/jdk/src/share/classes/java/util/ResourceBundle.java	Mon Dec 02 11:29:07 2013 -0800
@@ -184,6 +184,13 @@
  * subclass.  Your subclasses must override two methods: <code>handleGetObject</code>
  * and <code>getKeys()</code>.
  *
+ * <p>
+ * The implementation of a {@code ResourceBundle} subclass must be thread-safe
+ * if it's simultaneously used by multiple threads. The default implementations
+ * of the non-abstract methods in this class, and the methods in the direct
+ * known concrete subclasses {@code ListResourceBundle} and
+ * {@code PropertyResourceBundle} are thread-safe.
+ *
  * <h3>ResourceBundle.Control</h3>
  *
  * The {@link ResourceBundle.Control} class provides information necessary