Opened 17 years ago

Closed 17 years ago

#895 closed enhancement (fixed)

Add serialVersionUID to all classes that need it but doesn't have it

Reported by: Nicklas Nordborg Owned by: Nicklas Nordborg
Priority: major Milestone: BASE 2.6
Component: core Version:
Keywords: Cc:

Description

The serialVersionUID field is recommended for all Serializable classes. For example, exceptions and taglibs are serializable by inheritance but none of our classes declare the field. This is annoying since it shows up as lots of warnings in Eclipse. It is not a good idea to turn those warnings of, since this would also affect our classes used for web services. In those classes, it is important that we declare the serialVersionUID field, or the web services may not function correctly. So, the warnings are really a good thing, but not if only a few of them are important.

NOTE! It is easy to have Eclipse auto-generate the serialVersionUID field:

  • Right click on the project
  • Choose the Source -> Clean Up menu
  • Switch off all options except the 'Add serial version Id' on the 'Missing code tab'. Use the 'Generated' option.

NOTE 2! The Clean up function has other useful functions, but we save those until some later time.

Change History (2)

comment:1 by Nicklas Nordborg, 17 years ago

Owner: changed from everyone to Nicklas Nordborg
Status: newassigned

comment:2 by Nicklas Nordborg, 17 years ago

Resolution: fixed
Status: assignedclosed

(In [4084]) Fixes #895: Add serialVersionUID to all classes that need it but doesn't have it

Note: See TracTickets for help on using tickets.