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

IdentityHashMap results differ between OpenJDK8, 11 and 17.

    XMLWordPrintable

Details

    Description

      ADDITIONAL SYSTEM INFORMATION :
      ubuntu 20.04

      openjdk version "1.8.0_392"
      OpenJDK Runtime Environment (Temurin)(build 1.8.0_392-b08)
      OpenJDK 64-Bit Server VM (Temurin)(build 25.392-b08, mixed mode)

      openjdk version "11.0.21" 2023-10-17
      OpenJDK Runtime Environment Temurin-11.0.21+9 (build 11.0.21+9)
      OpenJDK 64-Bit Server VM Temurin-11.0.21+9 (build 11.0.21+9, mixed mode)

      openjdk version "17.0.9" 2023-10-17
      OpenJDK Runtime Environment Temurin-17.0.9+9 (build 17.0.9+9)
      OpenJDK 64-Bit Server VM Temurin-17.0.9+9 (build 17.0.9+9, mixed mode, sharing)

      A DESCRIPTION OF THE PROBLEM :
      IdentityHashMap stores results differently in OpenJDK8 and 11 than in OpenJDK17

      To prevent the source code from being reproducibleissue, we uploaded the bytecode files to Google Cloud Drive.
      https://drive.google.com/file/d/1YbxmDYB_3yMwRVo-E_yDDaZIBLYfIom4/view?usp=sharing

      REGRESSION : Last worked in version 11.0.21

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      jdk_linux_8_hotspot/bin/java -cp ./ test

      jdk_linux_11_hotspot/bin/java -cp ./ test

      jdk_linux_17_hotspot/bin/java -cp ./ test

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      [foo=bar, baz=quux]

      [foo=bar, baz=quux]

      [foo=bar, baz=quux]
      ACTUAL -
      [baz=quux, foo=bar]

      [baz=quux, foo=bar]

      [foo=bar, baz=quux]

      ---------- BEGIN SOURCE ----------
      public class test {
          public static void main(String[] var0) {
              IdentityHashMap var1 = new IdentityHashMap();
              var1.put("foo", "bar");
              var1.put("baz", "quux");
              String var2 = (new ArrayList(var1.entrySet())).toString();
              System.out.println(var2);
          }
      }
      ---------- END SOURCE ----------

      FREQUENCY : always


      Attachments

        Activity

          People

            tongwan Andrew Wang
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: