[JBoss JIRA] (IPROTO-63) writeObject throws IllegalArgumentException with oneof label
by Nistor Adrian (Jira)
[ https://issues.redhat.com/browse/IPROTO-63?page=com.atlassian.jira.plugin... ]
Nistor Adrian updated IPROTO-63:
--------------------------------
Fix Version/s: 4.4.0.Alpha1
(was: 4.3.3.Final)
> writeObject throws IllegalArgumentException with oneof label
> ------------------------------------------------------------
>
> Key: IPROTO-63
> URL: https://issues.redhat.com/browse/IPROTO-63
> Project: Infinispan ProtoStream
> Issue Type: Bug
> Reporter: Ryan Emerson
> Assignee: Nistor Adrian
> Priority: Major
> Fix For: 4.4.0.Alpha1
>
>
> The below schema results in the following exception:
> Schema:
> {code:java}
> message EntryVersion {
> oneof version {
> NumericVersion numeric = 1;
> ClusteredVersion clustered = 2;
> }
> // optional NumericVersion numeric = 1;
> // optional ClusteredVersion clustered = 2;
> }
> message NumericVersion {
> required int64 version = 1;
> }
> message ClusteredVersion {
> required int64 version = 1;
> required int32 topology = 2;
> }
> {code}
> Exception:
> {code:java}
> java.lang.IllegalArgumentException: Declared field type is not a message or an enum : numeric
> {code}
> It seems this is caused because the type for the field "numeric" is null in the associated FieldDescriptor object that is retrieved in the [writeObject impl|https://github.com/infinispan/protostream/blob/master/core/src/main/...].
> If the oneof label is replaced with the commented optional fields, the marshallers work as expected.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
5 years, 10 months
[JBoss JIRA] (IPROTO-120) Null collection fields always unmarshalled as empty collection implementation
by Nistor Adrian (Jira)
[ https://issues.redhat.com/browse/IPROTO-120?page=com.atlassian.jira.plugi... ]
Nistor Adrian updated IPROTO-120:
---------------------------------
Fix Version/s: 4.4.0.Alpha1
(was: 4.3.3.Final)
> Null collection fields always unmarshalled as empty collection implementation
> -----------------------------------------------------------------------------
>
> Key: IPROTO-120
> URL: https://issues.redhat.com/browse/IPROTO-120
> Project: Infinispan ProtoStream
> Issue Type: Bug
> Reporter: Ryan Emerson
> Assignee: Nistor Adrian
> Priority: Major
> Fix For: 4.4.0.Alpha1
>
>
> The following Pojo always returns an empty collection after being unmarshalled, regardless of whether {{stringList}} was null or empty when marshalled.
> {code:java}
> public class SomePojo {
> @ProtoField(number = 1, collectionImplementation = ArrayList.class)
> final List<String> stringList;
> @ProtoFactory
> public SomePojo(List<String> stringList) {
> this.stringList = stringList;
> }
> }
> {code}
> This is because the generated marshaller always creates the collection instance before attempting to read the collection content:
> {code:java}
> java.util.ArrayList __c$1 = new java.util.ArrayList();
> boolean done = false;
> while (!done) {
> final int tag = $2.readTag();
> switch (tag) {
> case 0:
> done = true;
> break;
> case 10: {
> java.lang.String __v$1 = $2.readString();
> __c$1.add(__v$1);
> break;
> }
> default: {
> if (!$2.skipField(tag)) done = true;
> }
> }
> }
>
> return new org.infinispan.query.dsl.embedded.testdomain.hsearch.SomePojo(__c$1);
> {code}
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
5 years, 10 months