I would like to confirm if this is a bug on PMD? How do I file a ticket if it is.
public static void main(final String[] args) {
for (final String string : args) {
string.getBytes(); //UR Anomaly
}
for (int i = 0; i < args.length; i++) {
args[i].getBytes();
}
}
Lines 1-3 are being flagged as UR anomaly, while rewriting it to iterate with a local variable is fine.
Would like to eliminate as much PMD violations, but it is inconvenient to have to resort to old loop construct as a workaround.
While controversial, I do not wish to disable this rule since I find DD, and DU anomaly flagging as useful.