[jira] [Commented] (IGNITE-5839) Unclear exception from BinaryObjectBuilder::build call when builder is reused
[ https://issues.apache.org/jira/browse/IGNITE-5839?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16207258#comment-16207258 ] ASF GitHub Bot commented on IGNITE-5839: Github user AMashenkov closed the pull request at: https://github.com/apache/ignite/pull/2532 > 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 >Assignee: Andrew Mashenkov > Fix For: 2.3 > > > 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 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)
[jira] [Commented] (IGNITE-5839) Unclear exception from BinaryObjectBuilder::build call when builder is reused
[ https://issues.apache.org/jira/browse/IGNITE-5839?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16170393#comment-16170393 ] Andrey Gura commented on IGNITE-5839: - LGTM! Merged to master. > 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 >Assignee: Andrew Mashenkov > Fix For: 2.3 > > > 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 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)
[jira] [Commented] (IGNITE-5839) Unclear exception from BinaryObjectBuilder::build call when builder is reused
[ https://issues.apache.org/jira/browse/IGNITE-5839?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16167647#comment-16167647 ] Andrew Mashenkov commented on IGNITE-5839: -- [~agura], thanks for pointing me. Fixed. > 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 >Assignee: Andrew Mashenkov > Fix For: 2.3 > > 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 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)
[jira] [Commented] (IGNITE-5839) Unclear exception from BinaryObjectBuilder::build call when builder is reused
[ https://issues.apache.org/jira/browse/IGNITE-5839?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16167642#comment-16167642 ] Andrey Gura commented on IGNITE-5839: - [~amashenkov] It seems that {{BinaryObjectBuilderImpl.setField(String name, Object val0)}} is broken after changes. If passed {{val0}} value is {{null}} then {{new BinaryValueWithType(BinaryUtils.typeByClass(Object.class), null)}} should be set to the target value field. > 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 >Assignee: Andrew Mashenkov > Fix For: 2.3 > > 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 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)
[jira] [Commented] (IGNITE-5839) Unclear exception from BinaryObjectBuilder::build call when builder is reused
[ https://issues.apache.org/jira/browse/IGNITE-5839?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16152446#comment-16152446 ] Andrew Mashenkov commented on IGNITE-5839: -- [~sergey-chugunov]], would you please review a PR? > 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 >Assignee: Andrew Mashenkov > Fix For: 2.3 > > 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 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)
[jira] [Commented] (IGNITE-5839) Unclear exception from BinaryObjectBuilder::build call when builder is reused
[ https://issues.apache.org/jira/browse/IGNITE-5839?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16143890#comment-16143890 ] ASF GitHub Bot commented on IGNITE-5839: GitHub user AMashenkov opened a pull request: https://github.com/apache/ignite/pull/2532 IGNITE-5839: Unclear exception from BinaryObjectBuilder::build call when builder is reused. Fix BinaryObjectBuilder reusage issue. You can merge this pull request into a Git repository by running: $ git pull https://github.com/gridgain/apache-ignite ignite-5839 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/ignite/pull/2532.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #2532 commit 774028b0aba9dcb453ce487b9265603e84bb147f Author: Andrey V. Mashenkov Date: 2017-08-28T15:18:05Z Fix BinaryObject builder reuse issue. > 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 >Assignee: Andrew Mashenkov > 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 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)
[jira] [Commented] (IGNITE-5839) Unclear exception from BinaryObjectBuilder::build call when builder is reused
[ 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 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)