Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
ignite-1.4
-
None
-
None
Description
If to put a custom object array into a cache like this one
TestObject[] arr = new TestObject[] {new TestObject(i)}; cache.put(0, arr);
then it will be serialized as Object[] array in CacheObjectBinaryProcessorImpl.marshallToBinary method.
This leads to the situation when object's array type is lost and on cache.get the code below produces ClassCastException
TestObject[] obj = cache.get(i);
The full test is already added into GridCacheBinaryObjectsAbstractSelfTest.testCustomArrays.
To fix the issue we have to revisit logic of CacheObjectBinaryProcessorImpl.marshallToBinary and CacheObjectContext.unwrapBinary.