A RetroSearch Logo

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

Search Query:

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

False-negative about try/finally block · Issue #4063 · pmd/pmd · GitHub

Affects PMD Version:

Rule: AvoidBranchingStatementAsLastInLoop

Description:

Code A: PMD report Avoidbranchingstatementaslastinloop error at line 11

while (true) {
  try {
    // nothing to do
  }
  catch (Throwable c) {
    throw c;
  }
  break; // violation here
}

Code B: transform the code,then the PMD doesn't report any error

while (true) {
  try {
    // nothing to do
  }
  catch (Throwable c) {
    throw c;
  }
  finally {
    break; // missing violation
  }
}

Running PMD through: CLI


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