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

remove jpackage dead code and other cleanup



    • Bug
    • Status: Resolved
    • P3
    • Resolution: Fixed
    • internal
    • internal
    • tools


      1.) some examples of dead code that were pointed out in review:

      VersionExtractor.java seems to be dead code.

      Dead code in RelativeFileset: upshift(), contains(), copy constructor().

       - should use System Runtime.Version class.

      Params.java: Dead code does not seem to be used in DeployParams
        (and would probably be better as a map than an individual object).
         setParams is unused.

      2.) DeployParams:

       - If there are accessor methods, use them!

       - Lots of unused methods. (According to IntelliJ)

       - setSystemWide should use primitive boolean, not Boolean; conversions will be done as needed.

       - Ditto installDirChooser

       - Ditto SignBundle flag

      3.) Many .java files that pass a map of parameters use the argument name "p" but using "params"
      would communicate better and be more consistent across the different files.

      4.) LinuxDebBundler and LinuxRpmBundler should share more code.

      5.) MacAppBundler.java:
       - list of categories will need maintenance to stay in sync with Apple. Can the list be derived from the installed Mac tool chain?
       - or don't validate the argument until it is built and let the mac app builder do the checking.

      6.) (#1 form JDK-8223241) import statements:
      Several files (e.g., Arguments.java) have unused imports that can be removed.
      Except for wildcard static imports, we should replace the wild-card imports with explicit imports.
      for example:
      src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxDebBundler.java (java.util.* and java.io.*)

      7.) (#13 from JDK-8223241) simplify AbstractImageBundler.extractFlagsFromVersion()
      The minimum that jpackage needs to support is JDK 11, so we should be able to assume JEP 322 compliant version numbers. This code could be greatly simplified.


        Issue Links



              herrick Andy Herrick (Inactive)
              herrick Andy Herrick (Inactive)
              0 Vote for this issue
              1 Start watching this issue