Val., Alex G., Igniters,

Who knows why fields of Object[] type returned from PortableBuilderImpl.getField() are wrapped by PortableBuilderReader.LazyCollection internally by the builder while String[], UUID[] and many others are processed as PortablePlainLazyValue?

This leads to an inconsistent behavior.
I can get an Object[] field with PortableBuilderImpl.getField("arr_field"), then modify its content and after calling PortableBuilderImpl.build().deserailize() I'll have an object that has "arr_field" with the latest modifications. This doesn't work for String[] and others more type specific arrays (see PortableBuilderReader starting from line 391).

However, according to GridPortableBuilderAdditionalSelfTest.testModifyObjectArray() the behavior for fields of Object[] type that is currently implemented is incorrect. It means that Object[] fields must be wrapped by PortablePlainLazyValue as well.

So I want to make the behavior consistent across arrays of all types. Two possible approaches:
1) All arrays will be wrapped by PortablePlainLazyValue;
2) All arrays will be wrapped by PortableBuilderReader.LazyCollection.

I'm prefer 2) cause it looks more natural allowing the user to get an array field, modify it and then serialize/deserialize the whole object with the latest changes.

Any ideas on this?

--
Denis

Reply via email to