vscode-java icon indicating copy to clipboard operation
vscode-java copied to clipboard

SuppressWarnings annotation not picked up

Open ryantomlinson95 opened this issue 9 months ago • 5 comments

When using the @SuppressWarnings() annotation, it does not seem to be recognized in some instances. In this case its specifically for the serializable class warning.

Warning 1: Image

Warning 2: Image

Just for clarity, I'm using Cursor but haven't used any of those features yet. This is just vscode at this point.

It generates thousands of errors like this across our codebase:

Image

ryantomlinson95 avatar Mar 14 '25 21:03 ryantomlinson95

@ryantomlinson95 you can try to add

org.eclipse.jdt.core.compiler.problem.suppressWarningsNotFullyAnalysed=ignore
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore

to <your_project>/.settings/org.eclipse.jdt.core.prefs. See Settings Global Preferences

snjeza avatar Mar 14 '25 23:03 snjeza

@snjeza Thanks for the suggestion, unfortunately this did not work for me though.

Image

Image

Did these and still seeing the same errors

ryantomlinson95 avatar Mar 17 '25 14:03 ryantomlinson95

Did these and still seeing the same errors

No, I didn't. If you use <your_project>/.settings/org.eclipse.jdt.core.prefs, you don't need to set java.settings.url.

snjeza avatar Mar 17 '25 15:03 snjeza

Unfortunately that's not working for me

ryantomlinson95 avatar Mar 17 '25 15:03 ryantomlinson95

@ryantomlinson95 Could you attach a project example reproducing the error?

snjeza avatar Mar 17 '25 15:03 snjeza