IntelliJ says "Warning: java: foo/bar/Baz.java uses unchecked or unsafe operations", but it doesn't say in which line it is referring to

Luigi R. Viggiano picture Luigi R. Viggiano · Jan 9, 2013 · Viewed 7.7k times · Source

I am getting this warning:

ScreenShot

When I click on the image, it just opens the associated Editor, but it doesn't say the line number where the warning is raised. I don't want to add @SuppressWarning("unchecked") on the whole class...

Any workaround/fix?

Answer

devmake picture devmake · Apr 25, 2013

To compile with -Xlint:unchecked in IntelliJ IDEA:

  • Go to Settings dialog (Ctrl+Alt+S or +, )
  • Select Compiler > Java Compiler
  • Add following into the field Additional command line parameters:

    -Xlint:unchecked

  • Run your compile again