I was wondering while looking at the eternal "serializable class XXX has no definition of serialVersionUID" warning in Netbeans : why not create a netbeans module which would populate this field "automagically" ?
The idea I had is the following :
- Get the full package name
- Get the class name
- Get the hash of the full path (package name + class name)
- Generate the field by some kind of hooking of the warning (make its action with the found value)
Then, I began with some search on how to get a 64bit hash :
- What is a good 64bit hash function in Java for textual strings?
- https://softwareengineering.stackexchange.com/questions/49550/which-hashing-algorithm-is-best-for-uniqueness-and-speed
But... I'm not experienced enough in NB RCP development to handle this (I did not found how to "capture" the warning event nor its action).
Has someone good tracks on that ?
The module will be publicly and freely released once done.