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] [Commented] (IGNITE-5839) Unclear exception from BinaryObjectBuilder::build call when builder is reused
Date Mon, 28 Aug 2017 15:06:00 GMT

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

Andrew Mashenkov commented on IGNITE-5839:
------------------------------------------

Seems, wrong overloaded method is used in  {{bldr.setField("str", null)}}.

_setField(String name, @Nullable BinaryObjectBuilder builder) _should delegate call to _setField(String
name, Object val)_ without explicit type.




> Unclear exception from BinaryObjectBuilder::build call when builder is reused
> -----------------------------------------------------------------------------
>
>                 Key: IGNITE-5839
>                 URL: https://issues.apache.org/jira/browse/IGNITE-5839
>             Project: Ignite
>          Issue Type: Bug
>    Affects Versions: 2.1
>            Reporter: Sergey Chugunov
>             Fix For: 2.2
>
>         Attachments: Fix_BinaryObject_builder_reuse_issue_.patch
>
>
> Simple test where {{BinaryObjectBuilder}} builder object is reused fails with exception
{noformat}org.apache.ignite.binary.BinaryObjectException: Wrong value has been set [typeName=SimpleCls,
fieldName=str, fieldType=String, assignedValueType=Object]{noformat}
> {noformat}
>         IgniteCache<Object, Object> cache = /* obtain a reference to withKeepBinary
cache instance */;
>         BinaryObjectBuilder bldr = grid(0).binary().builder("SimpleCls");
>         bldr.setField("str", "abc");
>         c.put(0, bldr.build());
>         bldr.setField("str", null);
>         c.put(1, bldr.build());
>         bldr.setField("str", "def");
>         c.put(2, bldr.build()); //exception will be thrown by call bldr.build()
> {noformat}
> It can be fixed by simply recreating BinaryObjectBuilder instead of reusing the same
instance. 
> However reusing builder object must be either explicitly prohibited or exception must
be fixed.
> Right now documentation on builder class says nothing about reusing this object.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message