File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes I got a Type-Safe Warning Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "I got a Type-Safe Warning" Watch "I got a Type-Safe Warning" New topic

I got a Type-Safe Warning

Denny Kim

Joined: Jan 31, 2007
Posts: 1
HI~ nice meet you. I have a guestion!.

I use WeakReference in my LockManager Class. Here,

But,I got a Type-Safe Warning When I compiled this.!!

Note: uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.

Then, I modified Map.

As expected,It is the same as this.

Now,How do i fix this(Type-safe warning)? Please,Help me.

[ January 31, 2007: Message edited by: Denny Kim ]

(edited: SCJD is a quiet place, don't shout in topic titles)
[ February 01, 2007: Message edited by: Barry Gaunt ]
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
Do not forget that WeakReference is a generic class:

Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
It is sorta covered in the JavaRanch Style Guide.
subject: I got a Type-Safe Warning