Java / Eclipse: removing multiple alerts for "Unnecessary @SuppressWarnings"

I am working on an old Java application that contains about 6 thousand warnings that I am trying to clear. One of them is simply "Unnecessary @Suppresswarnings (" XXXX ")." Eclipse has a quick solution for this, but there are several hundred in the code base and even more cases when it is actually used.

I would like to be able to apply “Quick Fix” (remove unused tokens) in all of these warnings at the same time, but cannot find a way to do this. Since there are many (more) instances of this annotation that do not generate warnings, the brute force bar of the annotations will simply generate more warnings.

Is there a way to do this in eclipse (or maybe a third-party tool), or am I just out of luck with this?

+5
source share
2 answers

It is best to do this outside of Eclipse. Maybe a quick shell script with sed / awk would be enough? If you have complex rules, you can always write another Java program to get rid of it.

+2
source

I would like to be wrong, but I think you're out of luck. I do not know how to quickly apply several warnings at once.

+4
source

All Articles