Affects PMD Version:
Running against 6.19.0,6.20.0.
Rule:
AvoidLiteralsInIfCondition
Description:
Expression with constants sidesteps this rule. The rule is configured with allowed values: -1,0,1.
Code Sample demonstrating the issue:
package pmdtests;
public enum MulticastSender {
;
private static byte getTTL(String... args) {
try {
if (args.length > (1 + 1))
return (byte)Integer.parseInt(args[2]);
} catch (NumberFormatException e) {
// empty catch block
}
return (byte)1;
}
}
Running PMD through: [CLI | Ant | Maven | Gradle | Designer | Other]
Affects PMD Version:
Running against 6.19.0,6.20.0.
Rule:
AvoidLiteralsInIfCondition
Description:
Expression with constants sidesteps this rule. The rule is configured with allowed values: -1,0,1.
Code Sample demonstrating the issue:
Running PMD through: [CLI | Ant | Maven | Gradle | Designer | Other]