SonarLint / IntelliJ still thinks my class is "Deprecated" even though it is not longer so

Marked class as Deprecated - SonarLint reported it as such - great! Then later on decided I didn’t want to Deprecate the class after all so removed tags. Now SonarLint still insists that it’s deprecated no matter what I do. I.E. Still says “Deprecated code marked for removal should never be used”… How do I get SonarLint to realise that things changed here? Sorry if a newbie question. rgds. Rob

Ok after struggling with this for a while, found the solution. Seems that classes that have the warning about the use of a deprecated class, must be completely closed in the editor. Open reopening those classes the problem is fixed. Seems like a refresh issue.

1 Like

Hello Rob,

This is a known behaviour. When a user modifies a file SonarLint doesn’t automatically re-analyze files that are impacted by this change. You need to close-reopen the impacted file, or the other option is to use the Analyze with SonarLint button (green triangle) in the Current file tab of the SonarLint tool window.

Anyway thanks for raising this, I reckon the user experience could be improved on that point and the file could be automatically re-analyzed

1 Like