A RetroSearch Logo

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

Search Query:

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

[java] UnusedLocalVariable false positive when variable is read as side effect of an assignment · Issue #5061 · pmd/pmd · GitHub

Affects PMD Version: 7.2

Rule:

UnusedLocalVariable

Description:

A variable used in a read loop to check how many bytes are getting read, in a situation where it's both updated, but as a side effect of the assignment, also read.

Code Sample demonstrating the issue:

      int read = 0;
      while ((read += channel.read(buffer)) < length) {
      }

Expected outcome:

PMD should not report the variable as unused.

Running PMD through: Maven


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