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
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