Parsed command line data is passed into bundlers as "Map<String, ? super Object>" object. Almost every method in jpackage code base has "Map<String, ? super Object>" parameter (named "params").
There is a list of functional objects supposed to help extract specific data from "params" [1]. On top of that, every bundler defines its helper objects of type BundlerParamInfo.
For the caller passing "params" it is unclear what should be in these "params" to make a called function work.
On top of that "params" is not R/O, it is writable.
It is OK to have "params" in the command line parsing code but it must be replaced with class hierarchy in bundlers.
We already have LauncherData class [2] that encapsulates building launcher-specific data from "params". We need more classes like LauncherData to pass inside of bundlers code instead of "params".
[1] https://github.com/openjdk/jdk/blob/7acfba288ff4d1f43cc36506b2bd2d32107b00c2/src/jdk.jpackage/share/classes/jdk/jpackage/internal/StandardBundlerParam.java
[2]
https://github.com/openjdk/jdk/blob/f73922b27d126314fc3127ee25aa40b6258c8a6b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/LauncherData.java#L56
There is a list of functional objects supposed to help extract specific data from "params" [1]. On top of that, every bundler defines its helper objects of type BundlerParamInfo.
For the caller passing "params" it is unclear what should be in these "params" to make a called function work.
On top of that "params" is not R/O, it is writable.
It is OK to have "params" in the command line parsing code but it must be replaced with class hierarchy in bundlers.
We already have LauncherData class [2] that encapsulates building launcher-specific data from "params". We need more classes like LauncherData to pass inside of bundlers code instead of "params".
[1] https://github.com/openjdk/jdk/blob/7acfba288ff4d1f43cc36506b2bd2d32107b00c2/src/jdk.jpackage/share/classes/jdk/jpackage/internal/StandardBundlerParam.java
[2]
https://github.com/openjdk/jdk/blob/f73922b27d126314fc3127ee25aa40b6258c8a6b/src/jdk.jpackage/share/classes/jdk/jpackage/internal/LauncherData.java#L56
- blocks
-
JDK-8333727 Use JOpt in jpackage to parse command line
- Open