gpt4 book ai didi

java - 来自 PMD 的 DD/DU 警告

转载 作者:行者123 更新时间:2023-11-29 05:49:43 25 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
What is the reason for these PMD rules?

为什么我会收到 DD/DU 警告?

这是我的代码:

// DD warning from PMD
public Object foo() {
Object result = null;
if (condition) {
// code block, no accec to result
result = newResult;
}
return result;
}
// DU warning from PMD
List<Object> data = new ArrayList<Object>(anotherList);
anotherList.remove(1);
// some other modification of anotherList
if (condition) {
// some code. no access to data
for (Object o : data) {
// loop for original content of the list
}
}

这里有什么问题吗?还是 PMD 错误?我可以忽略这些警告吗?

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com