@Override Annotation when extending/Implementing Interfaces

Hello,

I having a bit of an issue with getting Code Generation to add the @Override annotation to methods when I implement or extend a class.

I have the following options:

Language Level -> 6.0 @Override in interfaces

"Code Style" -> "Code Generation" -> "Insert @Override Annotation" selected.

Furthermore when the extends Dialog pops up I make sure that "@Override annotation is selected"


So is there any other setting that I should be made aware of.

I am implementing/extending at the moment classes with over 10 boiler plate methods, and it is productivity turn off not having this working.


Best Regards,
Fotis

14 comments
Comment actions Permalink

Hi Fotis,

Am I right understanding that the option is checked but the annotation is not added when you override/implent methods via 'Ctrl+I'/'Ctrl+O'?

Denis

0
Comment actions Permalink

Hello Denis,

Yes your assumption is correct.


Any ideas?

Best,
Fotis

0
Comment actions Permalink

Please create minimal but complete standalone project that illustrates the problem and attach it to the current thread.

(the problem is that I'm unable to reproduce that at local environment. May be particular project settings may affect that)

0
Comment actions Permalink

Hello Denis,

What do you know :)! In the small test project unfortunately it works, so there is something up with my other project. Any ideas on how to start looking for the solution. I have a feeling that my project settings are some how involved.

Any suggestion on how to debug this issues, or somehow "reset" my project.

Best Regards,
Fotis

0
Comment actions Permalink

I would start by disabling all third-party plugins and checking if that helps.

Then you can provide me your code style settings, I'll check if the problem is there (the settings *.xml is located under '$IDEA_CONFIG_HOME/codestyles' directory)

Denis

0
Comment actions Permalink

Hello Deny,

Check this out

$ pwd

/Users/fotis/Library/Preferences/IntelliJIdea10


$ ls codestyles
$
There is nothing under codestyles.


As for the plugins the only plugin I have is the "Line Mover" plugin, which I disabled but no luck.

Any new project I create is fine, but there is something messed up with my current one.


Also one thing that I did not mention is that both my test projects which work, and this project which doesn't work are Maven projects.


Are there any settings in the .iml files that might cause problems?



0
Comment actions Permalink

Sorry, forgot to mention that you should export your current code style.

Denis

0
Comment actions Permalink

Hello Denis,

I am attaching the xml file  as well as a Screenshot of my configuration pane



Attachment(s):
2011_05_11.xml
Screen shot 2011-05-11 at 6.40.27 PM.png
0
Comment actions Permalink

Still unable to reproduce that withi your code style settings.

Will think what else we can do in order to find out the problem's reason.

Denis

0
Comment actions Permalink

Hello Denis,

Are you aware of any way to rest the project to some defaults?

Best Regards,
Fotis

0
Comment actions Permalink

You can try to remove contents of $IDEA_CONFIG directory.

Denis

0
Comment actions Permalink

Hello Denis,

Can I break something by removing those directories, and let them be recreated?

0
Comment actions Permalink

AFAIK, that should be ok but you always can backup 'config' contents before removing and restore them if anything goes wrong.

Denis

0
Comment actions Permalink

Hello,

Just to let anyone know if they come around here, I was having issues with my LiveTemplates, and decided that something was up with the config.

Unfortunately I had to go through installing plugin and setting up my environment from the beginning ( No pun intended, but I never resorted to this 5+ years using the other IDE :)).

Now everything is good.


Thanks for the help!

Best Regards,
Fotis

0

Please sign in to leave a comment.