• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Generics

 
Nikhil Jain
Ranch Hand
Posts: 389
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Eclipse gives a warning for the above code.
Type safety: The cast from Object to HashMap<String,Object> is actually checking against the erased type HashMap

How will we return something of object type in generics without getting the warning ...
 
Kaydell Leavitt
Ranch Hand
Posts: 690
Eclipse IDE Firefox Browser Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure why, but I believe that you need to replace <String, Object> with <String, ?>
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic