aspose file tools
The moose likes Java in General and the fly likes Unchecked cast from Object to searilizable ArrayList Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Unchecked cast from Object to searilizable ArrayList" Watch "Unchecked cast from Object to searilizable ArrayList" New topic
Author

Unchecked cast from Object to searilizable ArrayList

Abhay Ram
Greenhorn

Joined: Dec 14, 2010
Posts: 7
Hi everybody i want to do like below but it shows the following warning .

Type safety: Unchecked cast from Object to
ArrayList<OfficeOfferLetter>


Code:

ArrayList<OfficeOfferLetter> allletters=new ArrayList<OfficeOfferLetter>();
allletters=(ArrayList<OfficeOfferLetter>) request.getAttribute("offerletters"):
[/code]
In the above code OfficeOfferLetter is the serealizable Bean Arraylist;

& request.getAttribute("offerletters") return the object thats why it shows above warning.

so please suggest any solution ...

thank you
Mohamed Sanaulla
Bartender

Joined: Sep 08, 2007
Posts: 2929
    
  15

This FAQ will be helpful.


Mohamed Sanaulla | My Blog
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Unchecked cast from Object to searilizable ArrayList
 
Similar Threads
Type safety: Unchecked cast from Object to ArrayList
warning Type Safety while assign from object to serealizable Arralist
generics compiler warning
Unchecked cast
generic collection - avoid unchecked cast?