ignite-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey Goncharuk (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (IGNITE-2104) Marshalling fails with Binary marshaller if class hierarchy contains duplicate field names
Date Mon, 22 May 2017 16:23:05 GMT

     [ https://issues.apache.org/jira/browse/IGNITE-2104?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Alexey Goncharuk resolved IGNITE-2104.
--------------------------------------
    Resolution: Duplicate

Closing as a duplicate of IGNITE-2213

> Marshalling fails with Binary marshaller if class hierarchy contains duplicate field
names
> ------------------------------------------------------------------------------------------
>
>                 Key: IGNITE-2104
>                 URL: https://issues.apache.org/jira/browse/IGNITE-2104
>             Project: Ignite
>          Issue Type: Bug
>          Components: general
>    Affects Versions: 1.5.0.final
>            Reporter: Alexey Goncharuk
>             Fix For: 2.1
>
>
> Binary marshaller writes {{fieldId}} which is calculated solely on the field name. If
a class hierarchy contains fields with the same name, marshalling will fail:
> {code}
> class ClassA{
>     private int field;
> }
> class ClassB extends ClassA {
>     private int field;
> }
> {code}
> Even though a private field with the same name in parent and child classes is a error-prone
approach, default serialization supports this.
> Possible solutions:
>  * Keep it as it is now and properly document. The issue appeared only in an artificial
test. No other tests on TC revealed duplicate fields.
>  * Write all serializable classes in old format. While this solution works perfectly
for the marshalling, it will require objects to be deserialized on server nodes in order for
indexing to work, which defeats the purpose of BinaryMarshaller
>  * Inspect the class at runtime and use new format if no duplicate fields are detected,
and print a warning message and switch to the old format otherwise.



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

Mime
View raw message