Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 2897E200BD1 for ; Mon, 28 Nov 2016 08:50:00 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 273CF160B0D; Mon, 28 Nov 2016 07:50:00 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 7122B160B06 for ; Mon, 28 Nov 2016 08:49:59 +0100 (CET) Received: (qmail 67176 invoked by uid 500); 28 Nov 2016 07:49:58 -0000 Mailing-List: contact issues-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list issues@ignite.apache.org Received: (qmail 67150 invoked by uid 99); 28 Nov 2016 07:49:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Nov 2016 07:49:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 6E5D22C03DB for ; Mon, 28 Nov 2016 07:49:58 +0000 (UTC) Date: Mon, 28 Nov 2016 07:49:58 +0000 (UTC) From: "Dmitry Karachentsev (JIRA)" To: issues@ignite.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (IGNITE-4026) BinaryObjectBuilder.build() can fail if one of the fields is Externalizable MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 28 Nov 2016 07:50:00 -0000 [ https://issues.apache.org/jira/browse/IGNITE-4026?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15701231#comment-15701231 ] Dmitry Karachentsev commented on IGNITE-4026: --------------------------------------------- [PR#1281|https://github.com/apache/ignite/pull/1281] > BinaryObjectBuilder.build() can fail if one of the fields is Externalizable > --------------------------------------------------------------------------- > > Key: IGNITE-4026 > URL: https://issues.apache.org/jira/browse/IGNITE-4026 > Project: Ignite > Issue Type: Bug > Components: binary > Affects Versions: 1.7 > Reporter: Valentin Kulichenko > Assignee: Dmitry Karachentsev > Priority: Critical > Fix For: 1.8 > > Attachments: BuilderTest.java, BuilderTest2.java > > > Test reproducing the issue is attached. > Scenario is the following: > # Create a binary object with an {{Externalizable}} field. > # Create a builder from this object using {{toBuilder()}} method. > # Do some modifications. > # Call {{build()}}, get exception below. > {noformat} > Exception in thread "main" class org.apache.ignite.binary.BinaryObjectException: Invalid flag value: -2 > at org.apache.ignite.internal.binary.builder.BinaryBuilderReader.parseValue(BinaryBuilderReader.java:761) > at org.apache.ignite.internal.binary.builder.BinaryObjectBuilderImpl.serializeTo(BinaryObjectBuilderImpl.java:281) > at org.apache.ignite.internal.binary.builder.BinaryObjectBuilderImpl.build(BinaryObjectBuilderImpl.java:183) > at BuilderTest.main(BuilderTest.java:16) > {noformat} > Similar issue exists with enums. An attempt to set enum field to builder with a value which was read from a binary object fails with this exception: > {noformat} > Exception in thread "main" class org.apache.ignite.binary.BinaryObjectException: Wrong value has been set [typeName=MyType, fieldName=enum, fieldType=Enum, assignedValueType=Object] > at org.apache.ignite.internal.binary.builder.BinaryObjectBuilderImpl.checkMetadata(BinaryObjectBuilderImpl.java:401) > at org.apache.ignite.internal.binary.builder.BinaryObjectBuilderImpl.serializeTo(BinaryObjectBuilderImpl.java:316) > at org.apache.ignite.internal.binary.builder.BinaryObjectBuilderImpl.build(BinaryObjectBuilderImpl.java:183) > at BuilderTest2.main(BuilderTest2.java:15) > {noformat} > The letter is reproduced in {{BinaryTest2.java}} (attached). -- This message was sent by Atlassian JIRA (v6.3.4#6332)