No. The JVM is supposed to magically handle all of the serialization issues of enums. This is somewhat annoyingly inconsistent, but if you weren't up for annoying inconsistency, you would be using Java serialization functionality.
I've fixed the "Serializable without serialVersionUID" and "Serializable without readObject() and writeObject()" inspections to ignore enumerated classes. Good catch.
I see in the enum documentation that "All are Serializable, Comparable and effectively final." If I'm reading the documentation right, would a new inspection that says Serializable on a enum is unnecessary/redundant be appropriate?
There's already an inspection for redundant interface declarations that would catch this case. I run with it off because I like the documentation effect. That said, I agree that defining an enumerated class as Serializable or Comparable would look fairly stupid. I'll think about if the existing inspection can be sharpened, or if a new inspection is appropriate.
No. The JVM is supposed to magically handle all of the serialization issues of enums. This is somewhat annoyingly inconsistent, but if you weren't up for annoying inconsistency, you would be using Java serialization functionality.
I've fixed the "Serializable without serialVersionUID" and "Serializable without readObject() and writeObject()" inspections to ignore enumerated classes. Good catch.
--Dave Griffith
/s/would/wouldn't
I see in the enum documentation that "All are Serializable, Comparable and effectively final." If I'm reading the documentation right, would a new inspection that says Serializable on a enum is unnecessary/redundant be appropriate?
Thanks,
Jon
There's already an inspection for redundant interface declarations that would catch this case. I run with it off because I like the documentation effect. That said, I agree that defining an enumerated class as Serializable or Comparable would look fairly stupid. I'll think about if the existing inspection can be sharpened, or if a new inspection is appropriate.
--Dave Griffith