Win a copy of Kotlin in Action this week in the Kotlin forum!
    Bookmark Topic Watch Topic
  • New Topic

Type safety: Unchecked cast from Object to List<String>  RSS feed

 
jazy smith
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi all,

I have a jsp scriplet where i wrote this code

List<String> user = (List<String>)session.getAttribute("username") ;

but it says " Type safety: Unchecked cast from Object to List<String>" error. Any idea to resolve it ?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66204
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please do not cross-post the same question in multiple forums. It wastes people's time when multiple redundant conversations take place. Please read this for more information.
 
It is sorta covered in the JavaRanch Style Guide.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!