Results 1 to 7 of 7
  1. #1
    kishan's Avatar
    kishan is offline Member
    Join Date
    Apr 2009
    Posts
    57
    Rep Power
    0

    Default Conversion Warning

    Hi,
    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));

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    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>.

  3. #3
    kishan's Avatar
    kishan is offline Member
    Join Date
    Apr 2009
    Posts
    57
    Rep Power
    0

    Default

    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?

    Java Code:
    ArrayList<LabelValueBean> ControlTypeOptions= new ArrayList<LabelValueBean>();
    ControlTypeOptions.addAll(CommonUtil.getComboOptio ns(request,"RadioButtonValues", false));

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    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.

  5. #5
    kishan's Avatar
    kishan is offline Member
    Join Date
    Apr 2009
    Posts
    57
    Rep Power
    0

    Default

    annotation means......... can u plz tell me clearly
    give some code it possible.

  6. #6
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    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.

  7. #7
    kishan's Avatar
    kishan is offline Member
    Join Date
    Apr 2009
    Posts
    57
    Rep Power
    0

Similar Threads

  1. Giving Warning
    By tanmoy.b81 in forum New To Java
    Replies: 1
    Last Post: 12-24-2008, 09:21 AM
  2. WARNING NetBeans HTTP Monitor
    By bbq in forum JavaServer Pages (JSP) and JSTL
    Replies: 3
    Last Post: 09-19-2008, 06:02 PM
  3. Java Security Warning
    By Neil in forum New To Java
    Replies: 3
    Last Post: 09-01-2008, 04:15 PM
  4. Loading resources generates warning messages
    By Namita Patil in forum New To Java
    Replies: 6
    Last Post: 07-03-2008, 02:04 PM
  5. warning: page has expired
    By Peter in forum Web Frameworks
    Replies: 2
    Last Post: 07-04-2007, 07:45 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •