我正在收到警告
warning: [unchecked] unchecked call to add(E) as a member of the
raw type java.util.List
[javac] listbox.getChildren().add(listaMenu);
listaMenu
声明为
UISelectItems listaMenu = new UISelectItems();
和listbox
声明为
HtmlSelectOneListbox listbox = new HtmlSelectOneListbox();
当我使用 ant 构建任务进行编译时,如何摆脱这个警告消息?
谢谢
最佳答案
获取您正在使用的 Faces API 实现的新版本(支持泛型的版本),或者将 @SuppressWarnings("unchecked")
放在函数开始之前(就在public
或 private
会去哪里)。
关于java - 警告 : [unchecked] unchecked call to add(E) as a member of the raw type java. util.List,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12997666/