Unsupported @SuppressWarnings("PMD.DoNotCallSystemExit")

user342495 picture user342495 · Feb 16, 2011 · Viewed 17k times · Source

I need to use System.exit(0) in an application. Eclipse has the PMD plugin installed and complains about this line of code. Adding @SuppressWarnings ("PMD.DoNotCallSystemExit") remove that warning but now I get a warning that this SuppressWarnings is unsupported, despite the fact that it works.

Is there a way to resolve this?

Answer

user342495 picture user342495 · Feb 18, 2011

To get Eclipse to not flag the @SuppressWarnings("PMD") annotation, look under the menu headings Java -> Compiler -> Errors/Warnings -> Annotations -> Unhandled Token in '@SuppressWarnings' and set it to ignore.

Right on the PMD page.