Affects PMD Version:
Rule:
UnusedPrivateField
Description:
False positive when instance variable is an array (or multidimensional array) with the same name as the class. While the code below doesn't follow standard Java naming conventions, it does use the field so UnusedPrivateField is irrelevant.
Code Sample demonstrating the issue:
public class Board {
private int[] Board;
public Board(int[] b) {
for (int i = 0; i < b.length; i++)
Board[i] = b[i];
}
public int size() {
return Board.length;
}
}
Running PMD through: CLI
Affects PMD Version:
Rule:
UnusedPrivateFieldDescription:
False positive when instance variable is an array (or multidimensional array) with the same name as the class. While the code below doesn't follow standard Java naming conventions, it does use the field so
UnusedPrivateFieldis irrelevant.Code Sample demonstrating the issue:
Running PMD through: CLI