Give them a serialVersionUID, because:
- It's good general practice and it certainly doesn't hurt to specify it.
- Warnings should be addressed, not suppressed.
- Sometimes inner classes are changed to be top-level classes when they get large enough.
It's good (for all of the reasons stated in the documentation to which you've linked) that you won't be serializing instances of those inner classes. I suppose, if you were paranoid or worried other developers might not exercise the same good judgement, you could enforce that choice by having a writeObject
method in each inner class that unconditionally throws an exception.