>"code-internal constants ... shall always  be declared in
>typesafe-enumeration style classes"
>
>well you do know there are issues with deserialization of typesafe
>enums? ( deser(ser(A))!=A )

Well, actually, simply writing the following snippet will solve that
problem...

private Object readResolve(){
  return lookupConstant(internalIndex);
}

where lookupConstant() is an internal private method which finds the
appropriate constant instance based on an internal index in an internal
array of the constants.

Regards,
John

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to