Affects PMD Version:
7.0.0-rc4
Rule:
GuardLogStatement: Logger calls should be surrounded by log level guards.
Description:
if (handler.isPresent()) {
handlerMap.put(field, handler.get());
} else {
logger.error("Unsupported field: '{}.{}'", type.getId(), field.getName());
}
}
other example:
if (result == null) {
logger.warn("Unknown enum value: '{}' for enum {}", data.getAsString(), enumType.getSimpleName());
}
Expected outcome:
PMD reports a violation at line "logger.error", the example in the documentation says: no guard necessary if parameters are there; getters are parameters.
Running PMD through: Gradle
Affects PMD Version:
7.0.0-rc4
Rule:
GuardLogStatement: Logger calls should be surrounded by log level guards.
Description:
other example:
Expected outcome:
PMD reports a violation at line "logger.error", the example in the documentation says: no guard necessary if parameters are there; getters are parameters.
Running PMD through: Gradle