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

Map object on certain point, starts updating other key values as well.

XMLWordPrintable

    • x86_64
    • windows

      ADDITIONAL SYSTEM INFORMATION :
      Java 1.8, Windows 11, 15GB Ram

      A DESCRIPTION OF THE PROBLEM :
      I created Map object Map<String, Set<String>> map=new LinkedHashMap<>(); and was storing unique numbers in key and String values in value, after 96th object stored in map, I suddenly noticed that if 97th key object is getting updated with the values based on key in 97th key object, it also updating 96th key record values. Initially I thought it was some mine mistake, but tried several time, and confirmed that it seems some issue with Java 1.8.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Store 100 objects in map, update multiple values in map;s values.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      on updating map's object value based on key, it should update only particular key values not earlier key values as well.

      FREQUENCY : always


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

              Created:
              Updated:
              Resolved: