-
Affects PMD Version: Rule: Description: Following output running rule against code below the first time: pmd: BUILD SUCCESSFUL No errors reported against this rule. Why is this warning displayed? 'method' is not a keyword or reserved word. Code Sample demonstrating the issue:** package javapuzzles;
public enum Meno {
;
public static void main(String... args) {
method();
}
public static void method(int... a) {
System.out.println("1");
}
@SuppressWarnings("PMD.AvoidUsingShortType")
public static void method(short... b) {
System.out.println("2");
}
} Running PMD through: [CLI | Ant | Maven | Gradle | Designer | Other] |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi, as a user you don't need to care about that warning. The rule is not telling you that the method is badly named or anything. It reports this warning when hitting an implementation limitation, or when the |
Beta Was this translation helpful? Give feedback.
-
The warning ought not to be visible to the user; its presence seems to suggest that there is something wrong with the method name. It can be ignored only so long before the user renames the method simply to avoid seeing the warning. I'm fine with logging it at a finer level as long it does not make this not-so-subliminal suggestion to the user to change his ways. |
Beta Was this translation helpful? Give feedback.
Hi, as a user you don't need to care about that warning. The rule is not telling you that the method is badly named or anything. It reports this warning when hitting an implementation limitation, or when the
class
file on the classpath for the current file is out of sync with the source. I think, the warning should probably be logged with a finer log level in the future, and other mechanisms should be used to take care of reporting invalid classpath configuration.