Generics Usage Warning-Type safety:The cast from Object to Collection<String> is....

Joined
Nov 13, 2007
Messages
1
Reaction score
0
In Eclipse I m getting the following warning while I tried to use generics.

"Type safety: The cast from Object to Collection<String> is actually checking against the erased type Collection"

My code goes like...

Collection rules = null;
rules = (Collection<String>) JmxServiceAgent.invoke(InfoVO);


Where "JmxServiceAgent.invoke(mBeanInfoVO)" will return an object and my expectation is of type Collection<String>

Please letme know watz wrong with the code?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,111
Latest member
VetaMcRae
Top