ignite-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Mashenkov (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (IGNITE-5087) Enum comparison fails after marshal-unmarshal with BinaryMarshaller.
Date Fri, 28 Apr 2017 14:21:04 GMT

    [ https://issues.apache.org/jira/browse/IGNITE-5087?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15988888#comment-15988888
] 

Andrew Mashenkov edited comment on IGNITE-5087 at 4/28/17 2:20 PM:
-------------------------------------------------------------------

Actually, we check if object is enum instance by calling 'isEnum()' method on class.

It works fine if it is enum constant. But enum objects type is anonymous class and isEnum()
method on it returns false, 
that leads these object to be serialized as regular objects.

Startpoint is BinaryFieldAccessor.mode() method. It uses to detect serialization mode for
field value type, but not for field type itself. 
Also seems, we should write enum.getDeclaredClass name instead of value class. See BinaryWriterImpl.doWriteEnum().




was (Author: amashenkov):
Actually, we check if object is enum instance by calling 'isEnum()' method on class.

It works fine if it is enum constant. But enum objects type is anonymous class and isEnum()
method on it returns false, 
that leads these object to be serialized as regular objects.

Startpoint is BinaryFieldAccessor.mode() method. 
1. It uses to detect serialization mode for field value type, but not for field type itself.

2. Also, we should write enum.getDeclaredClass name instead of value class. See BinaryWriterImpl.doWriteEnum().



> Enum comparison fails after marshal-unmarshal with BinaryMarshaller.
> --------------------------------------------------------------------
>
>                 Key: IGNITE-5087
>                 URL: https://issues.apache.org/jira/browse/IGNITE-5087
>             Project: Ignite
>          Issue Type: Bug
>    Affects Versions: 1.9
>            Reporter: Andrew Mashenkov
>             Fix For: 2.1
>
>         Attachments: EnumBinaryMarshallerBug.java
>
>
> PFA repro.
> It fails on 1.9 and on 2.0-snapshot as well.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message