Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-4783

Using new ArrayList<>(resultCache.values())

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 7.0.0.Final
    • 6.0.2.Final, 7.0.0.CR2
    • Core
    • None
    • Hide

      1. Put a value into a cache
      1.1 cache.size() will return 1
      2. use new ArrayList<>(cache.values())
      2.1 arraylist.size() will return 2
      2.2 2 items can be found in the list

      Show
      1. Put a value into a cache 1.1 cache.size() will return 1 2. use new ArrayList<>(cache.values()) 2.1 arraylist.size() will return 2 2.2 2 items can be found in the list

    Description

      Hi,
      I am a little bit confused about the behaviour of getting the values from a cache and inserting into an ArrayList.
      I've putted one value into a cache, so that cache.size() is returning 1. If i now use 'new ArrayList<>(resultCache.values())', there will be two items in the list.
      By iterating over the cache, only one iteration will run... Where comes the second item from?

      Regards,
      Markus

      Attachments

        Activity

          People

            wburns@redhat.com Will Burns
            markusvogt Markus Vogt (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: