RFR: 8358530: enhanced Properties#list javadoc

Justin Lu jlu at openjdk.org
Tue Jul 15 16:39:42 UTC 2025


On Tue, 20 May 2025 16:03:14 GMT, cagliostro92 <duke at openjdk.org> wrote:

> Trivial PR to enhance Javadoc for the `Properties#list` method, which has cost me some debugging time.

The copyright year for this file should also be updated: `1995, 2025,`

Also, the PR title will need to be changed to,

_8358530: Properties#list should warn against non-String values_

src/java.base/share/classes/java/util/Properties.java line 78:

> 76:  * the call to the {@code propertyNames} or {@code list} method
> 77:  * will fail if it is called on a "compromised" {@code Properties}
> 78:  * object that contains a non-{@code String} key or value.

Since `propertyNames` won't throw `CCE` with a non-String value, instead of adding the "or value" wording here, we should move the `list` method to the sentence above and remove it from the current sentence.

E.g., on line 73 

> "If the {@code store}, {@code save}, or {@code list) method ...

-------------

PR Review: https://git.openjdk.org/jdk/pull/25334#pullrequestreview-3021183784
PR Review Comment: https://git.openjdk.org/jdk/pull/25334#discussion_r2207979374


More information about the core-libs-dev mailing list