RFR: 8293667: Align jlink's --compress option with jmod's --compress option [v8]

Mandy Chung mchung at openjdk.org
Thu Feb 16 19:23:36 UTC 2023


On Thu, 16 Feb 2023 03:35:31 GMT, Ian Graves <igraves at openjdk.org> wrote:

>> This is an approach to adding a flag to jlink that will allow --compress to take the same types of arguments as jmod, thus bringing the two into alignment. This likely requires a CSR and a discussion on whether we should deprecate or simply remove the original numeric compression arguments.
>
> Ian Graves has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Updating properties

src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImagePluginConfiguration.java line 57:

> 55:         CATEGORIES_ORDER.add(Category.SORTER);
> 56:         CATEGORIES_ORDER.add(Category.METAINFO_ADDER);
> 57:         CATEGORIES_ORDER.add(Category.IMAGE_TRANSFORMER);

This change is no longer needed?

src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/DefaultCompressPlugin.java line 102:

> 100:                     break;
> 101:                 case LEVEL_2:
> 102:                     zip = new ZipPlugin(resFilter);

For old values (0, 1, 2), jlink should emit a warning message that that value is deprecated and will be removed in a future release.

src/jdk.jlink/share/classes/jdk/tools/jlink/plugin/Plugin.java line 66:

> 64:         PACKAGER("PACKAGER"),
> 65: 
> 66:         IMAGE_TRANSFORMER("IMAGE_TRANSFORMER");

No longer needed.

src/jdk.jlink/share/classes/jdk/tools/jlink/resources/plugins.properties line 62:

> 60: \  --class-for-name          Class optimization: convert Class.forName calls to constant loads.
> 61: 
> 62: compress.argument=<0|1|2|zip-[0-9]>[:filter=<pattern-list>]

Suggest to just show the new values.

Suggestion:

compress.argument=<zip-[0-9]>[:filter=<pattern-list>]

src/jdk.jlink/share/classes/jdk/tools/jlink/resources/plugins.properties line 70:

> 68: compression, and zip-9 provides the\n\
> 69: best compression. Default is zip-6.\n\
> 70: Deprecated values to be removed in a future release:\n\

Suggestion:

Compression to use in compressing resources.


`compress.description` is just the description of the plugin.   `compress.usage` shows the accepted values.

src/jdk.jlink/share/classes/jdk/tools/jlink/resources/plugins.properties line 84:

> 82: \                            0:  No compression. Equivalent to zip-0.\n\
> 83: \                            1:  Constant string sharing\n\
> 84: \                            2:  Equivalent to zip-6.

I think it's adequate for the `--help` output to show the deprecated values.  This `compress.usage` can simply show the new values.

Suggestion:

\  --compress <compress>     Compression to use in compressing resources.\n\
\                            Accepted values are:\n\
\                            zip-[0-9], where zip-0 provides no compression,\n\
\                            and zip-9 provides the best compression.\n\
\                            Default is zip-6.

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

PR: https://git.openjdk.org/jdk/pull/11617


More information about the core-libs-dev mailing list