Skip to content

Catch exception when english counters missing - #636

Merged
dbwiddis merged 1 commit into
oshi:masterfrom
dbwiddis:master
Sep 30, 2018
Merged

dbwiddis merged 1 commit into
oshi:masterfrom
dbwiddis:master

Conversation

@dbwiddis

Copy link
Copy Markdown
Member

Fixes #633

@codecov-io

codecov-io commented Sep 30, 2018 •

Copy link
Copy Markdown

Codecov Report

Merging #636 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #636   +/-   ##
=========================================
  Coverage     83.75%   83.75%           
  Complexity      197      197           
=========================================
  Files            28       28           
  Lines          1428     1428           
  Branches        208      208           
=========================================
  Hits           1196     1196           
  Misses          111      111           
  Partials        121      121

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1a5ff2a...0f77f32. Read the comment docs.

@dbwiddis
dbwiddis merged commit 6738257 into oshi:master Sep 30, 2018
dbwiddis added a commit that referenced this pull request Aug 5, 2026
CodeQL java/constant-comparison, findings #635 and #636: the
attempt <= MAX_BUFFER_RETRIES term in the for guard is always true. Every
path out of the loop body either breaks or returns except the retry
continue, and that continue requires attempt < MAX_BUFFER_RETRIES, so
after the increment the guard can never fail.

Remove the redundant term rather than the inner check. Doing it the other
way round -- deleting the inner test on the grounds that the guard already
bounds the loop -- would reintroduce the defect fixed in #3582: on the
final attempt the code would continue, the guard would end the loop, and
the empty return would discard a buffer that was read successfully. A
comment at each site records that, since a bounded loop whose guard shows
no bound invites exactly that tidy-up.

Behavior is unchanged: an always-true conjunct is removed, and the loop is
still bounded by the retry check.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants