Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Quick way to add all @Overrides in a file

It's easier to configure Save Actions and run them through Source > Clean Up on any source folder.

Here are the clean-up cations I ran on cdt.core and cdt.ui:
Add final modifier to private fields
Remove unused imports
Add missing '@Override' annotations
Add missing '@Override' annotations to implementations of interface methods
Add missing '@Deprecated' annotations
Remove unnecessary casts
Remove unnecessary '$NON-NLS$' tags


On Mon, Jan 16, 2012 at 4:42 PM, Marc Khouzam <marc.khouzam@xxxxxxxxxxxx> wrote:
I already fixed the DSF and DSF-GDB plugins, which, believe it or not, was about 1500 cases.

If someone else wants to tackle the other plugins, or subsets of them, that would be great.  with your nice trick of using saving rules, it should be simply to open every file and saving it.

Thanks for the pointer!

Best regards,


----- Original Message -----
From: Andrew Gvozdev <>
To: "CDT General developers list." <cdt-dev@xxxxxxxxxxx>
Sent: 16-01-2012 17:20
Subject: Re: [cdt-dev] Quick way to add all @Overrides in a file

Hi Marc,
Alternatively, you may choose to add the @Override annotations automatically on Save. You can set Save Actions in Preferences for Java Editor. This way you would not need to worry to even remember about those. I would suggest to fix them in a separate commit en masse though.


On Mon, Jan 16, 2012 at 11:23 AM, Marc Khouzam <marc.khouzam@xxxxxxxxxxxx<mailto:marc.khouzam@xxxxxxxxxxxx>> wrote:

Sorry to those that know this already.

Committers might have noticed that now that we use Java 6 for CDT,
methods that implement an interface method now require an @Override
annotation.  So there are a bunch of new warnings that those annotations
are missing.

As you make changes to files, you may want to add those annotations.
A quick way to do this is to use the quick fix (click on warning icon and
choose the fix that adds the annotation) while pressing the Ctrl key at the
same time.  Thanks the the Ctrl key being pressed, JDT will fix _all_ similar
warnings in that file.  Super quick fix :)

Hope it helps


cdt-dev mailing list

cdt-dev mailing list

Back to the top