[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.jdt] Re: serialVersionUID in abstract classes

Thanks Eric
I tried your suggestion, however it doesn't do anything.
The cleanup dialog (using 3.2.1, BTW) says
'The refactoring doesn't change any source code'

And it really doesn't.

Another thing is that I cannot select multiple files in search dialog
and invoke the Cleanup action even if it were working.

Do you know whether it should work better in 3.3M3? If yes, I might
rather download it for this to work.

w.

Eric Rizzo wrote:
Walter wrote:
Has anybody run into the following issue?

1. Mark missing serialVersionUID as Error (in Java/Compiler setting)
2. Eclipse will mark all non-abstract classes but NOT abstract classes.

I have a problem with a big codebase running on javac vs. Eclipse compiled classes. Used the approach above to add serialVersionUID to all non-abstract classes in few clicks. But don't know how to handle the abstract classes.

It is intentional that the warning does not flag Abstract classes - the same reason abstract classes that do not implement some interface methods are not flagged as an error.
That said, you are certainly free to file an enhancement request to have an option for that (it would have to be optional).
To help you out in the meantime, you can select multiple classes, right-click, and choose Source > Clean Up... On the resulting dialog select the Missing Code tab and you will see an option to generate a serialVersionUID.


Hope this helps,
    Eric