Recompile with -Xlint:unchecked for details

I am compiling my code in the IDE and I get a couple of warnings. One with a recommendation:

java: Recompile with -Xlint:unchecked for details

How do I do this?

The code in question looks like:

designDoc.getViews().add(viewDesign);
The getViews() is returning a List not a List<ViewDesign> hence the error. Ideally I would like to add an annotation to supress the warning but when I do that I get an error that Annotations are not allowed here. Ideas?

1 comment

If you want to see the detail warnings: In the Setting dialog, "Java Compiler" add  -Xlint:unchecked to "Additional command line parameters"

11.jpg
And if you want to suppress the warnings,Add the annotaion @SuppressWarnings("unchecked") to class

0

Please sign in to leave a comment.