Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8333664

Decouple command line parsing and package building in jpackage

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P3 P3
    • 24
    • None
    • tools
    • generic
    • generic

      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

            asemenyuk Alexey Semenyuk
            asemenyuk Alexey Semenyuk
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: