Skip to content

Fix Error Prone ERROR-severity findings, make error-prone job blocking - #3595

Merged
dbwiddis merged 2 commits into
oshi:masterfrom
dbwiddis:fix-error-prone-errors
Aug 12, 2026
Merged

dbwiddis merged 2 commits into
oshi:masterfrom
dbwiddis:fix-error-prone-errors

Conversation

@dbwiddis

@dbwiddis dbwiddis commented Aug 12, 2026 •

Copy link
Copy Markdown
Member

Summary

Follow-on to #3594 (Error Prone groundwork). Fixes the small set of real ERROR-severity findings that tool surfaced, then removes continue-on-error: true from the error-prone CI job — from here on, ERROR-severity findings block the PR (javac's own default behavior for a compile error), while WARNING-severity findings still don't, and remain queued for the larger ongoing triage.

  • oshi-core-ffm — IPHlpAPIUtilFFM.getDnsServers(): the DNS-list loop's while guard compared a MemorySegment by reference against MemorySegment.NULL. A .asSlice()/.get()/.reinterpret() result is never the literal NULL singleton object, even at address 0, so the condition was always true and the loop's real termination relied entirely on an inner .address() == 0 break already present a few lines down. No observable behavior change (that inner break already worked), but this removes the latent risk of an infinite loop if it's ever touched. Fixed to compare .address() != 0, matching the existing check already used later in the same loop. Checked the JNA twin (WindowsNetworkParamsJNA) — no equivalent bug there, since JNA's structure auto-mapping genuinely returns Java null for a null pointer field, unlike FFM's MemorySegment value type.
  • oshi-demo — suppresses BanJNDI in the JMX Client demo: it connects to OshiJMXServer, this demo's own companion server on a hardcoded localhost:8888, not attacker-controlled input. JMX-over-RMI inherently resolves through JNDI; there's no way to demonstrate this connectivity without it.
  • oshi-benchmark — MonitoringFootprintReport: three call sites intentionally discard a Function.apply() return value purely for its side effect (realizing a lazily-computed subsystem graph, or JIT/class-loading warm-up). Made the discard explicit with Java 21's unnamed-variable syntax (var _ = ...), matching Error Prone's own suggested fix text.
  • CI: drop continue-on-error: true on the error-prone job now that the ERROR backlog is clear.

No CHANGELOG entry — none of these are observable user-visible behavior changes (the FFM fix hardens a dead-condition risk without changing output; the rest is demo/benchmark code and CI config).

Test plan

  • ./mvnw clean install -DskipTests -Perror-prone (whole reactor) — BUILD SUCCESS, 0 ERROR-severity findings (209 WARNING findings remain, queued for follow-on triage)
  • ./mvnw clean spotless:apply sortpom:sort checkstyle:check install forbiddenapis:check javadoc:javadoc — full gate passes, no reformatting needed
  • ./mvnw test -pl oshi-core-ffm -am — passes
  • Not verified on real Windows hardware with 2+ configured DNS servers (the scenario the loop is about) — no Windows machine available; verified the fix is behavior-preserving by tracing the loop logic instead (see commit message)

Summary by CodeRabbit

  • Bug Fixes

    • Improved Windows DNS server discovery so all configured entries can be processed correctly.
    • Improved benchmark setup and warmup reliability without changing measured behavior.
  • Developer Experience

    • Clarified the JMX demo’s local connection requirements and security-warning handling.
  • Quality

    • CI now checks generated code and blocks pull requests for critical static-analysis findings, while non-critical warnings remain informational.

…king

- oshi-core-ffm: fix a latent bug in IPHlpAPIUtilFFM.getDnsServers() where
  the DNS-list loop's guard compared a MemorySegment by reference against
  MemorySegment.NULL, which a slice/reinterpret never actually equals even
  at address 0 - the condition was always true and the loop relied entirely
  on an inner break to terminate. No observable behavior change (the inner
  break already terminated correctly), but removes the risk of an infinite
  loop if that break is ever touched. Compare by .address() instead,
  matching the existing check already used later in the same loop.
- oshi-demo: suppress BanJNDI in the JMX Client demo - it connects to
  OshiJMXServer, its own companion demo server on a hardcoded localhost
  address, not attacker-controlled input; JMX-over-RMI inherently resolves
  through JNDI.
- oshi-benchmark: explicitly discard intentionally-unused return values in
  MonitoringFootprintReport (warm-up and graph-realization calls) using
  Java 21's unnamed variable syntax, matching Error Prone's own suggested
  fix.
- Remove continue-on-error from the error-prone CI job now that the
  ERROR-severity backlog is clear; WARNING-severity findings still don't
  block, by javac's own default behavior.
@coderabbitai

coderabbitai Bot commented Aug 12, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1f9f6e6e-62c5-4096-bbdb-9c4ef9ba8918

📥 Commits

Reviewing files that changed from the base of the PR and between e8df62b and 45bdce5.

📒 Files selected for processing (2)
  • oshi-benchmark/pom.xml
  • pom.xml
📜 Recent review details
⏰ Context from checks skipped due to timeout. (13)
  • GitHub Check: Test JDK 25, OpenIndiana (+ JNA==FFM)
  • GitHub Check: Test JDK 25, FreeBSD (+ JNA==FFM)
  • GitHub Check: Test JDK 25, OpenBSD (+ JNA==FFM)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Test JDK 26, ubuntu-latest
  • GitHub Check: Lint (ForbiddenAPIs, Javadoc, SLF4J)
  • GitHub Check: Test JDK 25, windows-latest (+ JNA==FFM)
  • GitHub Check: Lint (Spotless, Checkstyle)
  • GitHub Check: Test JDK 21, ubuntu-latest
  • GitHub Check: Test JDK 25, ubuntu-latest (+ JNA==FFM)
  • GitHub Check: Analyze (java)
  • GitHub Check: Test JDK 25, macos-latest (+ JNA==FFM)
  • GitHub Check: Error Prone
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{java,xml}

📄 CodeRabbit inference engine (AGENTS.md)

Do not add line-range Checkstyle suppressions. Prefer declaration-level @SuppressWarnings, scoped Checkstyle comments, or file/package suppressions without line ranges; use Sonar @SuppressWarnings("java:Sxxxx") where possible and keep statement-level suppression comments short and justified.

Files:

  • oshi-benchmark/pom.xml
  • pom.xml
**/pom.xml

📄 CodeRabbit inference engine (AGENTS.md)

Do not add dependencies without discussion or manually bump dependency versions; Renovate manages dependency updates.

Files:

  • oshi-benchmark/pom.xml
  • pom.xml
🧠 Learnings (6)
📓 Common learnings
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3432
File: oshi-common/src/main/java/oshi/util/ExceptionUtil.java:26-56
Timestamp: 2026-07-06T19:26:05.716Z
Learning: In oshi/oshi, `oshi-common/src/main/java/oshi/util/ExceptionUtil.java`'s private `logAtLevel(Logger, Level, String, Throwable)` helper (and the similar pattern in `oshi-core-ffm/src/main/java/oshi/ffm/ForeignFunctions.java` and `oshi-core/src/main/java/oshi/util/platform/windows/PerfDataUtil.java`) intentionally calls SLF4J 1.x-compatible methods like `log.error(msg, t.getMessage(), t)` with a single `{}` placeholder in `msg` and the `Throwable t` as the trailing argument. This is not a bug: SLF4J's implicit-cause handling (since 1.6.0) detects a trailing `Throwable` argument and attaches it as the log event's cause with full stack trace, equivalent to the SLF4J 2.x-only `.atLevel(level).setCause(t).log(...)` fluent API that this PR deliberately avoids for SLF4J 1.x runtime compatibility. Do not flag these calls as losing the throwable cause/stack trace.
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3410
File: oshi-common/src/main/java/oshi/software/common/os/linux/LinuxFileSystem.java:293-297
Timestamp: 2026-06-26T09:54:54.556Z
Learning: In `oshi-common/src/main/java/oshi/software/common/os/linux/LinuxFileSystem.java`, for the NFS reachability pre-probe added in PR `#3410`, a fixed thread-pool cap of 16 is considered a sane limit and does not warrant a stronger refactor solely to guarantee a universal 2-second bound. Future reviews should focus on keeping the Javadoc/comments aligned with the actual bounded-parallel behavior rather than insisting on an unbounded-concurrency implementation.
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3530
File: oshi-common/src/main/java/oshi/util/ExceptionUtil.java:43-48
Timestamp: 2026-07-26T23:06:49.011Z
Learning: In the oshi/oshi repository, `oshi.util.ExceptionUtil` is intentionally outside the binary-compatibility surface: japicmp enforces compatibility only for types annotated `oshi.annotation.PublicApi`, and `ExceptionUtil` is not annotated. Therefore, do not flag in-place public method descriptor changes in `ExceptionUtil` merely because precompiled third-party callers could receive `NoSuchMethodError`; source compatibility and lockstep module releases are the applicable expectations. If this guarantee is desired later, annotating `ExceptionUtil` with `PublicApi` is the policy mechanism rather than adding numerous forwarding overloads.
📚 Learning: 2026-07-26T23:06:49.011Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3530
File: oshi-common/src/main/java/oshi/util/ExceptionUtil.java:43-48
Timestamp: 2026-07-26T23:06:49.011Z
Learning: In the oshi/oshi repository, `oshi.util.ExceptionUtil` is intentionally outside the binary-compatibility surface: japicmp enforces compatibility only for types annotated `oshi.annotation.PublicApi`, and `ExceptionUtil` is not annotated. Therefore, do not flag in-place public method descriptor changes in `ExceptionUtil` merely because precompiled third-party callers could receive `NoSuchMethodError`; source compatibility and lockstep module releases are the applicable expectations. If this guarantee is desired later, annotating `ExceptionUtil` with `PublicApi` is the policy mechanism rather than adding numerous forwarding overloads.

Applied to files:

  • oshi-benchmark/pom.xml
  • pom.xml
📚 Learning: 2026-08-05T23:44:09.936Z
Learnt from: CR
Repo: oshi/oshi PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-08-05T23:44:09.936Z
Learning: Applies to oshi-core/src/main/java/**/*.java : Use Java 8-compatible language features in `oshi-core`; do not use `var`, `List.of`, records, switch expressions, text blocks, or `Stream.toList()`.

Applied to files:

  • oshi-benchmark/pom.xml
  • pom.xml
📚 Learning: 2026-08-05T23:44:09.936Z
Learnt from: CR
Repo: oshi/oshi PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-08-05T23:44:09.936Z
Learning: Applies to oshi-common/src/main/java/**/*.java : Do not import `com.sun.jna`, `java.lang.foreign`, or use `System.load`/`System.loadLibrary` in `oshi-common`.

Applied to files:

  • oshi-benchmark/pom.xml
📚 Learning: 2026-08-05T23:44:09.936Z
Learnt from: CR
Repo: oshi/oshi PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-08-05T23:44:09.936Z
Learning: Applies to oshi-common/src/main/java/**/*.java : Keep `oshi-common` pure Java 8: do not reference JNA, FFM, `System.load`, or `System.loadLibrary`; shared parsing, conversion, filtering, caching, and sentinel/range logic belongs here.

Applied to files:

  • oshi-benchmark/pom.xml
📚 Learning: 2026-08-05T23:44:09.936Z
Learnt from: CR
Repo: oshi/oshi PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-08-05T23:44:09.936Z
Learning: Applies to **/*.{java,md} : When changing a JNA or FFM implementation, apply the equivalent behavior change to its counterpart, or document why the implementations intentionally differ; prefer hoisting non-native-specific logic into `oshi-common`.

Applied to files:

  • oshi-benchmark/pom.xml
  • pom.xml
🔇 Additional comments (2)
pom.xml (1)

1208-1216: LGTM!

Also applies to: 1228-1228

oshi-benchmark/pom.xml (1)

126-126: 🗄️ Data Integrity & Integration

No changes needed. The effective POM excludes Error Prone flags and error_prone_core while retaining jmh-generator-annprocess and jmh-core.


📝 Walkthrough

Walkthrough

The pull request makes Error Prone failures block CI, adjusts benchmark compiler settings, assigns discarded benchmark results locally, fixes native DNS pointer null checks, and documents the JMX demo’s localhost JNDI usage.

Changes

Build enforcement and warning fixes

Layer / File(s) Summary
Make Error Prone findings enforceable
.github/workflows/pr.yaml, pom.xml
ERROR-severity findings now block the build and CI job. WARNING-severity findings remain non-blocking. Generated sources are included in Error Prone checks.
Adjust benchmark compiler settings
oshi-benchmark/pom.xml
The benchmark module adds an Error Prone profile and removes annotation processor child-argument merging.
Assign discarded benchmark results
oshi-benchmark/src/main/java/oshi/benchmark/MonitoringFootprintReport.java
Subsystem realization, metric reads, and warmup reads assign returned values to local variables while retaining their side effects.
Check the native DNS pointer
oshi-core-ffm/src/main/java/oshi/ffm/util/platform/windows/IPHlpAPIUtilFFM.java
getDnsServers checks dnsServerList.address() for a null native pointer.
Document approved JNDI usage
oshi-demo/src/main/java/oshi/demo/jmx/demo/Client.java
The demo suppresses BanJNDI and documents its hardcoded localhost JMX connection.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • oshi/oshi#3127: This change refines Error Prone and compiler settings in oshi-benchmark/pom.xml.
  • oshi/oshi#3594: This change updates the Error Prone Maven profile, CI job, and benchmark compiler configuration.

Suggested reviewers: wolfs

Poem

A rabbit checks the build today,
Errors block; warnings wait their way.
Metrics rest in locals neat,
DNS pointers hop complete.
JMX calls localhost bright—
Clean warnings fade from sight.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the two main changes: fixing Error Prone errors and making the CI job blocking.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/pr.yaml:
- Around line 118-120: Update the Error Prone profile comment in pom.xml to
reflect that the profile is currently blocking for ERROR-severity findings while
WARNING-severity findings remain non-blocking; remove the stale “non-blocking
for now” wording, without changing the workflow or profile behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 51d672cd-78f0-4f4c-a329-0b9fa3ddf709

📥 Commits

Reviewing files that changed from the base of the PR and between 7e430d8 and e8df62b.

📒 Files selected for processing (4)
  • .github/workflows/pr.yaml
  • oshi-benchmark/src/main/java/oshi/benchmark/MonitoringFootprintReport.java
  • oshi-core-ffm/src/main/java/oshi/ffm/util/platform/windows/IPHlpAPIUtilFFM.java
  • oshi-demo/src/main/java/oshi/demo/jmx/demo/Client.java
📜 Review details
⏰ Context from checks skipped due to timeout. (10)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Test JDK 26, ubuntu-latest
  • GitHub Check: Lint (Spotless, Checkstyle)
  • GitHub Check: Test JDK 25, ubuntu-latest (+ JNA==FFM)
  • GitHub Check: Test JDK 25, windows-latest (+ JNA==FFM)
  • GitHub Check: Error Prone
  • GitHub Check: Test JDK 21, ubuntu-latest
  • GitHub Check: Test JDK 25, macos-latest (+ JNA==FFM)
  • GitHub Check: Analyze (java)
  • GitHub Check: Lint (ForbiddenAPIs, Javadoc, SLF4J)
🧰 Additional context used
📓 Path-based instructions (5)
**/*.java

📄 CodeRabbit inference engine (AGENTS.md)

**/*.java: Do not use banned numeric parsing APIs such as Integer.parseInt, Long.parseLong, Double.parseDouble, or Integer.decode; use the appropriate oshi.util.ParseUtil method.
New classes should declare an appropriate concurrency annotation such as @ThreadSafe, @Immutable, @NotThreadSafe, or @GuardedBy, matching the modeled class where applicable.

Files:

  • oshi-core-ffm/src/main/java/oshi/ffm/util/platform/windows/IPHlpAPIUtilFFM.java
  • oshi-demo/src/main/java/oshi/demo/jmx/demo/Client.java
  • oshi-benchmark/src/main/java/oshi/benchmark/MonitoringFootprintReport.java
oshi-core-ffm/src/main/java/**/*.java

📄 CodeRabbit inference engine (AGENTS.md)

Do not reference com.sun.jna from oshi-core-ffm.

Files:

  • oshi-core-ffm/src/main/java/oshi/ffm/util/platform/windows/IPHlpAPIUtilFFM.java
**/*.{java,md}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{java,md}: When changing a JNA or FFM implementation, apply the equivalent behavior change to its counterpart, or document why the implementations intentionally differ; prefer hoisting non-native-specific logic into oshi-common.
Use current-year-only copyright headers for new files (Copyright 2026 The OSHI Project Contributors and SPDX-License-Identifier: MIT); do not commit generated output, target/, or IDE files.

Files:

  • oshi-core-ffm/src/main/java/oshi/ffm/util/platform/windows/IPHlpAPIUtilFFM.java
  • oshi-demo/src/main/java/oshi/demo/jmx/demo/Client.java
  • oshi-benchmark/src/main/java/oshi/benchmark/MonitoringFootprintReport.java
**/src/main/java/**/*.java

📄 CodeRabbit inference engine (AGENTS.md)

**/src/main/java/**/*.java: Every public and protected type and method needs valid Javadoc; use imported simple class names rather than fully qualified names, including in {@link} tags.
Memoize constant or expensive, slowly changing native-call results using oshi.util.Memoizer, following the surrounding class and defaultExpiration() conventions.
Prefer native calls for system information; on Linux prefer FileUtil for /proc and /sys, while ExecutingCommand is acceptable on other platforms when native APIs do not expose the data.
Verify native struct offsets, field widths, and sysctl/ioctl constants against the target OS and architecture; do not infer them from another operating system.

Files:

  • oshi-core-ffm/src/main/java/oshi/ffm/util/platform/windows/IPHlpAPIUtilFFM.java
  • oshi-demo/src/main/java/oshi/demo/jmx/demo/Client.java
  • oshi-benchmark/src/main/java/oshi/benchmark/MonitoringFootprintReport.java
**/*.{java,xml}

📄 CodeRabbit inference engine (AGENTS.md)

Do not add line-range Checkstyle suppressions. Prefer declaration-level @SuppressWarnings, scoped Checkstyle comments, or file/package suppressions without line ranges; use Sonar @SuppressWarnings("java:Sxxxx") where possible and keep statement-level suppression comments short and justified.

Files:

  • oshi-core-ffm/src/main/java/oshi/ffm/util/platform/windows/IPHlpAPIUtilFFM.java
  • oshi-demo/src/main/java/oshi/demo/jmx/demo/Client.java
  • oshi-benchmark/src/main/java/oshi/benchmark/MonitoringFootprintReport.java
🧠 Learnings (9)
📓 Common learnings
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3432
File: oshi-common/src/main/java/oshi/util/ExceptionUtil.java:26-56
Timestamp: 2026-07-06T19:26:05.716Z
Learning: In oshi/oshi, `oshi-common/src/main/java/oshi/util/ExceptionUtil.java`'s private `logAtLevel(Logger, Level, String, Throwable)` helper (and the similar pattern in `oshi-core-ffm/src/main/java/oshi/ffm/ForeignFunctions.java` and `oshi-core/src/main/java/oshi/util/platform/windows/PerfDataUtil.java`) intentionally calls SLF4J 1.x-compatible methods like `log.error(msg, t.getMessage(), t)` with a single `{}` placeholder in `msg` and the `Throwable t` as the trailing argument. This is not a bug: SLF4J's implicit-cause handling (since 1.6.0) detects a trailing `Throwable` argument and attaches it as the log event's cause with full stack trace, equivalent to the SLF4J 2.x-only `.atLevel(level).setCause(t).log(...)` fluent API that this PR deliberately avoids for SLF4J 1.x runtime compatibility. Do not flag these calls as losing the throwable cause/stack trace.
📚 Learning: 2026-07-06T19:25:59.225Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3432
File: oshi-common/src/main/java/oshi/util/ExceptionUtil.java:26-56
Timestamp: 2026-07-06T19:25:59.225Z
Learning: In this repo’s SLF4J 1.x-compatible logging code, do not flag cases where a logger call uses SLF4J 1.6+ implicit-cause handling—e.g., `log.error("...{}", value, t)` (or similar with a single `{}` placeholder) where `t` is passed as the final/trailing argument. SLF4J will attach `t` as the log event’s cause with the full stack trace; this is equivalent to SLF4J 2.x’s fluent `atLevel(...).setCause(t).log(...)` and is intentionally used to preserve SLF4J 1.x runtime compatibility.

Applied to files:

  • oshi-core-ffm/src/main/java/oshi/ffm/util/platform/windows/IPHlpAPIUtilFFM.java
  • oshi-demo/src/main/java/oshi/demo/jmx/demo/Client.java
  • oshi-benchmark/src/main/java/oshi/benchmark/MonitoringFootprintReport.java
📚 Learning: 2026-07-30T00:35:22.638Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3547
File: oshi-common/src/main/java/oshi/hardware/common/platform/unix/BsdFirmware.java:82-82
Timestamp: 2026-07-30T00:35:22.638Z
Learning: In OSHI, treat changes as “API-breaking” only when they affect classes (or relevant API surface) annotated with `PublicAPI`. Public classes/members that are not annotated with `PublicAPI` should be reviewed as internal implementation details, even if they are public (e.g., classes like `oshi.hardware.common.platform.unix.BsdFirmware`). Also, respect intentional visibility decisions used for tests—e.g., methods like `BsdFirmware.parseDmesg(List<String>)` may be intentionally package-private to support tests within the same package; avoid widening visibility or altering signatures unless the related `PublicAPI` contract requires it.

Applied to files:

  • oshi-core-ffm/src/main/java/oshi/ffm/util/platform/windows/IPHlpAPIUtilFFM.java
  • oshi-demo/src/main/java/oshi/demo/jmx/demo/Client.java
  • oshi-benchmark/src/main/java/oshi/benchmark/MonitoringFootprintReport.java
📚 Learning: 2026-08-02T23:56:23.866Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3565
File: oshi-core-ffm/src/main/java/oshi/ffm/platform/unix/PosixLibcFunctions.java:51-56
Timestamp: 2026-08-02T23:56:23.866Z
Learning: For Java FFM bindings in the oshi-core-ffm module, assume a 64-bit JVM and 64-bit operating system. Do not flag 32-bit native ABI or memory-layout compatibility concerns, consistent with the project's JDK 25 support policy, unless that policy changes.

Applied to files:

  • oshi-core-ffm/src/main/java/oshi/ffm/util/platform/windows/IPHlpAPIUtilFFM.java
📚 Learning: 2026-08-03T00:46:14.953Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3566
File: oshi-common/src/main/java/oshi/software/common/os/unix/openbsd/OpenBsdNetworkParams.java:18-22
Timestamp: 2026-08-03T00:46:14.953Z
Learning: In the OSHI Java codebase, do not require duplicate Javadoc on public methods annotated with Override when the inherited Javadoc from the parent declaration adequately documents the method. The general public-member Javadoc requirement should not flag these overrides solely because they lack redundant documentation.

Applied to files:

  • oshi-core-ffm/src/main/java/oshi/ffm/util/platform/windows/IPHlpAPIUtilFFM.java
  • oshi-demo/src/main/java/oshi/demo/jmx/demo/Client.java
  • oshi-benchmark/src/main/java/oshi/benchmark/MonitoringFootprintReport.java
📚 Learning: 2026-05-31T05:53:04.246Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3311
File: .github/workflows/site.yaml:21-21
Timestamp: 2026-05-31T05:53:04.246Z
Learning: When a GitHub Actions workflow verifies that a pinned commit SHA matches a version tag, dereference annotated tags before comparing to a commit SHA. The API `GET /repos/{owner}/{repo}/git/refs/tags/{tag}` returns the tag *object* SHA for annotated tags (not the underlying commit SHA), so comparing it directly to a commit SHA will cause false mismatches. Instead: (1) fetch the tag object SHA via `GET /repos/{owner}/{repo}/git/refs/tags/{tag}`; (2) resolve that tag object to the underlying commit by calling `GET /repos/{owner}/{repo}/git/tags/{tag_object_sha}`; (3) compare the pinned commit SHA to the resolved commit at `.object.sha`.

Applied to files:

  • .github/workflows/pr.yaml
📚 Learning: 2026-07-21T20:38:16.728Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3509
File: oshi-demo/pom.xml:72-80
Timestamp: 2026-07-21T20:38:16.728Z
Learning: For the OSHI Maven/Jacoco CI workflows, coverage aggregation/report upload steps should run only when the test job succeeds (e.g., guard with conditions like `if: success()`). Do not add logic to generate/upload or preserve aggregate coverage artifacts after test failures, and avoid fragile/over-engineered handling of exit status unless there is an explicit separate project requirement.

Applied to files:

  • .github/workflows/pr.yaml
📚 Learning: 2026-05-04T04:58:36.843Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3227
File: oshi-metrics/src/main/java/oshi/metrics/OshiMetrics.java:35-48
Timestamp: 2026-05-04T04:58:36.843Z
Learning: In `oshi-metrics/src/main/java/oshi/metrics/OshiMetrics.java`, the `private final OperatingSystem os` field is intentionally stored in the constructor even though it is not yet used. It is a placeholder for future OS-level metrics (e.g., process metrics) that will be added incrementally. Do not flag it as dead code.

Applied to files:

  • oshi-benchmark/src/main/java/oshi/benchmark/MonitoringFootprintReport.java
📚 Learning: 2026-04-18T03:18:06.205Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3170
File: oshi-benchmark/src/test/java/oshi/comparison/PerfmonComparisonTest.java:177-183
Timestamp: 2026-04-18T03:18:06.205Z
Learning: In `oshi-benchmark/src/test/java/oshi/comparison/PerfmonComparisonTest.java`, GPU engine PDH instance counts (from `GpuInformationJNA.queryGpuEngineCounters()` / `GpuInformationFFM.queryGpuEngineCounters()`) are highly volatile — counts can differ dramatically (e.g., 53 vs 40) even between queries taken milliseconds apart. Do not assert instance count equality or exact instance list matching between JNA and FFM results. The only reliable assertion is that both are empty or both are non-empty (`assertThat(ffm.getA().isEmpty()).isEqualTo(jna.getA().isEmpty())`).

Applied to files:

  • oshi-benchmark/src/main/java/oshi/benchmark/MonitoringFootprintReport.java
🔇 Additional comments (4)
.github/workflows/pr.yaml (1)

121-124: LGTM!

Also applies to: 138-139

oshi-benchmark/src/main/java/oshi/benchmark/MonitoringFootprintReport.java (1)

74-74: 🎯 Functional Correctness

Remove the preview-feature warning.

oshi-benchmark compiles with release 25 and runs on JDK 25. var _ is not a preview feature at this release.

			> Likely an incorrect or invalid review comment.
oshi-demo/src/main/java/oshi/demo/jmx/demo/Client.java (1)

48-54: LGTM!

oshi-core-ffm/src/main/java/oshi/ffm/util/platform/windows/IPHlpAPIUtilFFM.java (1)

97-97: LGTM!

Comment thread .github/workflows/pr.yaml Resolved
@codecov

codecov Bot commented Aug 12, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 79.86%. Comparing base (7e430d8) to head (45bdce5).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...shi/ffm/util/platform/windows/IPHlpAPIUtilFFM.java 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3595      +/-   ##
============================================
- Coverage     79.89%   79.86%   -0.03%     
- Complexity     3873     4236     +363     
============================================
  Files           710      710              
  Lines         24242    24242              
  Branches       4052     4052              
============================================
- Hits          19369    19362       -7     
- Misses         2715     2722       +7     
  Partials       2158     2158              
Flag Coverage Δ
freebsd 33.50% <0.00%> (-0.01%) ⬇️
linux 37.60% <0.00%> (+0.01%) ⬆️
macos 38.42% <0.00%> (-0.05%) ⬇️
openbsd 32.66% <0.00%> (-0.01%) ⬇️
solaris 34.16% <0.00%> (-0.01%) ⬇️
windows 45.37% <0.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

The Error Prone CI job failed with "invalid flag: -Xep:InlineMeSuggester:OFF":
oshi-benchmark's maven-compiler-plugin config forks a separate javac process
for its JDK toolchain, and a forked invocation doesn't preserve a multi-option
-Xplugin value as one command-line token the way in-process compilation does
elsewhere in the reactor - it gets split apart, and Error Prone's own
"-Xep:Check:OFF" flags aren't independently recognized by javac.

Rather than plumb the -J-prefixed JVM flags a forked compile would need (since
.mvn/jvm.config's JPMS opens don't propagate to a forked subprocess), exclude
oshi-benchmark from the error-prone profile entirely via a matching-id profile
override restoring the plain compilerArgs baseline: it's JMH-only, excluded
from the release, and will never carry jSpecify annotations, so it isn't worth
the extra plumbing. Simplified the root profile's compilerArgs accordingly -
the generated-sources exclusion was only needed for oshi-benchmark's
JMH-generated sources, the only annotation-processor-generated code in the
reactor.

Also updates the error-prone profile's comment, stale since ERROR-severity
findings became blocking earlier in this PR.
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.

1 participant