astitcher commented on a change in pull request #263:
URL: https://github.com/apache/qpid-proton/pull/263#discussion_r448491607



##########
File path: c/src/core/encoder.c
##########
@@ -336,8 +336,10 @@ static int pni_encoder_exit(void *ctx, pn_data_t *data, 
pni_node_t *node)
   pn_encoder_t *encoder = (pn_encoder_t *) ctx;
   char *pos;
 
-  // Special case 0 length list
-  if (node->atom.type==PN_LIST && node->children-encoder->null_count==0) {
+  // Special case 0 length list, but not as first element in an array
+  pni_node_t *parent = pn_data_node(data, node->parent);
+  if (node->atom.type==PN_LIST && node->children-encoder->null_count==0 &&
+      !(pn_is_in_array(data, parent, node) && pn_is_first_in_array(data, 
parent, node))) {

Review comment:
       I think this should test for *any* element of an array not just the 
first. This is because the type opcode is the array opcode for every list 
element and so shouldn't be changed for a 0 element list in any place in the 
array.
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org

Reply via email to