Description
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.
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)
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:
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)
The letter is reproduced in BinaryTest2.java (attached).
Attachments
Attachments
Issue Links
- is duplicated by
-
IGNITE-4312 DML: update causes IgniteCheckedException: Invalid flag value: -2
- Resolved
- relates to
-
IGNITE-4917 BinaryObjectBuilder field value access failed if its serialized with optimal marshaller
- Resolved
- links to