我收到了警告
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构建任务进行编译时,如何摆脱此警告消息?
谢谢
发布于 2012-10-21 20:10:33
或者获取您正在使用的Faces API实现的新版本(支持泛型的版本),或者将@SuppressWarnings("unchecked")放在函数开始之前(就在public或private之前)。
发布于 2012-10-21 20:16:45
如果JSF API强制使用未检查的强制转换,则添加注释以取消该警告:
@SuppressWarnings(value = "unchecked")类似于这里给出的答案:Java [unchecked] unchecked case warning
https://stackoverflow.com/questions/12997666
复制相似问题