I read about the -Xlint:unchecked in the Oracle Java tutorial link. And I would like to setup my IDE to inform me about unsafe code. But I faced some troubles trying to accomplish so. But I managed to get a warning message in my Terminal using command:
javac GenericsMain.java Box.java -Xlint:unchecked
I got such message
GenericsMain.java:19: warning: [unchecked] unchecked call to addItem(T)
as a member of the raw type Box
rawBox.addItem(8);
^
where T is a type-variable:
T extends Object declared in class Box
GenericsMain.java:23: warning:
[unchecked] unchecked call to addItem(T) as a member of the raw type Box
rawBox.addItem(8);
^
where T is a type-variable:
T extends Object declared in class Box
2 warnings
How can I provide this in my IDE? Thank you.
Settings (Ctrl+Alt+S / ⌘,) > Build, Execution, Deployment > Compiler > Java Compiler > "Additional command line parameters"
This is a per project setting.

To set for new future projects, set the same under File > Other Settings > Default Settings

More details at: https://www.jetbrains.com/help/idea/java-compiler.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With