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


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

This FAQ will be helpful.


Mohamed Sanaulla | My Blog
 
Consider Paul's rocket mass heater.
 
subject: Unchecked cast from Object to searilizable ArrayList
 
Similar Threads
Type safety: Unchecked cast from Object to ArrayList
Unchecked cast
warning Type Safety while assign from object to serealizable Arralist
generics compiler warning
generic collection - avoid unchecked cast?