Eclipse Save Actions
I recently started using a feature in Eclipse 3.6.1 that I didn't notice before: the "Save Actions".
Basically you can configure some actions that will be done automatically
when you save a Java source. Some of them are really useful, like
Organizing the imports, adding 'final' to private member instances, etc.
Here the screen-shot of it, with my preferences:

Eclipse Save Actions
From now on, nomore unused imports and better immutable classes.
From http://en.newinstance.it/2011/02/10/eclipse-save-actions/
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)






Comments
Amir Laher replied on Fri, 2011/02/11 - 4:00am
Hi Luigi, I also like that feature ...
I have a few more checked, but it's not important: 'organize imports' is the biggest one for me!
I'll share them with you:
Damien Lepage replied on Fri, 2011/02/11 - 11:05am
I would recommend one more usage: code formatting!
That's the reason I still put Eclipse configuration files into my source code repository, although I use Maven which could technically allow developers to use the IDE of their choice.
All the developers in my team use Eclipse, so whenever they save a file, our formatting rules is applied. Then, when comparing different versions of a file, we only see real differences , never differences due to code re-formatting.
Also, watch out about one problem with auto organized imports. Sometimes, you want to do a quick edit on a file which doesn't compile in Eclipse yet, because of some missing generated code, or library in your Maven repo. You know your project build will work because your build tool will take care of generating the code or downloading the library. But Eclipse doesn't know that and will remove the import statements which it doesn't find. So, it will break your build. That bothered me a few times. You need to run your build once, then refresh your project in Eclipse, then you can make your change.
To avoid that, I temporarily disabled the feature a couple of times, and even edited some Java code in Notepad++ rather than Eclipse.