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

Classes generated by SystemModulesPlugin.java are not reproducable

    XMLWordPrintable

Details

    • b23
    • generic
    • generic
    • Verified

    Backports

      Description

        The classes generated by src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/SystemModulesPlugin.java (jdk.internal.module.SystemModules$default.class and jdk.internal.module.SystemModules$all.class) are not reproducable between builds. This is because SystemModulesPlugin iterates over various sets (exports, requires, providers, opens, etc.) and the iteration over Set is unspecified. The iteration order do differ between builds (most likely because some of the Sets are HashSets), so the generated classes differ between builds.

        I have attached a reproducer, reproducer.zip, that can be used to show the issue. Just unzip the file and run "sh reproduce.sh" (use --verbose if you want a diff).

        I have also attached a patch that fixes this issue by sorting the collections prior to iterating over them.

        Attachments

          Issue Links

            Activity

              People

                ehelin Erik Helin
                ehelin Erik Helin
                Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: