"Unused declaration" inspection ignores @Autowired fields

已回答

When I run the default "Unused declaration" inspection with default settings on a class with unused fields which are annotated with `@Autowired` then the inspection doesn't recognize them as unused. When I remove the annotation they're found.

Interestingly the field is still greyed out:

So for some reason the inspection seems to work when run automatically but not when I run it. What could be the cause of this? Thanks!

0

Hi Simon,

I created a bug report for this on our issue tracker: IDEA-264844. Responsible developers will look into it shortly.

Feel free to follow the issue to stay updated on the progress of the investigation, and leave additional comments.

See this article if you are not familiar with YouTrack.

0

请先登录再写评论。