I can't be sure without seeing the code, but my guess is that query.getResultList() returns List, not List<String>.
You can either modify query.getResultList() to return List<String> instead, or if you can't (because it's not your code) put the following line above this one:
This will remove the warning, but it is really better to change the code of query.getResultList() instead.
For anyone who says you can cast to (List<String> ) instead of suppressing warnings, that cast will cause a warning as well [ September 24, 2007: Message edited by: Rob Prime ]
Originally posted by Huan Niu: Modify your code to:
HashMap<String,List<String>> levelsMap = new HashMap<String,List<String>>();
It will be fine. Did that answer your question?
Yes it answered my question. thank you
About the interfaces this code is imported code from other department = anyway I will be glad to hear other implementation suggestion.
About the query.getResultList() What I don't understand is why query.getResultList() not generify? (Query class: javax.persistence.Query) in Javaee-5.0.jar.
Yes, unfortunately EJB 3.0 Persistence did not generify their collections, and the Query.getResultList() returns a List and not a List<Object>. You can't cast your way out of a compiler warning (without other settings sent to the compiler).
So (as of Nov 2007),
This is something that EJB Persistence needs to fix. It likely won't happen until mid 2008. Make a note of these in your code so you can go clean them up later!
Post by:autobot
Ruth Stout was famous for gardening naked. Just like this tiny ad:
a bit of art, as a gift, that will fit in a stocking