【发布时间】:2014-06-21 16:06:08
【问题描述】:
我已推荐:Security - Array is stored directly。
我的代码是
public IndexBlockAdapter(String[] itemStr) {
if(itemStr == null) {
this.itemStr = new String[0];
} else {
this.itemStr = Arrays.copyOf(itemStr, itemStr.length);
}
}
但 Sonar 仍然拿起它并抱怨“数组是直接存储的”,尽管制作了一个副本。我很困惑。
感谢任何帮助!
【问题讨论】: