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

Remove outdated SelectVersion() function from the launcher and update the code comments explaining the code flow

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 24
    • None
    • tools
    • b17

      The launcher code has a function called SelectVersion() which prior to Java 9 days was there to support selecting a particular JRE. It was used to implement the Multiple JRE feature (mJRE). mJRE was removed from the JDK in Java 9 https://bugs.openjdk.org/browse/JDK-8058407. At that time this function was trimmed down to just making sure that the "-version:XX", "-jre-restrict-search" and "-jre-no-restrict-search" command line options to the launcher are rejected during launch. In addition to this, the implementation in the SelectVersion() was left to parse the jar's MANIFEST file and find a Main-Class and any SplashScreen-Image in the jar. Leaving around this part in the SelectVersion() was merely an convenience because, previously before mJRE support was removed, this code in the SelectVersion() anyway used to parse the MANIFEST to find the "JRE-Version" manifest attribute. That manifest attribute hasn't been supported (in any functional way) starting Java 9. So there's no need to be parsing the manifest file in this SelectVersion() function. Furthermore, the SelectVersion() function itself is no longer necessary and the parsing of the command lines options (including rejecting the outdated options) can be done in the ParseArguments() function that gets called shortly afterwards.

      Furthermore, the code comments in the launcher code contains a flowchart which attempts to explain the code flow in the launcher, at a high level. However, that flowchart is outdated and needs to be updated to match with the current implementation in the launcher.

            jpai Jaikiran Pai
            jpai Jaikiran Pai
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: