RFR: 8345940: Migrate security-related resources from Java classes to properties files [v4]

Justin Lu jlu at openjdk.org
Fri Mar 7 22:11:54 UTC 2025


On Fri, 7 Mar 2025 21:42:13 GMT, Artur Barashev <abarashev at openjdk.org> wrote:

>> These resources files are in Java classes. If converted to properties files, the localized versions can use UTF-8 encoding directly.
>> 
>> ./src/java.base/share/classes/sun/security/tools/keytool/Resources.java
>> ./src/java.base/share/classes/sun/security/util/Resources.java
>> ./src/java.base/share/classes/sun/security/util/AuthResources.java
>> ./src/jdk.jartool/share/classes/sun/security/tools/jarsigner/Resources.java
>
> Artur Barashev has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Update keytool and jarsigner resources location

Thanks for this conversion, left a few comments.

src/java.base/share/classes/sun/security/tools/keytool/Main.java line 1:

> 1: /*

In this file, the method `fullDisplayKeyName` can have its comment updated to no longer mention Resources.java.

src/java.base/share/classes/sun/security/util/LocalizedMessage.java line 1:

> 1: /*

Latter copyright year on this file can be bumped.

src/java.base/share/classes/sun/security/util/LocalizedMessage.java line 92:

> 90:      * Return a non-localized string corresponding to the provided key, and
> 91:      * formatted with the provided arguments. All strings are obtained from
> 92:      * sun.security.util.resources, and the formatting only supports

The method above can have the same adjustment right?

src/java.base/share/classes/sun/security/util/ResourcesMgr.java line 1:

> 1: /*

Copyright year as well.

src/jdk.jartool/share/classes/sun/security/tools/jarsigner/resources/jarsigner_de.properties line 40:

> 38: If.keystore.is.not.password.protected.then.storepass.and.keypass.must.not.be.specified=Wenn der Keystore nicht kennwortgeschützt ist, dürfen -storepass und -keypass nicht angegeben werden
> 39: Usage.jarsigner.options.jar.file.alias=Verwendung: jarsigner [options] jar-file alias
> 40: .jarsigner.verify.options.jar.file.alias.=\u0020      jarsigner -verify [options] jar-file [alias...]

We have generally kept `\u0020` in these properties files for the purpose of making it clear that trailing white space in a value is intentional. Can we convert these non trailing `\u0020` to just ` `?

src/jdk.jartool/share/classes/sun/security/tools/jarsigner/resources/jarsigner_zh_CN.properties line 1:

> 1: #

Looks like this file didn't get the escape sequence to native conversion.

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

PR Review: https://git.openjdk.org/jdk/pull/22774#pullrequestreview-2668455720
PR Review Comment: https://git.openjdk.org/jdk/pull/22774#discussion_r1985771621
PR Review Comment: https://git.openjdk.org/jdk/pull/22774#discussion_r1985767745
PR Review Comment: https://git.openjdk.org/jdk/pull/22774#discussion_r1985768748
PR Review Comment: https://git.openjdk.org/jdk/pull/22774#discussion_r1985769694
PR Review Comment: https://git.openjdk.org/jdk/pull/22774#discussion_r1985756147
PR Review Comment: https://git.openjdk.org/jdk/pull/22774#discussion_r1985754527


More information about the security-dev mailing list