<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Supple software comments on Java enums over IIOP</title>
    <link>http://supplesoftware.com/</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Supple software comments</description>
    <item>
      <title>"Java enums over IIOP" by petrovg</title>
      <description>&lt;p&gt;If you pass an enum argument over IIOP, the value in the deserialised object on the server has very strange properties. Here&amp;#8217;s what I observed (someEnum is the deserialised object on the server):&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;pre&gt;
someEnum = null
someEnum.name() = null
someEnum.toString() = null
(someEnum == null) = false
&lt;/pre&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Clearly a fairly useless instance for any possible purpose. It&amp;#8217;s null, but not quite. It has no value and can not be meaningfully compared.&lt;/p&gt;

&lt;p&gt;You can&amp;#8217;t work around it with Externalizable, because the immutable enum can not modify itself, and for the same (perfectly valid) reason write/readObject are useless. &lt;/p&gt;

&lt;p&gt;This was reported in May 2005 - here - &lt;a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6277781"&gt;http://bugs.sun.com/bugdatabase/view&lt;em&gt;bug.do?bug&lt;/em&gt;id=6277781&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The last comment on that entry, made in Aug 2007 says: &amp;#8220;btw, is someone working on that?&amp;#8230;&amp;#8221;.&lt;/p&gt;

&lt;p&gt;Seems either people who use Java 5 and later do not use IIOP and vice versa, or you&amp;#8217;d have thought someone would have done something by now&amp;#8230;.&lt;/p&gt;

&lt;p&gt;Any super-clever ideas for a workaround are most welcome.&lt;/p&gt;

&lt;p&gt;&amp;#8220;Don&amp;#8217;t use enums&amp;#8221; and &amp;#8220;don&amp;#8217;t use IIOP&amp;#8221; do not count as super-clever on this occasion.&lt;/p&gt;

</description>
      <pubDate>Sun, 17 Feb 2008 10:42:00 PST</pubDate>
      <guid>&lt;a href="/articles/2008/02/17/java-enums-over-iiop"&gt;Java enums over IIOP&lt;/a&gt;</guid>
      <link>&lt;a href="/articles/2008/02/17/java-enums-over-iiop"&gt;Java enums over IIOP&lt;/a&gt;</link>
    </item>
  </channel>
</rss>
