Saturday, 11 October 2008

Turn off no serialVersionUID warnings in eclipse

A bit of madness that I've always asscoiated with eclipse is that it shows a warning if a Java class does not have a serialisable UID, for example, something like the following...


public class MyTreeModel extends DefaultTreeModel
{
    private static final long serialVersionUID = 7522249943744455803L;
}


If I see this then I know its been written using eclipse, to turn it off go to the project's properties. In the tree follow Java Compiler->Errors/Warnings. To configure this for all projects click on Configure Workspace Settings... In the list of categories choose Potential Programming Problems and the setting for serial UIDs is top of the list, here you can it to ignore.

No comments: