What is the hash of a null-type attribute value?

Tom Zeller tzeller at dragonacea.biz
Thu Nov 7 16:13:19 EST 2019


> But the point is that enum.toString() is not defined (AFAIK) and even if it is, it contains the full class name - just like the raw thing currently does. That leads to fragility at an API change...

No, I don't think so. Enum.toString() and Enum.name() return the same
name string (in our case NULL_VALUE or ZERO_LENGTH_VALUE) unless
toString() is overridden. It's ObjectOutputStream.writeObject() which
ends up calling the private writeEnum() which prefixes the name with
the class name.

Tom


More information about the dev mailing list