[jira] [Commented] (IGNITE-4026) BinaryObjectBuilder.build() can fail if one of the fields is Externalizable

2016-12-05 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on IGNITE-4026:


Github user asfgit closed the pull request at:

https://github.com/apache/ignite/pull/1289


> 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: Vladimir Ozerov
>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)


[jira] [Commented] (IGNITE-4026) BinaryObjectBuilder.build() can fail if one of the fields is Externalizable

2016-11-27 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on IGNITE-4026:


GitHub user dkarachentsev opened a pull request:

https://github.com/apache/ignite/pull/1289

IGNITE-4026 - Fix BinaryObjectBuilder.build() can fail if one of the …

…fields is Externalizable, enum from binary object.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/gridgain/apache-ignite ignite-4026-1

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/ignite/pull/1289.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 #1289


commit 7972e721c937974d79c85e14f879c975dc62b519
Author: dkarachentsev 
Date:   2016-11-28T07:55:49Z

IGNITE-4026 - Fix BinaryObjectBuilder.build() can fail if one of the fields 
is Externalizable, enum from binary object.




> 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)


[jira] [Commented] (IGNITE-4026) BinaryObjectBuilder.build() can fail if one of the fields is Externalizable

2016-11-27 Thread Dmitry Karachentsev (JIRA)

[ 
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)