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

javap --system flag doesn't override system APIs

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 22
    • None
    • tools
    • None
    • b25

      I may be missing something, but javap's --system flag doesn't seem to work.

      I expected it to override the lookup of classes in the system image, e.g. using --system should control which definition of java.util.List is printed.

      The following example shows that running javap from JDK 18 and JDK 19 respectively shows a difference, but when using the JDK 19 javap and configuring --system to point to different JDKs it always prints the same definition of java.util.List.

      ```
      # define JAVA18_HOME and JAVA19_HOME to refer to paths for the corresponding JDKS

      # verify the versions

      $ $JAVA18_HOME/bin/java -fullversion
      openjdk full version "18.0.1.1+2-6"
      $ $JAVA19_HOME/bin/java -fullversion
      openjdk full version "19.0.2+7-44"

      # using different javap implementations shows different definitions of java.util.List

      $ diff <($JAVA18_HOME/bin/javap -v java.util.List) <($JAVA19_HOME/bin/javap -v java.util.List)
      ...
      < major version: 62
      ---
      > major version: 63

      # using the same javap implementation but configuring --system always shows the same definition of java.util.List

      $ diff <($JAVA19_HOME/bin/javap -v --system $JAVA18_HOME java.util.List) <($JAVA19_HOME/bin/javap -v --system $JAVA19_HOME java.util.List)
      ...
      no change
      ```

            asotona Adam Sotona
            cushon Liam Miller-Cushon
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: