A RetroSearch Logo

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

Search Query:

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

[java] ControlStatementBraces is missing checkIfStmt property · Issue #1004 · pmd/pmd · GitHub

Affects PMD Version:
6.2.0

Rule:
category/java/codestyle.xml/ControlStatementBraces

Description:
ControlStatementBraces is supposed to replace IfStmtMustUseBraces and IfElseStmtMustUseBraces but it only has a checkIfElseStmt property, not a checkIfStmt property.

We currently exclude IfStmtsMustUseBraces in our configurations, but not IfElseStmtMustUseBraces. The rationale for this is to allow logging guards like the one in the example code below.

The only way to allow those with the ControlStatementBraces rule is by setting checkIfElseStmt to false. This disables more checks than with the previous rules.

Code Sample demonstrating the issue:

if(logger.isDebugEnabled()) logger.debug("{}", foo);

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