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]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4