如何消除"The expression of type List needs unchecked conversion to conform "警告?
How to eliminate "The expression of type List needs unchecked conversion to conform " warning?
警告是
类型安全:List类型的表达式需要未经检查的转换以符合Collection
我需要在某处进行类型转换吗?
public class ETLStepType {
public static final ArrayList<String> ETLStepTypes = (
new ArrayList<String> ((Arrays.asList(new String[] {"constant",
"append",
"insertupdate",
"tableinput",
"filterrows",
"dblookup",
"selectvalues"}))));
}
在 Intellij Idea 中收到“为调用可变参数方法创建冗余数组”警告,已通过删除 'new String []{ and }' 修复,因此请尝试
new ArrayList<String>(Arrays.asList("constant",
"append",
"insertupdate",
"tableinput",
"filterrows",
"dblookup",
"selectvalues"))
解决问题
警告是
类型安全:List类型的表达式需要未经检查的转换以符合Collection
我需要在某处进行类型转换吗?
public class ETLStepType {
public static final ArrayList<String> ETLStepTypes = (
new ArrayList<String> ((Arrays.asList(new String[] {"constant",
"append",
"insertupdate",
"tableinput",
"filterrows",
"dblookup",
"selectvalues"}))));
}
在 Intellij Idea 中收到“为调用可变参数方法创建冗余数组”警告,已通过删除 'new String []{ and }' 修复,因此请尝试
new ArrayList<String>(Arrays.asList("constant",
"append",
"insertupdate",
"tableinput",
"filterrows",
"dblookup",
"selectvalues"))
解决问题