Skip to content

SoundCard JSON implementation and format fixes - #635

Merged
dbwiddis merged 2 commits into
oshi:masterfrom
dbwiddis:master
Sep 29, 2018
Merged

dbwiddis merged 2 commits into
oshi:masterfrom
dbwiddis:master

Conversation

@dbwiddis

Copy link
Copy Markdown
Member

No description provided.

@dbwiddis dbwiddis mentioned this pull request Sep 29, 2018
@codecov-io

codecov-io commented Sep 29, 2018 •

Copy link
Copy Markdown

Codecov Report

Merging #635 into master will decrease coverage by 1.61%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #635      +/-   ##
============================================
- Coverage     83.75%   82.14%   -1.62%     
  Complexity      197      197              
============================================
  Files            28       28              
  Lines          1428     1428              
  Branches        208      208              
============================================
- Hits           1196     1173      -23     
- Misses          111      133      +22     
- Partials        121      122       +1
Impacted Files Coverage Δ Complexity Δ
...hi-core/src/main/java/oshi/software/os/OSUser.java 0% <0%> (-85.72%) 0% <0%> (ø)
oshi-core/src/main/java/oshi/SystemInfo.java 27.27% <0%> (-11.37%) 0% <0%> (ø)
oshi-core/src/main/java/oshi/util/FileUtil.java 89.58% <0%> (-6.25%) 0% <0%> (ø)
...hi-core/src/main/java/oshi/hardware/NetworkIF.java 78.87% <0%> (-2.82%) 0% <0%> (ø)
...on/src/main/java/oshi/json/hardware/NetworkIF.java 72.41% <0%> (-2.3%) 30% <0%> (ø)
...-core/src/main/java/oshi/hardware/HWDiskStore.java 73.4% <0%> (-2.13%) 0% <0%> (ø)
.../src/main/java/oshi/json/hardware/HWDiskStore.java 78.44% <0%> (-1.73%) 38% <0%> (ø)
oshi-core/src/main/java/oshi/util/ParseUtil.java 95.26% <0%> (-0.6%) 0% <0%> (ø)

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 4364289...ca0cd44. Read the comment docs.

@dbwiddis
dbwiddis merged commit 1a5ff2a into oshi:master Sep 29, 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