On 27 October 2011 10:41, Mario Leyton <span dir="ltr"><<a href="mailto:mleyton@niclabs.cl">mleyton@niclabs.cl</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div bgcolor="#FFFFFF" text="#000000">
We are using rabbitmq java client and I believe the following is a
bug:<br></div></blockquote><div><br>Nope, it's deliberate. null, here, represents that no headers were sent. This is distinct from an empty map being sent. AMQP's basic properties structure includes "absent/present" bits for all of the fields; we chose to use "null" to represent "missing", as in this instance it is unambiguous. In languages like ML and Haskell we'd use 'whatever option and Maybe whatever, respectively. In C, we use a bitmap stored separately from the struct members concerned.<br>
<br>So when reading (or writing!) basic properties in Java,<br><ul><li>null means "missing value" or "no value"</li><li>empty map, empty string etc. is a <i>present</i> value but is otherwise just itself</li>
<li>non-empty maps, strings, etc are present values<br></li></ul>Regards,<br> Tony<br><br></div></div>