File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Recompile with -Xlint:unchecked for details. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Recompile with -Xlint:unchecked for details." Watch "Recompile with -Xlint:unchecked for details." New topic

Recompile with -Xlint:unchecked for details.

Cam Barley

Joined: Feb 28, 2011
Posts: 3
I am getting an error when i compile my program, can anyone help me? The program will still work like its suppost to, but I would like to fix this error.

Thank you

Note: C:\Documents and Settings\*****\Desktop\ uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

Matthew Brown

Joined: Apr 06, 2010
Posts: 4543

Have you tried doing what it suggests?

The warnings are caused by using non-generic versions of collection classes, rather than the generic versions that were introduced in Java 5. Like on line 49, where using ArrayList<Stock> would be the recommended approach.

Adding that compiler option gives you more specific details.
Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

Remember that it is a warning not an error. With an error your build will fail while a warning just warns you.

"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
I agree. Here's the link:
subject: Recompile with -Xlint:unchecked for details.
It's not a secret anymore!