开发者

how do i get rid of a "Unchecked cast" warning?

Map<String,?> one = (Map<String,?>) parent.getAdapter().getItem(position);

Type safety: Unchecked cast from Object to Map<String,?>

with the above line of code i get that unchecked cast warning. what is the best way for me to have the same results but alleviat开发者_JAVA百科e that warning?


Add this annotation to the method:

@SuppressWarnings("unchecked") // Object to Map.

Be sure to comment it -- in a large method it may not be obvious.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜