Unused declaration inspection not being highlighted in IDEA 2016.2?

Answered

Just giving 2016.2 its first spin and I noticed the unused 'response' param below isn't being highlighted? normally this would be underlined with wavy grey and a warning mark in the gutter. I've checked my settings and the inspection is turned on, even tried toggling it on & off but IDEA still isn't working? its definitely unused and I'm sure 2016.1 was nagging me about it 20mins ago. It a freshly rebuilt index and the only project I've opened in 2016.2 so far.

This is on Centos 6.5(ish) I think.

7 comments
Comment actions Permalink

hmm just thought to try the lensing and it only reports that line 40 has changed, but it hasn't? its line 39 that changed not 40? (yes I saved before the capture just to check I hadn't removed any lines recently). Now I'm riddled with doubts about what IDEA 2016.2 is feeding back to me

Looking further down the file using the lens shows more of these line changed hints are wrong, the lower I go the more wrong they get? ranges off by 5 lines at the end of the file?

 (update) I I stopped IDEA and restarted it and the line changed have all corrected themselves. Might just look for a way to turn these off, the gutter shows the changed lines, don't see the point of having both.

But the unused param is still not highlighted, no such luck, if I ctrl+click it I get 'no usages found in project'.

0
Comment actions Permalink

This inspection doesn't affect interface implementations and overrides. Quick fix for unused declaration would remove it, while it's not possible for this case. That parameter may have been used in another inheritor.

0
Comment actions Permalink

Oops yes you're right must have been some other controller methods I as looking at and they were forwarding request and response to private methods.

Failed to notice this handleRequestInternal code is old style Spring 2.0 MVC not annotation driven where request and response are optional.

 

One side issue, I tried to open same project in 2016.1 just to check and got a message in 2016.1 about my datasource.ics being corrupted and a new datassource file had been created. Are there incompatibilities between 2016.1 and 2016.2? opening a project in one can 'corrupt' config for the other? I had closed down 2016.2 first.

0
Comment actions Permalink

IDE project files are not backwards compatible. It has been always the case. Data formats can change and the old IDE versions cannot read the new formats.

0
Comment actions Permalink

I understand that the "unused declaration" doesn't apply to interface parameters. The trouble is that I want it to apply. I have an interface, and I just noticed that I have failed to use a certain parameter in all my implementations, now I need to fix all of them. Is there anyway we could get an "unused interface parameter" inspection? It wouldn't have a quick fix, but it would still be very useful.

1
Comment actions Permalink

I should clarify that I only need it to get flagged in the classes that implement the interface. The inspection isn't very useful in the interface itself.

0

Please sign in to leave a comment.