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

Arrays do not deserialize properly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 1.1.4
    • 1.7
    • binary, cache
    • None

    Description

      Code to reproduce:

      IgniteCache<Integer, String[]> cache = ignite.getOrCreateCache(CACHE_NAME);
      cache.put(1, new String[]{"hello", "world"});
      String[] res = cache.get(1);
      

      The bug is in CacheObjectContext.unwrapBinariesInArrayIfNeeded method, which always produces a new array.

      We should check for basic types somehow and skip this conversion.

      Generally, we NEVER want to change the type of the array, so the fix may be:

      if (arr.getClass().getComponentType() != Object.class)
          return arr;
      

      Attachments

        Issue Links

          Activity

            People

              dmagda Denis A. Magda
              ptupitsyn Pavel Tupitsyn
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: