# HG changeset patch # User okutsu # Date 1477290375 -32400 # Node ID 7b34be6ae552f55309c688c954c8684ed436697d # Parent 290923d3b566424292951a147f71dd159f162acd 8152926: PropertyResourceBundle constructor don't understand the System.setProperty change Reviewed-by: naoto, peytoia diff -r 290923d3b566 -r 7b34be6ae552 jdk/src/java.base/share/classes/java/util/PropertyResourceBundle.java --- a/jdk/src/java.base/share/classes/java/util/PropertyResourceBundle.java Sat Oct 22 17:03:17 2016 +0300 +++ b/jdk/src/java.base/share/classes/java/util/PropertyResourceBundle.java Mon Oct 24 15:26:15 2016 +0900 @@ -63,7 +63,7 @@ * files containing the resource data. ResourceBundle.getBundle * will automatically look for the appropriate properties file and create a * PropertyResourceBundle that refers to it. See - * {@link ResourceBundle#getBundle(java.lang.String, java.util.Locale, java.lang.ClassLoader) ResourceBundle.getBundle} + * {@link ResourceBundle#getBundle(String, Locale, ClassLoader) ResourceBundle.getBundle} * for a complete description of the search and instantiation strategy. * *

@@ -105,19 +105,14 @@ * * * - *

- * 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. - * - *

- * Note: PropertyResourceBundle can be constructed either - * from an InputStream or a Reader, which represents a property file. - * Constructing a PropertyResourceBundle instance from an InputStream requires - * that the input stream be encoded in UTF-8. By default, if a + * @apiNote + * {@code PropertyResourceBundle} can be constructed either + * from an {@code InputStream} or a {@code Reader}, which represents a property file. + * Constructing a {@code PropertyResourceBundle} instance from an {@code InputStream} + * requires that the input stream be encoded in {@code UTF-8}. By default, if a * {@link java.nio.charset.MalformedInputException} or an * {@link java.nio.charset.UnmappableCharacterException} occurs on reading the - * input stream, then the PropertyResourceBundle instance resets to the state + * input stream, then the {@code PropertyResourceBundle} instance resets to the state * before the exception, re-reads the input stream in {@code ISO-8859-1}, and * continues reading. If the system property * {@code java.util.PropertyResourceBundle.encoding} is set to either @@ -126,8 +121,15 @@ * If "ISO-8859-1" is specified, characters that cannot be represented in * ISO-8859-1 encoding must be represented by Unicode Escapes as defined in section * 3.3 of The Java™ Language Specification - * whereas the other constructor which takes a Reader does not have that limitation. + * whereas the other constructor which takes a {@code Reader} does not have that limitation. * Other encoding values are ignored for this system property. + * The system property is read and evaluated when initializing this class. + * Changing or removing the property has no effect after the initialization. + * + * @implSpec + * 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. * * @see ResourceBundle * @see ListResourceBundle @@ -144,16 +146,18 @@ /** * Creates a property resource bundle from an {@link java.io.InputStream - * InputStream}. This constructor reads the property file in UTF-8 by default. - * If a {@link java.nio.charset.MalformedInputException} or an - * {@link java.nio.charset.UnmappableCharacterException} occurs on reading the - * input stream, then the PropertyResourceBundle instance resets to the state - * before the exception, re-reads the input stream in {@code ISO-8859-1} and - * continues reading. If the system property - * {@code java.util.PropertyResourceBundle.encoding} is set to either - * "ISO-8859-1" or "UTF-8", the input stream is solely read in that encoding, - * and throws the exception if it encounters an invalid sequence. Other - * encoding values are ignored for this system property. + * InputStream}. This constructor reads the property file in UTF-8 by default. + * If a {@link java.nio.charset.MalformedInputException} or an + * {@link java.nio.charset.UnmappableCharacterException} occurs on reading the + * input stream, then the PropertyResourceBundle instance resets to the state + * before the exception, re-reads the input stream in {@code ISO-8859-1} and + * continues reading. If the system property + * {@code java.util.PropertyResourceBundle.encoding} is set to either + * "ISO-8859-1" or "UTF-8", the input stream is solely read in that encoding, + * and throws the exception if it encounters an invalid sequence. Other + * encoding values are ignored for this system property. + * The system property is read and evaluated when initializing this class. + * Changing or removing the property has no effect after the initialization. * * @param stream an InputStream that represents a property file * to read from.