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

Custom arrays are not serialized properly by CacheObjectBinaryProcessorImpl

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • ignite-1.4
    • None
    • cache
    • 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.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            dmagda Denis A. Magda

            Dates

              Created:
              Updated:

              Slack

                Issue deployment