Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-11558

Developer warning when HashMap is passed to putAll()

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 2.7
    • None
    • cache
    • None

    Description

      Currently when HashMap is passed to putAll it's very easy to cause deadlock since the order of keys is not stable.

      This is a pity because users will use HashMap by default and not expect any trouble.

      We should issue a warning when user passes HashMap (but not LinkedHashMap) to putAll(). On .Net we should probably check for Dictionary. Warning similar to the one issues when index cannot be efficiently inlined.

      Another approach is to turn keys into binary form and then sort them, if map is not a SortedMap.

      Attachments

        Issue Links

          Activity

            People

              ilyak Ilya Kasnacheev
              ilyak Ilya Kasnacheev
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: