A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pmd/pmd/issues/370 below:

[java] GuardLogStatementJavaUtil not considering lambdas · Issue #370 · pmd/pmd · GitHub

Rule Set:
The rule is called pmd:GuardLogStatementJavaUtil in SonarQube

Description:
It is quite verbose to use guard clauses for logging statements which can be solved by wrapping it in a lambda expression (see below).

Code Sample demonstrating the issue:

LOGGER.info(() -> "Bla " + " bla");

@Override
public void info(Supplier<String> message) {
    if (logger.isInfoEnabled()) {
        logger.info(message.get());
    }
}

Running PMD through: [SonarQube]


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