This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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: 4339

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.
Similar Threads
Reading Elements from an ArrayList, 3 at a time
Sequential of 2 accounts file processing concurrently to update balance
My loop isn't working
Confusion in understanding Comparator in Java
Why is my type unexpected? required variable found value