Possible Duplicate:
What is the reason for these PMD rules?
Why do I get DD/DU warnings?
Here's my code:
// 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
}
}
Is there something wrong here? Or is it a PMD bug? Can I ignore these warnings?