Results 1 to 7 of 7
Thread: Conversion Warning
- 10-10-2009, 06:58 AM #1
can u please tell me how to get rid of the following warning.
warning: [unchecked] unchecked conversion for the following code 2nd line.
ArrayList<LabelValueBean> ControlTypeOptions= new ArrayList<LabelValueBean>();
ControlTypeOptions.addAll(CommonUtil.getComboOptio ns(request,"RadioButtonValues", false));
This is a warning not an error, so your program should still compile. My question is: what does CommonUtil.getComboOptions return? My bet is it returns an ArrayList, not an ArrayList<LabelValueBean>.
- 10-10-2009, 01:15 PM #3
thanks for ur reply............ u r correct, it returns raw type array list.
now my question is how to handle that warning?
Is there any conversion to LabelValueBean?
ArrayList<LabelValueBean> ControlTypeOptions= new ArrayList<LabelValueBean>(); ControlTypeOptions.addAll(CommonUtil.getComboOptio ns(request,"RadioButtonValues", false));
I don't know of any conversion. If this is not a method that you've created, and you can't make it return a generic ArrayList, you could turn the warning off via an annotation.
- 10-10-2009, 01:41 PM #5
annotation means......... can u plz tell me clearly
give some code it possible.
It would be better to read the Sun tutorials on this or find examples via Google. No sense in me re-inventing things that are already better described than I am able to do. Much luck.
- 10-10-2009, 01:52 PM #7
- By tanmoy.b81 in forum New To JavaReplies: 1Last Post: 12-24-2008, 10:21 AM
- By bbq in forum JavaServer Pages (JSP) and JSTLReplies: 3Last Post: 09-19-2008, 06:02 PM
- By Neil in forum New To JavaReplies: 3Last Post: 09-01-2008, 04:15 PM
- By Namita Patil in forum New To JavaReplies: 6Last Post: 07-03-2008, 02:04 PM
- By Peter in forum Web FrameworksReplies: 2Last Post: 07-04-2007, 07:45 AM