Skip to content

Triage Error Prone ReferenceEquality and numeric boxing/narrowing warnings - #3601

Merged
dbwiddis merged 1 commit into
oshi:masterfrom
dbwiddis:triage-numeric-refequality-warnings
Aug 13, 2026
Merged

dbwiddis merged 1 commit into
oshi:masterfrom
dbwiddis:triage-numeric-refequality-warnings

Conversation

@dbwiddis

@dbwiddis dbwiddis commented Aug 13, 2026 •

Copy link
Copy Markdown
Member

Summary

Per-category breakdown:

  • ReferenceEquality (4): all intentional; verified and suppressed with justification. Two are test assertions checking whether a memoized supplier returned the same cached Set instance. One is W32APITypeMapper.DEFAULT == W32APITypeMapper.UNICODE in WindowsPowerSourceJNA — confirmed against JNA's own source that DEFAULT is a direct reference to one of the UNICODE/ASCII singleton constants, so == is exactly JNA's documented idiom. One is a Swing Component identity check in the demo GUI (contentPane.getComponent(0) != panel) — checking whether this exact panel instance is already displayed, not a value comparison.
  • BoxingComparator (8): Comparator.comparing(...) with an int/long-returning key extractor was boxing unnecessarily on every comparison. Switched to comparingInt/comparingLong in Lspv, AbstractCentralProcessor.orderedProcCaches, and both LogicalProcessorInformation/LogicalProcessorInformationFFM twins.
  • NarrowCalculation (9): all false positives — every flagged product involves small, OS-bounded quantities (open-file-descriptor counts, process counts, tiny fixed struct-offset constants like CP_USER * UINT64_SIZE where both operands are ≤8) that cannot realistically approach int overflow. Suppressed with the specific bound documented at each site rather than guessed at generically.
  • LongDoubleConversion (5) / IntLiteralCast (3): missing explicit casts on intentional long→double widening (test tolerance comparisons, demo GUI chart values) and int-literal-cast-to-long in a test; made the cast explicit or replaced with a typed literal (0L instead of (long) 0). No behavior change.
  • UnnecessaryLongToIntConversion (4): removed pointless (int) casts on long values immediately passed to a long-typed parameter (MemorySegment.get's offset, Arena.allocate's size) — the narrowing served no purpose and the widen-back was implicit anyway.
  • IntLongMath (1): MacOSProcessJNA.updateAttributes computed pti_faults - pti_pageins in int arithmetic (both are native int32_t struct fields) before assigning to the long minorFaults field. Its FFM twin already avoids this shape by subtracting from this.majorFaults (already long) instead of re-reading the raw int field — changed JNA to match, which removes the pattern entirely rather than suppressing it.

Test plan

  • ./mvnw clean install -Perror-prone -DskipTests: 0 ERROR; ReferenceEquality/BoxingComparator/NarrowCalculation/LongDoubleConversion/UnnecessaryLongToIntConversion/IntLiteralCast/IntLongMath all → 0
  • ./mvnw -pl oshi-common,oshi-core,oshi-core-ffm -am test: 0 tests failed
  • ./mvnw checkstyle:check, forbiddenapis:check, clean compile javadoc:javadoc: all pass

Summary by CodeRabbit

  • Bug Fixes

    • Improved numeric sorting for partitions, processor information, caches, and NUMA data.
    • Corrected macOS process minor-fault reporting.
    • Preserved large Windows environment sizes without narrowing values.
    • Improved consistency of CPU statistics comparisons across legacy and modern implementations.
  • Improvements

    • Improved accuracy and reliability of memory, swap, storage, and processor data displayed in the demo interface.

…nings

ReferenceEquality (4): all intentional, suppressed with justification -
memoized-supplier identity checks in a test, JNA's own singleton
TypeMapper comparison idiom, and a Swing component-identity check.

BoxingComparator (8): Comparator.comparing(...) boxing an int/long key
extractor; switched to comparingInt/comparingLong.

NarrowCalculation (9): products of small, OS-bounded int quantities
(fd counts, process counts, tiny struct-offset constants) that can't
realistically overflow; suppressed with the bound documented.

LongDoubleConversion (5) and IntLiteralCast (3): missing explicit casts
on long-to-double widening and int-literal-to-long casts; made explicit
or replaced with a typed literal, no behavior change.

UnnecessaryLongToIntConversion (4): removed pointless (int) casts on
long values immediately passed to a long-typed parameter.

IntLongMath (1): MacOSProcessJNA computed pti_faults - pti_pageins in
int arithmetic before widening to the long minorFaults field. Its FFM
twin already avoids this by subtracting from the already-long
majorFaults field instead of the raw int; changed JNA to match rather
than suppress, since it removes the pattern entirely.
@coderabbitai

coderabbitai Bot commented Aug 13, 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: e0a16e67-7924-4cb7-89a1-385674777949

📥 Commits

Reviewing files that changed from the base of the PR and between d510b78 and 0a7ff7b.

📒 Files selected for processing (18)
  • oshi-common/src/main/java/oshi/driver/common/unix/aix/Lspv.java
  • oshi-common/src/main/java/oshi/hardware/common/AbstractCentralProcessor.java
  • oshi-common/src/test/java/oshi/util/PrivilegedUtilTest.java
  • oshi-common/src/test/java/oshi/util/UtilTest.java
  • oshi-core-ffm/src/main/java/oshi/driver/windows/LogicalProcessorInformationFFM.java
  • oshi-core-ffm/src/main/java/oshi/ffm/util/platform/windows/Advapi32UtilFFM.java
  • oshi-core-ffm/src/main/java/oshi/software/os/mac/MacInternetProtocolStatsFFM.java
  • oshi-core-ffm/src/main/java/oshi/software/os/mac/MacOperatingSystemFFM.java
  • oshi-core-ffm/src/main/java/oshi/software/os/windows/WindowsOSProcessFFM.java
  • oshi-core-ffm/src/test/java/oshi/hardware/platform/windows/WindowsCentralProcessorFFMLegacyTest.java
  • oshi-core/src/main/java/oshi/driver/windows/LogicalProcessorInformation.java
  • oshi-core/src/main/java/oshi/hardware/platform/unix/dragonflybsd/DragonFlyBsdCentralProcessorJNA.java
  • oshi-core/src/main/java/oshi/hardware/platform/windows/WindowsPowerSourceJNA.java
  • oshi-core/src/main/java/oshi/software/os/mac/MacOSProcessJNA.java
  • oshi-core/src/test/java/oshi/hardware/platform/windows/WindowsCentralProcessorLegacyTest.java
  • oshi-demo/src/main/java/oshi/demo/OshiGui.java
  • oshi-demo/src/main/java/oshi/demo/gui/FileStorePanel.java
  • oshi-demo/src/main/java/oshi/demo/gui/MemoryPanel.java
📜 Recent review details
⏰ Context from checks skipped due to timeout. (7)
  • GitHub Check: Test JDK 25, OpenBSD (+ JNA==FFM)
  • GitHub Check: Test JDK 25, OpenIndiana (+ JNA==FFM)
  • GitHub Check: Test JDK 25, FreeBSD (+ JNA==FFM)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Lint (ForbiddenAPIs, Javadoc, SLF4J)
  • GitHub Check: Error Prone
  • GitHub Check: Analyze (java)
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{java,properties}

📄 CodeRabbit inference engine (AGENTS.md)

Before writing any parsing helper, check whether ParseUtil already has one.

Files:

  • oshi-core-ffm/src/main/java/oshi/software/os/windows/WindowsOSProcessFFM.java
  • oshi-demo/src/main/java/oshi/demo/OshiGui.java
  • oshi-core-ffm/src/test/java/oshi/hardware/platform/windows/WindowsCentralProcessorFFMLegacyTest.java
  • oshi-common/src/main/java/oshi/driver/common/unix/aix/Lspv.java
  • oshi-core-ffm/src/main/java/oshi/driver/windows/LogicalProcessorInformationFFM.java
  • oshi-core/src/main/java/oshi/software/os/mac/MacOSProcessJNA.java
  • oshi-core/src/test/java/oshi/hardware/platform/windows/WindowsCentralProcessorLegacyTest.java
  • oshi-common/src/test/java/oshi/util/PrivilegedUtilTest.java
  • oshi-core/src/main/java/oshi/driver/windows/LogicalProcessorInformation.java
  • oshi-core/src/main/java/oshi/hardware/platform/unix/dragonflybsd/DragonFlyBsdCentralProcessorJNA.java
  • oshi-core-ffm/src/main/java/oshi/software/os/mac/MacInternetProtocolStatsFFM.java
  • oshi-core-ffm/src/main/java/oshi/ffm/util/platform/windows/Advapi32UtilFFM.java
  • oshi-core/src/main/java/oshi/hardware/platform/windows/WindowsPowerSourceJNA.java
  • oshi-core-ffm/src/main/java/oshi/software/os/mac/MacOperatingSystemFFM.java
  • oshi-common/src/test/java/oshi/util/UtilTest.java
  • oshi-common/src/main/java/oshi/hardware/common/AbstractCentralProcessor.java
  • oshi-demo/src/main/java/oshi/demo/gui/MemoryPanel.java
  • oshi-demo/src/main/java/oshi/demo/gui/FileStorePanel.java
oshi-core-ffm/**/*.java

📄 CodeRabbit inference engine (AGENTS.md)

oshi-core-ffm may not reference com.sun.jna.**.

Files:

  • oshi-core-ffm/src/main/java/oshi/software/os/windows/WindowsOSProcessFFM.java
  • oshi-core-ffm/src/test/java/oshi/hardware/platform/windows/WindowsCentralProcessorFFMLegacyTest.java
  • oshi-core-ffm/src/main/java/oshi/driver/windows/LogicalProcessorInformationFFM.java
  • oshi-core-ffm/src/main/java/oshi/software/os/mac/MacInternetProtocolStatsFFM.java
  • oshi-core-ffm/src/main/java/oshi/ffm/util/platform/windows/Advapi32UtilFFM.java
  • oshi-core-ffm/src/main/java/oshi/software/os/mac/MacOperatingSystemFFM.java
**/*.java

📄 CodeRabbit inference engine (AGENTS.md)

**/*.java: Every public and protected type and method needs javadoc.
Do not use fully-qualified class names in
code or in javadoc — including inside {@link ...}. Import the type and link the simple name.
New files get a current-year-only
header (Copyright 2026 The OSHI Project Contributors / SPDX-License-Identifier: MIT), even when
copied from an older file; spotless maintains end years on existing files.
Never add a line range to
config/checkstyle-suppressions.xml — a range breaks the moment anything above it shifts, including a
single added import, and the failure looks unrelated to the change that caused it.
new classes are
expected to declare one, and matching the annotation of the class you are modeling yours on is the
right default.
Values that are constant (CPU model,
serial number) or expensive-but-slow-changing are wrapped in
oshi.util.Memoizer.memoize(supplier, ...)

Files:

  • oshi-core-ffm/src/main/java/oshi/software/os/windows/WindowsOSProcessFFM.java
  • oshi-demo/src/main/java/oshi/demo/OshiGui.java
  • oshi-core-ffm/src/test/java/oshi/hardware/platform/windows/WindowsCentralProcessorFFMLegacyTest.java
  • oshi-common/src/main/java/oshi/driver/common/unix/aix/Lspv.java
  • oshi-core-ffm/src/main/java/oshi/driver/windows/LogicalProcessorInformationFFM.java
  • oshi-core/src/main/java/oshi/software/os/mac/MacOSProcessJNA.java
  • oshi-core/src/test/java/oshi/hardware/platform/windows/WindowsCentralProcessorLegacyTest.java
  • oshi-common/src/test/java/oshi/util/PrivilegedUtilTest.java
  • oshi-core/src/main/java/oshi/driver/windows/LogicalProcessorInformation.java
  • oshi-core/src/main/java/oshi/hardware/platform/unix/dragonflybsd/DragonFlyBsdCentralProcessorJNA.java
  • oshi-core-ffm/src/main/java/oshi/software/os/mac/MacInternetProtocolStatsFFM.java
  • oshi-core-ffm/src/main/java/oshi/ffm/util/platform/windows/Advapi32UtilFFM.java
  • oshi-core/src/main/java/oshi/hardware/platform/windows/WindowsPowerSourceJNA.java
  • oshi-core-ffm/src/main/java/oshi/software/os/mac/MacOperatingSystemFFM.java
  • oshi-common/src/test/java/oshi/util/UtilTest.java
  • oshi-common/src/main/java/oshi/hardware/common/AbstractCentralProcessor.java
  • oshi-demo/src/main/java/oshi/demo/gui/MemoryPanel.java
  • oshi-demo/src/main/java/oshi/demo/gui/FileStorePanel.java
**/*Test.java

📄 CodeRabbit inference engine (AGENTS.md)

**/*Test.java: Test files are named *Test.java.
Tests must pass there and on real hardware.

  • Assert on invariants (non-null, correct type, ordering, a plausible range), not on specific values.

Files:

  • oshi-core-ffm/src/test/java/oshi/hardware/platform/windows/WindowsCentralProcessorFFMLegacyTest.java
  • oshi-core/src/test/java/oshi/hardware/platform/windows/WindowsCentralProcessorLegacyTest.java
  • oshi-common/src/test/java/oshi/util/PrivilegedUtilTest.java
  • oshi-common/src/test/java/oshi/util/UtilTest.java
oshi-common/**/*.java

📄 CodeRabbit inference engine (AGENTS.md)

oshi-common/**/*.java: oshi-common may not reference com.sun.jna.**, java.lang.foreign.**, or any
System.load/loadLibrary. It must stay pure JDK.

Files:

  • oshi-common/src/main/java/oshi/driver/common/unix/aix/Lspv.java
  • oshi-common/src/test/java/oshi/util/PrivilegedUtilTest.java
  • oshi-common/src/test/java/oshi/util/UtilTest.java
  • oshi-common/src/main/java/oshi/hardware/common/AbstractCentralProcessor.java
oshi-core/src/test/java/**/*.java

📄 CodeRabbit inference engine (AGENTS.md)

oshi-core/src/test/java/**/*.java: Any oshi-core test that allocates JNA needs
@DisabledIfSystemProperty(named = "os.name", matches = "(?i).*netbsd.*"); the NetBSD CI runner
has no libjnidispatch.

Files:

  • oshi-core/src/test/java/oshi/hardware/platform/windows/WindowsCentralProcessorLegacyTest.java
🧠 Learnings (28)
📓 Common learnings
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3174
File: oshi-benchmark/src/test/java/oshi/comparison/WmiComparisonTest.java:237-257
Timestamp: 2026-04-19T01:28:47.155Z
Learning: In `oshi-benchmark/src/test/java/oshi/comparison/WmiComparisonTest.java`, the WMI comparison tests (e.g., `testProcessor`) intentionally validate only index 0 and a few representative fields per WMI data type (String, uint16, uint32, uint64). Exhaustive row-by-row comparison is deliberately avoided for numerically heavy multi-row tables. The design rationale is: matching row counts + a few selected fields covering each data type is sufficient to verify JNA vs FFM driver parity. Do not suggest looping over all rows for these tests.
📚 Learning: 2026-04-17T23:43:35.860Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3168
File: oshi-core-java25/src/main/java/oshi/ffm/windows/PdhFFM.java:0-0
Timestamp: 2026-04-17T23:43:35.860Z
Learning: In `oshi-core-java25/src/main/java/oshi/ffm/windows/PdhFFM.java`, the `PDH_RAW_COUNTER_LAYOUT` Java FFM struct layout must place `FirstValue` at byte offset 16 (not 12). The native MSVC compiler inserts 4 bytes of implicit alignment padding before the `LONGLONG FirstValue` field (after CStatus=4 bytes + FILETIME TimeStamp=8 bytes = 12 bytes), because LONGLONG requires 8-byte alignment. The total struct size is 40 bytes (with trailing padding). Do not use JAVA_LONG_UNALIGNED without explicit padding here, as that incorrectly places FirstValue at offset 12 and causes reads of garbage counter values.

Applied to files:

  • oshi-core-ffm/src/main/java/oshi/software/os/windows/WindowsOSProcessFFM.java
  • oshi-core-ffm/src/main/java/oshi/ffm/util/platform/windows/Advapi32UtilFFM.java
  • oshi-core/src/main/java/oshi/hardware/platform/windows/WindowsPowerSourceJNA.java
📚 Learning: 2026-05-18T23:38:59.650Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3267
File: oshi-common/src/main/java/oshi/driver/common/windows/wmi/Win32Process.java:89-100
Timestamp: 2026-05-18T23:38:59.650Z
Learning: In `oshi-common/src/main/java/oshi/driver/common/windows/wmi/Win32Process.java`, the `queryProcesses(WmiQueryExecutor h, Collection<Integer> pids)` method intentionally uses `Collection<Integer>` (not `Set<Integer>`) to match the JNA original and to remain flexible for callers passing `List` or other collection types. The `queryCommandLines` method uses `Set<Integer>` only because its callers happen to pass sets. Do not suggest narrowing `queryProcesses` to `Set<Integer>`.

Applied to files:

  • oshi-core-ffm/src/main/java/oshi/software/os/windows/WindowsOSProcessFFM.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/software/os/windows/WindowsOSProcessFFM.java
  • oshi-core-ffm/src/main/java/oshi/driver/windows/LogicalProcessorInformationFFM.java
  • oshi-core-ffm/src/main/java/oshi/software/os/mac/MacInternetProtocolStatsFFM.java
  • oshi-core-ffm/src/main/java/oshi/ffm/util/platform/windows/Advapi32UtilFFM.java
  • oshi-core-ffm/src/main/java/oshi/software/os/mac/MacOperatingSystemFFM.java
📚 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/software/os/windows/WindowsOSProcessFFM.java
  • oshi-demo/src/main/java/oshi/demo/OshiGui.java
  • oshi-common/src/main/java/oshi/driver/common/unix/aix/Lspv.java
  • oshi-core-ffm/src/main/java/oshi/driver/windows/LogicalProcessorInformationFFM.java
  • oshi-core/src/main/java/oshi/software/os/mac/MacOSProcessJNA.java
  • oshi-core/src/main/java/oshi/driver/windows/LogicalProcessorInformation.java
  • oshi-core/src/main/java/oshi/hardware/platform/unix/dragonflybsd/DragonFlyBsdCentralProcessorJNA.java
  • oshi-core-ffm/src/main/java/oshi/software/os/mac/MacInternetProtocolStatsFFM.java
  • oshi-core-ffm/src/main/java/oshi/ffm/util/platform/windows/Advapi32UtilFFM.java
  • oshi-core/src/main/java/oshi/hardware/platform/windows/WindowsPowerSourceJNA.java
  • oshi-core-ffm/src/main/java/oshi/software/os/mac/MacOperatingSystemFFM.java
  • oshi-common/src/main/java/oshi/hardware/common/AbstractCentralProcessor.java
  • oshi-demo/src/main/java/oshi/demo/gui/MemoryPanel.java
  • oshi-demo/src/main/java/oshi/demo/gui/FileStorePanel.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/software/os/windows/WindowsOSProcessFFM.java
  • oshi-demo/src/main/java/oshi/demo/OshiGui.java
  • oshi-common/src/main/java/oshi/driver/common/unix/aix/Lspv.java
  • oshi-core-ffm/src/main/java/oshi/driver/windows/LogicalProcessorInformationFFM.java
  • oshi-core/src/main/java/oshi/software/os/mac/MacOSProcessJNA.java
  • oshi-core/src/main/java/oshi/driver/windows/LogicalProcessorInformation.java
  • oshi-core/src/main/java/oshi/hardware/platform/unix/dragonflybsd/DragonFlyBsdCentralProcessorJNA.java
  • oshi-core-ffm/src/main/java/oshi/software/os/mac/MacInternetProtocolStatsFFM.java
  • oshi-core-ffm/src/main/java/oshi/ffm/util/platform/windows/Advapi32UtilFFM.java
  • oshi-core/src/main/java/oshi/hardware/platform/windows/WindowsPowerSourceJNA.java
  • oshi-core-ffm/src/main/java/oshi/software/os/mac/MacOperatingSystemFFM.java
  • oshi-common/src/main/java/oshi/hardware/common/AbstractCentralProcessor.java
  • oshi-demo/src/main/java/oshi/demo/gui/MemoryPanel.java
  • oshi-demo/src/main/java/oshi/demo/gui/FileStorePanel.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/software/os/windows/WindowsOSProcessFFM.java
  • oshi-demo/src/main/java/oshi/demo/OshiGui.java
  • oshi-core-ffm/src/test/java/oshi/hardware/platform/windows/WindowsCentralProcessorFFMLegacyTest.java
  • oshi-common/src/main/java/oshi/driver/common/unix/aix/Lspv.java
  • oshi-core-ffm/src/main/java/oshi/driver/windows/LogicalProcessorInformationFFM.java
  • oshi-core/src/main/java/oshi/software/os/mac/MacOSProcessJNA.java
  • oshi-core/src/test/java/oshi/hardware/platform/windows/WindowsCentralProcessorLegacyTest.java
  • oshi-common/src/test/java/oshi/util/PrivilegedUtilTest.java
  • oshi-core/src/main/java/oshi/driver/windows/LogicalProcessorInformation.java
  • oshi-core/src/main/java/oshi/hardware/platform/unix/dragonflybsd/DragonFlyBsdCentralProcessorJNA.java
  • oshi-core-ffm/src/main/java/oshi/software/os/mac/MacInternetProtocolStatsFFM.java
  • oshi-core-ffm/src/main/java/oshi/ffm/util/platform/windows/Advapi32UtilFFM.java
  • oshi-core/src/main/java/oshi/hardware/platform/windows/WindowsPowerSourceJNA.java
  • oshi-core-ffm/src/main/java/oshi/software/os/mac/MacOperatingSystemFFM.java
  • oshi-common/src/test/java/oshi/util/UtilTest.java
  • oshi-common/src/main/java/oshi/hardware/common/AbstractCentralProcessor.java
  • oshi-demo/src/main/java/oshi/demo/gui/MemoryPanel.java
  • oshi-demo/src/main/java/oshi/demo/gui/FileStorePanel.java
📚 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-demo/src/main/java/oshi/demo/OshiGui.java
  • oshi-common/src/test/java/oshi/util/PrivilegedUtilTest.java
  • oshi-core-ffm/src/main/java/oshi/ffm/util/platform/windows/Advapi32UtilFFM.java
  • oshi-core-ffm/src/main/java/oshi/software/os/mac/MacOperatingSystemFFM.java
  • oshi-common/src/test/java/oshi/util/UtilTest.java
📚 Learning: 2026-08-12T22:15:37.668Z
Learnt from: CR
Repo: oshi/oshi PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-08-12T22:15:37.668Z
Learning: Applies to oshi-common/**/*.java : `oshi-common` may not reference `com.sun.jna.**`, `java.lang.foreign.**`, or any
  `System.load`/`loadLibrary`. It must stay pure JDK.

Applied to files:

  • oshi-demo/src/main/java/oshi/demo/OshiGui.java
  • oshi-common/src/test/java/oshi/util/PrivilegedUtilTest.java
  • oshi-core/src/main/java/oshi/hardware/platform/windows/WindowsPowerSourceJNA.java
📚 Learning: 2026-08-12T22:15:37.668Z
Learnt from: CR
Repo: oshi/oshi PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-08-12T22:15:37.668Z
Learning: Applies to oshi-core-ffm/**/*.java : `oshi-core-ffm` may not reference `com.sun.jna.**`.

Applied to files:

  • oshi-demo/src/main/java/oshi/demo/OshiGui.java
  • oshi-core-ffm/src/main/java/oshi/ffm/util/platform/windows/Advapi32UtilFFM.java
  • oshi-core-ffm/src/main/java/oshi/software/os/mac/MacOperatingSystemFFM.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-core-ffm/src/test/java/oshi/hardware/platform/windows/WindowsCentralProcessorFFMLegacyTest.java
  • oshi-core/src/test/java/oshi/hardware/platform/windows/WindowsCentralProcessorLegacyTest.java
📚 Learning: 2026-04-19T01:28:47.155Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3174
File: oshi-benchmark/src/test/java/oshi/comparison/WmiComparisonTest.java:237-257
Timestamp: 2026-04-19T01:28:47.155Z
Learning: In `oshi-benchmark/src/test/java/oshi/comparison/WmiComparisonTest.java`, the WMI comparison tests (e.g., `testProcessor`) intentionally validate only index 0 and a few representative fields per WMI data type (String, uint16, uint32, uint64). Exhaustive row-by-row comparison is deliberately avoided for numerically heavy multi-row tables. The design rationale is: matching row counts + a few selected fields covering each data type is sufficient to verify JNA vs FFM driver parity. Do not suggest looping over all rows for these tests.

Applied to files:

  • oshi-core-ffm/src/test/java/oshi/hardware/platform/windows/WindowsCentralProcessorFFMLegacyTest.java
  • oshi-core-ffm/src/main/java/oshi/driver/windows/LogicalProcessorInformationFFM.java
  • oshi-core/src/test/java/oshi/hardware/platform/windows/WindowsCentralProcessorLegacyTest.java
  • oshi-core/src/main/java/oshi/driver/windows/LogicalProcessorInformation.java
📚 Learning: 2026-04-12T19:22:09.716Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3149
File: oshi-common/src/main/java/oshi/hardware/common/platform/mac/MacCentralProcessor.java:159-163
Timestamp: 2026-04-12T19:22:09.716Z
Learning: When reviewing OSHI hardware platform code that uses or implements `CentralProcessor`/`PhysicalProcessor.getEfficiency()`, remember the API’s counterintuitive semantics: a *higher* efficiency-class value indicates *greater performance* (lower efficiency). P-cores/“performance cores” should therefore have higher values (e.g., 1) than E-cores/“efficiency cores” (e.g., 0), as documented in the `CentralProcessor` Javadoc. Do not flag code as incorrect solely because ARM_P_CORES or Intel P-cores are assigned higher efficiency values.

Applied to files:

  • oshi-common/src/main/java/oshi/driver/common/unix/aix/Lspv.java
  • oshi-common/src/main/java/oshi/hardware/common/AbstractCentralProcessor.java
📚 Learning: 2026-07-28T18:20:41.673Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 0
File: :0-0
Timestamp: 2026-07-28T18:20:41.673Z
Learning: In `oshi-common/src/main/java/oshi/hardware/common/platform/mac/MacCentralProcessor.java`, `MacCentralProcessor.initProcessorCounts()` constructs every `PhysicalProcessor` with a non-null ID string: an absent IORegistry `compatible` property is normalized to `""`. Therefore, the production call `MacCentralProcessor.deriveMicroarchitecture(getPhysicalProcessors())` may safely call `PhysicalProcessor#getIdString()` without a null guard.

Applied to files:

  • oshi-core/src/main/java/oshi/software/os/mac/MacOSProcessJNA.java
  • oshi-core/src/main/java/oshi/driver/windows/LogicalProcessorInformation.java
  • oshi-core/src/main/java/oshi/hardware/platform/unix/dragonflybsd/DragonFlyBsdCentralProcessorJNA.java
  • oshi-core-ffm/src/main/java/oshi/software/os/mac/MacOperatingSystemFFM.java
  • oshi-common/src/main/java/oshi/hardware/common/AbstractCentralProcessor.java
📚 Learning: 2026-04-03T02:07:49.467Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3110
File: oshi-core-java25/src/main/java/oshi/hardware/platform/mac/MacHWDiskStoreFFM.java:119-121
Timestamp: 2026-04-03T02:07:49.467Z
Learning: In `oshi-core-java25/src/main/java/oshi/hardware/platform/mac/MacHWDiskStoreFFM.java` (and similar FFM/API implementations in OSHI), the `updateAttributes()` method intentionally uses `catch (Throwable e) { return false; }` without logging. This is by design: `updateAttributes()` is a public API method whose contract is to return `false` on failure; callers consume the boolean and would never see log output, so adding a log statement is not desired.

Applied to files:

  • oshi-core/src/main/java/oshi/software/os/mac/MacOSProcessJNA.java
📚 Learning: 2026-05-31T04:49:19.668Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3310
File: oshi-core/src/main/java/oshi/software/os/unix/netbsd/NetBsdOperatingSystem.java:164-166
Timestamp: 2026-05-31T04:49:19.668Z
Learning: In the oshi/oshi project, the NetBSD platform intentionally removes all JNA/native library dependencies (PR `#3310`). `NetBsdOperatingSystem.getThreadId()` uses `(int) Thread.currentThread().getId()` rather than `NetBsdLibc._lwp_self()` because the JNA native library is not bundled with the Maven dependency for the NetBSD platform. The mismatch between Java thread ids and kernel LWP ids is an accepted trade-off. Do not suggest reintroducing JNA-based calls (such as `NetBsdLibc._lwp_self()`) in NetBSD platform code.

Applied to files:

  • oshi-core/src/main/java/oshi/software/os/mac/MacOSProcessJNA.java
  • oshi-core/src/main/java/oshi/hardware/platform/unix/dragonflybsd/DragonFlyBsdCentralProcessorJNA.java
📚 Learning: 2026-04-15T04:56:18.352Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3163
File: oshi-core-java25/src/test/java/oshi/ffm/mac/CoreFoundationTest.java:97-103
Timestamp: 2026-04-15T04:56:18.352Z
Learning: In CoreFoundationTest.java (oshi-core-java25/src/test/java/oshi/ffm/mac/CoreFoundationTest.java), asserting exact CFGetRetainCount deltas (+1 after retain, -1 after release) is intentional and considered reliable for freshly created CF objects (e.g., CFStringRef via CFStringRef.createCFString) where the test holds sole ownership. Do not flag these assertions as flaky — the Apple "avoid CFGetRetainCount" advisory applies to shared/framework-managed objects, not exclusively owned objects in unit tests.

Applied to files:

  • oshi-core/src/main/java/oshi/software/os/mac/MacOSProcessJNA.java
📚 Learning: 2026-04-20T03:07:05.660Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3176
File: oshi-core-java25/src/main/java/oshi/hardware/platform/windows/WindowsVirtualMemoryFFM.java:53-60
Timestamp: 2026-04-20T03:07:05.660Z
Learning: In OSHI's Windows FFM paging file implementation (`oshi-core-java25/src/main/java/oshi/hardware/platform/windows/WindowsVirtualMemoryFFM.java`), the `querySwapUsed()` method uses the Windows PDH raw counter for "% Usage" on the paging file. Despite its name, this raw counter returns page counts: `FirstValue` is the number of pages currently used and `SecondValue` is the total number of pages in the swap file. The formatted counter performs the division and multiplies by 100% to yield a true percentage. Therefore, computing swap used bytes as `pageSize * used.get()` (pages × page size) is correct — do not treat the return value as a percentage.

Applied to files:

  • oshi-core/src/main/java/oshi/software/os/mac/MacOSProcessJNA.java
📚 Learning: 2026-04-06T04:45:47.644Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3121
File: oshi-core/src/main/java/oshi/software/os/linux/LinuxOperatingSystem.java:53-53
Timestamp: 2026-04-06T04:45:47.644Z
Learning: In the oshi/oshi project, only interfaces and classes in the root packages `oshi`, `oshi.hardware`, and `oshi.software.os` are considered the public API. Code in subpackages that represent specific implementations/platforms (e.g., `oshi.software.os.linux`, `oshi.hardware.platform.linux`, and similar subpackages) is implementation detail. When reviewing, do not treat changes to classes in these platform-specific subpackages as public API breaks (for example: making `LinuxOperatingSystem` abstract, narrowing constructor visibility, or adding/removing abstract methods should not be flagged as breaking public API).

Applied to files:

  • oshi-core/src/main/java/oshi/software/os/mac/MacOSProcessJNA.java
  • oshi-core/src/main/java/oshi/hardware/platform/unix/dragonflybsd/DragonFlyBsdCentralProcessorJNA.java
  • oshi-core/src/main/java/oshi/hardware/platform/windows/WindowsPowerSourceJNA.java
📚 Learning: 2026-04-12T19:34:59.050Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3149
File: oshi-common/src/main/java/oshi/hardware/common/platform/mac/MacCentralProcessor.java:159-163
Timestamp: 2026-04-12T19:34:59.050Z
Learning: The counterintuitive naming of `PhysicalProcessor.getEfficiency()` / `EfficiencyClass` in OSHI (where a higher value means MORE performance and LESS efficiency, so P-cores get higher values than E-cores) is intentionally inherited from Microsoft's `PROCESSOR_RELATIONSHIP.EfficiencyClass` Win32 API: "A core with a higher value for the efficiency class has intrinsically greater performance and less efficiency." OSHI follows this same convention for cross-platform consistency. Do not flag P-cores being assigned higher efficiency values as a bug.

Applied to files:

  • oshi-core/src/main/java/oshi/driver/windows/LogicalProcessorInformation.java
📚 Learning: 2026-04-03T18:44:48.200Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3112
File: oshi-core/src/main/java/oshi/PlatformEnum.java:63-66
Timestamp: 2026-04-03T18:44:48.200Z
Learning: In oshi/oshi PlatformEnum.java, the DRAGONFLYBSD enum constant is intentionally added for platform detection only (no implementation classes exist yet). It allows UnsupportedOperationException messages to say "DragonFly BSD" rather than "Unknown". Full DragonFly BSD support is tracked in issue `#2583`. Do not flag the missing switch-case implementations as a bug.

Applied to files:

  • oshi-core/src/main/java/oshi/hardware/platform/unix/dragonflybsd/DragonFlyBsdCentralProcessorJNA.java
📚 Learning: 2026-04-10T22:44:36.786Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3136
File: oshi-core-java25/src/main/java/oshi/software/os/linux/LinuxOperatingSystemFFM.java:46-53
Timestamp: 2026-04-10T22:44:36.786Z
Learning: In OSHI's `AuxvFFM.queryAuxv()` (oshi-core-java25/src/main/java/oshi/driver/linux/proc/AuxvFFM.java), the do-while loop is safe even when `/proc/self/auxv` cannot be read: `FileUtil.readAllBytesAsBuffer` returns an empty ByteBuffer on failure, and `FileUtil.readLongFromBuffer`/`readIntFromBuffer` return 0L when reading past the buffer limit. This 0L equals AT_NULL, causing the loop to exit immediately with an empty map, which triggers the `getconf`/hardcoded-default fallback in callers like `LinuxOperatingSystemFFM`. Do not flag this do-while loop or the static initializer that calls `AuxvFFM.queryAuxv()` as unsafe.

Applied to files:

  • oshi-core/src/main/java/oshi/hardware/platform/unix/dragonflybsd/DragonFlyBsdCentralProcessorJNA.java
📚 Learning: 2026-04-03T18:43:51.290Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3112
File: oshi-core/src/main/java/oshi/PlatformEnum.java:99-100
Timestamp: 2026-04-03T18:43:51.290Z
Learning: In oshi/oshi PlatformEnum.java, the DragonFly BSD detection uses `osName.equalsIgnoreCase("dragonflybsd")` intentionally, mirroring the exact same check in JNA's `Platform.java` source. Java's `os.name` property on DragonFly BSD is "dragonflybsd" (no space), so `startsWith("DragonFly")` is NOT the correct pattern here. Do not suggest changing it to `startsWith`.

Applied to files:

  • oshi-core/src/main/java/oshi/hardware/platform/unix/dragonflybsd/DragonFlyBsdCentralProcessorJNA.java
📚 Learning: 2026-04-18T22:53:56.149Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3173
File: oshi-core-java25/src/main/java/oshi/util/platform/windows/WmiQueryHandlerFFM.java:107-193
Timestamp: 2026-04-18T22:53:56.149Z
Learning: In OSHI's `WmiQueryHandlerFFM` (oshi-core-java25) and the JNA `WmiQueryHandler` (oshi-core), the `failedWmiClassNames` cache intentionally keys failures by WMI class name only (not namespace). This is a pre-existing, accepted pattern shared between both implementations. Do not flag this as a bug in future reviews — the project maintainer (dbwiddis) confirmed it does not impact callers and the added complexity of a composite namespace+class key is not warranted.

Applied to files:

  • oshi-core-ffm/src/main/java/oshi/ffm/util/platform/windows/Advapi32UtilFFM.java
📚 Learning: 2026-04-08T00:58:07.212Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3125
File: oshi-core-java25/src/main/java/oshi/hardware/platform/windows/WindowsPowerSourceFFM.java:131-133
Timestamp: 2026-04-08T00:58:07.212Z
Learning: Do not flag `getPowerSources()` as incorrect when it returns a singleton list that wraps `getPowerSource("System Battery")` and/or short-circuits the enumeration after the first eligible battery pack in the Windows power source JNA/FFM implementations. This is intentional for longstanding JNA behavior; a refactor to support zero-or-more batteries is planned later, so the current single-battery behavior should be treated as by-design rather than a bug.

Applied to files:

  • oshi-core/src/main/java/oshi/hardware/platform/windows/WindowsPowerSourceJNA.java
📚 Learning: 2026-06-12T16:33:11.703Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3379
File: oshi-common/src/main/java/oshi/hardware/common/platform/unix/freebsd/FreeBsdPowerSource.java:63-80
Timestamp: 2026-06-12T16:33:11.703Z
Learning: In FreeBSD's `FreeBsdPowerSource.queryBattery(...)` (oshi-common/src/main/java/oshi/hardware/common/platform/unix/freebsd/FreeBsdPowerSource.java), `psPowerOnLine` defaults to `false` and `psCurrentCapacity` defaults to `0` and are never reassigned. This is intentional: FreeBSD's ACPI battery interface does not expose an AC-line sysctl (unlike OpenBSD/NetBSD's `apm -b`), and `acpiconf` output does not include current capacity (only design/last-full). Do not flag these as missing values or suggest adding `hw.acpi.acline` lookups — the platform simply does not provide them through the available interfaces.

Applied to files:

  • oshi-core/src/main/java/oshi/hardware/platform/windows/WindowsPowerSourceJNA.java
📚 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-core-ffm/src/main/java/oshi/software/os/mac/MacOperatingSystemFFM.java
📚 Learning: 2026-03-29T20:01:06.452Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3014
File: oshi-core-java11/src/main/java/module-info.java:10-17
Timestamp: 2026-03-29T20:01:06.452Z
Learning: In the oshi project, `oshi-core-java25/src/main/java/module-info.java` intentionally does NOT export `oshi.util.platform.unix.freebsd`, `oshi.util.platform.unix.openbsd`, or `oshi.util.platform.unix.solaris`, because the FFM (Foreign Function & Memory) implementation only supports Windows, macOS, and Linux. This differs from `oshi-core-java11/src/main/java/module-info.java` which exports all Unix platform packages. The asymmetry is by design.

Applied to files:

  • oshi-core-ffm/src/main/java/oshi/software/os/mac/MacOperatingSystemFFM.java
🔇 Additional comments (18)
oshi-common/src/main/java/oshi/driver/common/unix/aix/Lspv.java (1)

49-49: LGTM!

oshi-core/src/main/java/oshi/driver/windows/LogicalProcessorInformation.java (1)

104-104: LGTM!

Also applies to: 106-108, 114-114

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

122-123: LGTM!

Also applies to: 473-474, 486-486

oshi-core-ffm/src/main/java/oshi/software/os/mac/MacInternetProtocolStatsFFM.java (1)

103-104: LGTM!

Also applies to: 200-201

oshi-core-ffm/src/main/java/oshi/software/os/mac/MacOperatingSystemFFM.java (1)

103-104: LGTM!

oshi-core-ffm/src/main/java/oshi/software/os/windows/WindowsOSProcessFFM.java (1)

339-339: LGTM!

oshi-core/src/main/java/oshi/hardware/platform/unix/dragonflybsd/DragonFlyBsdCentralProcessorJNA.java (1)

46-47: LGTM!

oshi-core/src/main/java/oshi/hardware/platform/windows/WindowsPowerSourceJNA.java (1)

44-45: LGTM!

oshi-core/src/main/java/oshi/software/os/mac/MacOSProcessJNA.java (1)

186-186: LGTM!

oshi-common/src/main/java/oshi/hardware/common/AbstractCentralProcessor.java (1)

415-415: LGTM!

oshi-core-ffm/src/main/java/oshi/driver/windows/LogicalProcessorInformationFFM.java (1)

112-116: LGTM!

oshi-common/src/test/java/oshi/util/PrivilegedUtilTest.java (1)

201-202: LGTM!

Also applies to: 212-213

oshi-common/src/test/java/oshi/util/UtilTest.java (1)

73-80: LGTM!

oshi-core-ffm/src/test/java/oshi/hardware/platform/windows/WindowsCentralProcessorFFMLegacyTest.java (1)

66-66: LGTM!

oshi-core/src/test/java/oshi/hardware/platform/windows/WindowsCentralProcessorLegacyTest.java (1)

66-66: LGTM!

oshi-demo/src/main/java/oshi/demo/OshiGui.java (1)

86-87: LGTM!

oshi-demo/src/main/java/oshi/demo/gui/FileStorePanel.java (1)

115-115: LGTM!

oshi-demo/src/main/java/oshi/demo/gui/MemoryPanel.java (1)

123-126: LGTM!


📝 Walkthrough

Walkthrough

The changes standardize comparator typing, document intentional narrowing and reference comparisons, remove redundant casts, adjust CPU tick assertions, correct minor-fault calculation, preserve long buffer sizes, and make demo dataset conversions explicit.

Changes

Numeric and warning cleanup

Layer / File(s) Summary
Explicit sorting comparators
oshi-common/src/main/java/..., oshi-core-ffm/src/main/java/..., oshi-core/src/main/java/...
Sorting uses numeric or explicitly typed comparators while preserving existing ordering criteria.
Native numeric handling
oshi-core-ffm/src/main/java/..., oshi-core/src/main/java/...
Native calculations document bounded narrowing, redundant casts are removed, and environment allocation uses the validated long size. Minor-fault calculation now uses the assigned major-fault value.
Tests and presentation values
oshi-common/src/test/java/..., oshi-core-ffm/src/test/java/..., oshi-core/src/test/java/..., oshi-demo/src/main/java/...
Tests document intentional identity checks and use explicit numeric literals. Demo datasets use explicit double conversions.

Estimated code review effort: 2 (Simple) | ~15 minutes

Mergeability Score: ⚪ Minimal · up to 0a7ff

This PR makes localized warning-cleanup and minor performance-oriented code changes with no reported behavior regressions; it is merge-ready after normal checks and review, with no actionable merge-blocking risk remaining.

Possibly related PRs

  • oshi/oshi#3398: Overlaps with comparator, narrowing-cast, and reference-equality cleanup.
  • oshi/oshi#3464: Updates the same legacy CPU tick comparison tests.

Poem

A rabbit checks each number twice,
With typed-up sorts and casts concise.
Native fields hop safely through,
Tests compare what caches do.
The charts now glow in doubles bright.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 57.69% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 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 pull request's main purpose: triaging Error Prone reference-equality, boxing, and narrowing warnings.
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.

@codecov

codecov Bot commented Aug 13, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.85714% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 79.80%. Comparing base (d510b78) to head (0a7ff7b).

Files with missing lines Patch % Lines
...rc/main/java/oshi/driver/common/unix/aix/Lspv.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3601      +/-   ##
============================================
- Coverage     79.84%   79.80%   -0.05%     
- Complexity     3872     4231     +359     
============================================
  Files           710      710              
  Lines         24254    24254              
  Branches       4057     4057              
============================================
- Hits          19366    19355      -11     
- Misses         2724     2733       +9     
- Partials       2164     2166       +2     
Flag Coverage Δ
freebsd 33.46% <7.14%> (ø)
linux 37.57% <7.14%> (-0.01%) ⬇️
macos 38.40% <14.28%> (-0.02%) ⬇️
openbsd 32.65% <7.14%> (+0.01%) ⬆️
solaris 34.13% <7.14%> (-0.02%) ⬇️
windows 45.33% <85.71%> (-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.

@dbwiddis
dbwiddis merged commit 9136588 into oshi:master Aug 13, 2026
19 checks passed
@dbwiddis
dbwiddis deleted the triage-numeric-refequality-warnings branch August 13, 2026 00:15
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