File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
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
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3068
    
  33

This FAQ will be helpful.


Mohamed Sanaulla | My Blog
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unchecked cast from Object to searilizable ArrayList