Opened 10 years ago

Closed 10 years ago

#895 closed enhancement (fixed)

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

Reported by: nicklas Owned by: nicklas
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 Changed 10 years ago by nicklas

  • Owner changed from everyone to nicklas
  • Status changed from new to assigned

comment:2 Changed 10 years ago by nicklas

  • Resolution set to fixed
  • Status changed from assigned to closed

(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.