Search code examples
moduledevelopment-environmentnetbeans-platform

Tracks needed to create a useful Netbeans module for Java development


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 :

  1. Get the full package name
  2. Get the class name
  3. Get the hash of the full path (package name + class name)
  4. 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 :

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.


Solution

  • A plugin exists already.

    https://kenai.com/projects/nb-svuid-generator/downloads/directory/nbms/nb7.2

    and there are a couple of old plugins too.

    http://plugins.netbeans.org/plugin/6887/serialversionuid-generator http://plugins.netbeans.org/plugin/22113/serialversionuid-code-generator