我有以下代码失败并出现 IllegalArgumentException
public EnumSet<test> getData(){ // Line 1
return EnumSet.copyOf(get(test))) // Line 2
}
private Collection<Test> get(Test[] test){ //Line 1
test= test==null ? new Test[0] : test; // line 2
return Array.asList(test) //Line 3
}
如果 test 为 null ,则get函数的第 2 行创建空的 Test 数组和EnumSet.copyOf(get(test)) throws IllegalArgumentException
我不明白为什么会抛出这个异常?
慕少森
相关分类