ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pavel Tupitsyn (JIRA)" <j...@apache.org>
Subject [jira] [Created] (IGNITE-3240) Arrays do not deserialize properly
Date Thu, 02 Jun 2016 15:16:59 GMT
Pavel Tupitsyn created IGNITE-3240:

             Summary: Arrays do not deserialize properly
                 Key: IGNITE-3240
                 URL: https://issues.apache.org/jira/browse/IGNITE-3240
             Project: Ignite
          Issue Type: Bug
          Components: binary, cache
    Affects Versions: 1.1.4
            Reporter: Pavel Tupitsyn
            Priority: Blocker
             Fix For: 1.7

Code to reproduce:

IgniteCache<Integer, String[]> cache = ignite.getOrCreateCache(CACHE_NAME);
cache.put(1, new String[]{"omg", "wtf"});
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;

This message was sent by Atlassian JIRA

View raw message