A RetroSearch Logo

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

Search Query:

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

[apex] EmptyStatementBlock complains about missing rather than empty block · Issue #760 · pmd/pmd · GitHub

Rule Set:
... /pmd/doc/pmd_rules_apex_errorprone.html#emptystatementblock

Description:
The rule files when an if statement doesn't have an else block. I would expect it only fires if there is an else block without content

Code Sample demonstrating the issue:
This should work, but gets flagged

if (someVariable.equals(someValue) {
   System.debug(someValue);
}

This gets flagged as designed:

if (someVariable.equals(someValue) {
   System.debug(someValue);
} else {
   // NoAction
}

Running PMD through: [CLI | Ant | Maven | Gradle | Designer | Other]
CLI triggered from Button in Eclipse Version 6.0.0-Snapshot downloaded 24Nov2017


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