Skip to content

Move ThreadInfo, MacSoundCard, and MacOSThread to oshi-common; set up macOS packages - #3144

Merged
dbwiddis merged 1 commit into
oshi:masterfrom
dbwiddis:mac-common-split
Apr 12, 2026
Merged

dbwiddis merged 1 commit into
oshi:masterfrom
dbwiddis:mac-common-split

Conversation

@dbwiddis

@dbwiddis dbwiddis commented Apr 12, 2026 •

Copy link
Copy Markdown
Member

Sets up macOS packages in oshi-common by moving one clean leaf-node class into each of the three package categories (driver, hardware, software), mirroring the Windows package setup from #3143.

Moved classes

Class From To
ThreadInfo oshi.driver.mac oshi.driver.common.mac
MacSoundCard oshi.hardware.platform.mac oshi.hardware.common.platform.mac
MacOSThread oshi.software.os.mac oshi.software.common.os.mac

All three are JNA-free leaf nodes with no same-package dependencies, making them clean candidates for the move.

Other changes

  • MacSoundCard: made class and constructor public (was package-private, now accessed cross-package)
  • Updated imports in MacOSProcess, MacOperatingSystem, MacHardwareAbstractionLayer, MacOSProcessFFM, and ThreadInfoTest
  • Added three package-info.java files for the new packages
  • Exported new packages from oshi-common module-info.java

Summary by CodeRabbit

  • Refactor

    • Consolidated macOS driver, hardware, and software components into the shared common module to enable cross-module reuse and access
    • Updated module exports to include new macOS packages and made select macOS classes publicly accessible
  • Chores

    • Added a changelog entry for the change and updated copyright year ranges
    • Minor build/config suppression adjustment and package-level documentation added

@coderabbitai

coderabbitai Bot commented Apr 12, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 69c3dea9-7de0-4dfd-8265-8e54a23d2a53

📥 Commits

Reviewing files that changed from the base of the PR and between 632e44d and a416594.

📒 Files selected for processing (14)
  • CHANGELOG.md
  • config/checkstyle-suppressions.xml
  • oshi-common/src/main/java/module-info.java
  • oshi-common/src/main/java/oshi/driver/common/mac/ThreadInfo.java
  • oshi-common/src/main/java/oshi/driver/common/mac/package-info.java
  • oshi-common/src/main/java/oshi/hardware/common/platform/mac/MacSoundCard.java
  • oshi-common/src/main/java/oshi/hardware/common/platform/mac/package-info.java
  • oshi-common/src/main/java/oshi/software/common/os/mac/MacOSThread.java
  • oshi-common/src/main/java/oshi/software/common/os/mac/package-info.java
  • oshi-core-java25/src/main/java/oshi/software/os/mac/MacOSProcessFFM.java
  • oshi-core/src/main/java/oshi/hardware/platform/mac/MacHardwareAbstractionLayer.java
  • oshi-core/src/main/java/oshi/software/os/mac/MacOSProcess.java
  • oshi-core/src/main/java/oshi/software/os/mac/MacOperatingSystem.java
  • oshi-core/src/test/java/oshi/driver/mac/ThreadInfoTest.java
✅ Files skipped from review due to trivial changes (9)
  • oshi-core/src/test/java/oshi/driver/mac/ThreadInfoTest.java
  • oshi-common/src/main/java/oshi/driver/common/mac/package-info.java
  • config/checkstyle-suppressions.xml
  • oshi-common/src/main/java/oshi/software/common/os/mac/package-info.java
  • oshi-common/src/main/java/module-info.java
  • oshi-core/src/main/java/oshi/hardware/platform/mac/MacHardwareAbstractionLayer.java
  • oshi-core/src/main/java/oshi/software/os/mac/MacOperatingSystem.java
  • CHANGELOG.md
  • oshi-common/src/main/java/oshi/hardware/common/platform/mac/package-info.java
🚧 Files skipped from review as they are similar to previous changes (4)
  • oshi-common/src/main/java/oshi/software/common/os/mac/MacOSThread.java
  • oshi-common/src/main/java/oshi/hardware/common/platform/mac/MacSoundCard.java
  • oshi-common/src/main/java/oshi/driver/common/mac/ThreadInfo.java
  • oshi-core/src/main/java/oshi/software/os/mac/MacOSProcess.java
📜 Recent review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Test JDK 25, windows-latest
  • GitHub Check: Test JDK 21, windows-latest
  • GitHub Check: Test JDK 11, windows-latest
  • GitHub Check: Test JDK 11, ubuntu-latest
  • GitHub Check: Test JDK 11, macos-latest
  • GitHub Check: Test JDK 21, macos-latest
  • GitHub Check: Test JDK 25, macos-latest
  • GitHub Check: Test JDK 25, ubuntu-latest
  • GitHub Check: Lint (Spotless, Checkstyle, ForbiddenAPIs, Javadoc)
  • GitHub Check: Analyze (java)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
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.
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:51.516Z
Learning: In the oshi/oshi project, the public API is strictly limited to interfaces and classes in the `oshi`, `oshi.hardware`, and `oshi.software.os` packages. All platform-specific code under subpackages like `oshi.software.os.linux`, `oshi.hardware.platform.linux`, etc., is considered implementation detail — not public API. Do not flag changes to platform-specific classes (e.g., making `LinuxOperatingSystem` abstract, narrowing constructor visibility, adding abstract methods) as public API breaks.
📚 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-java25/src/main/java/oshi/software/os/mac/MacOSProcessFFM.java
📚 Learning: 2026-04-06T21:48:11.921Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3122
File: oshi-core/src/main/java/oshi/hardware/platform/mac/MacUsbDeviceJNA.java:85-111
Timestamp: 2026-04-06T21:48:11.921Z
Learning: In `oshi-core/src/main/java/oshi/hardware/platform/mac/MacUsbDeviceJNA.java` (and `MacUsbDeviceFFM.java`), the `id = 0L` sentinel is intentional when `device.getParentEntry(IOSERVICE)` returns null. It acts as a catch-all controller group for devices whose controller cannot be identified (an edge case that "should never happen" given the IORegistry format). Do not flag this as a bug or suggest skipping such devices; the design intentionally avoids both silently dropping orphaned devices and placing them at the top level without a controller context.

Applied to files:

  • oshi-core-java25/src/main/java/oshi/software/os/mac/MacOSProcessFFM.java
📚 Learning: 2026-04-03T02:07:47.621Z
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:47.621Z
Learning: In OSHI’s Java FFM/API implementation classes (e.g., *FFM.java) that implement/override `updateAttributes()`, preserve the intentional failure-handling pattern: catch `Throwable` and return `false` without logging. `updateAttributes()` is a public API whose contract is to signal failure via the boolean return value, and callers rely on that return value (so emitting logs from this path is not desired and should not be introduced during review unless the method contract changes).

Applied to files:

  • oshi-core-java25/src/main/java/oshi/software/os/mac/MacOSProcessFFM.java
🔇 Additional comments (2)
oshi-core-java25/src/main/java/oshi/software/os/mac/MacOSProcessFFM.java (2)

15-15: Static PASSWD import remains correct and used.

No issue here; this import is required by the native passwd mapping path in updateAttributes().


86-92: Import migration to oshi-common is consistent and type-safe.

The new ThreadInfo and MacOSThread imports align with the class moves, and getThreadDetails() continues to satisfy the List<OSThread> contract.


📝 Walkthrough

Walkthrough

This PR moves three macOS-specific types (ThreadInfo, MacSoundCard, MacOSThread) into new oshi-common packages, exposes those packages in module-info.java, adjusts access modifiers for MacSoundCard, updates imports/usages across core modules, and adds package-info files and a changelog entry.

Changes

Cohort / File(s) Summary
Changelog & Config
CHANGELOG.md, config/checkstyle-suppressions.xml
Inserted changelog line for PR #3144; adjusted Checkstyle suppression line range for MacOperatingSystem.java.
Module exports
oshi-common/src/main/java/module-info.java
Exported three new packages: oshi.driver.common.mac, oshi.hardware.common.platform.mac, oshi.software.common.os.mac.
Driver package (mac)
oshi-common/src/main/java/oshi/driver/common/mac/ThreadInfo.java, oshi-common/src/main/java/oshi/driver/common/mac/package-info.java
Moved ThreadInfo to oshi.driver.common.mac; added package-info; minor re-scoping in ThreadStats switch (formatting/blocks only).
Hardware package (mac)
oshi-common/src/main/java/oshi/hardware/common/platform/mac/MacSoundCard.java, oshi-common/src/main/java/oshi/hardware/common/platform/mac/package-info.java
Moved MacSoundCard to oshi.hardware.common.platform.mac, made class and constructor public, added package-info.
Software package (mac)
oshi-common/src/main/java/oshi/software/common/os/mac/MacOSThread.java, oshi-common/src/main/java/oshi/software/common/os/mac/package-info.java
Moved MacOSThread to oshi.software.common.os.mac, updated copyright years, added package-info.
Consumers / Imports
oshi-core-java25/src/main/java/oshi/software/os/mac/MacOSProcessFFM.java, oshi-core/src/main/java/oshi/software/os/mac/MacOSProcess.java, oshi-core/src/main/java/oshi/software/os/mac/MacOperatingSystem.java, oshi-core/src/main/java/oshi/hardware/platform/mac/MacHardwareAbstractionLayer.java, oshi-core/src/test/java/oshi/driver/mac/ThreadInfoTest.java
Updated imports to new common packages; MacHardwareAbstractionLayer.getSoundCards() now delegates to MacSoundCard.getSoundCards(); thread-detail creation now constructs MacOSThread. Minor header year updates in some files.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 Hops through packages with glee,
ThreadInfo, SoundCard, OSThread roam free,
Moved to common, now easier to find,
Exports opened, imports realigned,
A little rabbit cheers—refactor jubilee! 🎉

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and specifically describes the main changes: moving three classes (ThreadInfo, MacSoundCard, MacOSThread) to oshi-common and setting up macOS packages.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
✨ Simplify code
  • Create PR with simplified code

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 and usage tips.

@codecov

codecov Bot commented Apr 12, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.91%. Comparing base (95f7083) to head (a416594).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3144      +/-   ##
============================================
- Coverage     62.00%   61.91%   -0.09%     
  Complexity       12       12              
============================================
  Files            39       39              
  Lines          2329     2329              
  Branches        407      407              
============================================
- Hits           1444     1442       -2     
+ Misses          776      771       -5     
- Partials        109      116       +7     

☔ View full report in Codecov by Sentry.
📢 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.

@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 the current code and only fix it if needed.

Inline comments:
In `@oshi-common/src/main/java/oshi/driver/common/mac/package-info.java`:
- Line 2: Update the copyright header in the package-info.java file to include
the current year range (e.g., change "Copyright (c) 2020-2022 The OSHI Project
Contributors" to "Copyright (c) 2020-2026 The OSHI Project Contributors"),
ensuring the header matches other files introduced/modified in this PR.
🪄 Autofix (Beta)

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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e59a8957-aea5-4f52-9eb4-c98cb0616284

📥 Commits

Reviewing files that changed from the base of the PR and between 95f7083 and 632e44d.

📒 Files selected for processing (14)
  • CHANGELOG.md
  • config/checkstyle-suppressions.xml
  • oshi-common/src/main/java/module-info.java
  • oshi-common/src/main/java/oshi/driver/common/mac/ThreadInfo.java
  • oshi-common/src/main/java/oshi/driver/common/mac/package-info.java
  • oshi-common/src/main/java/oshi/hardware/common/platform/mac/MacSoundCard.java
  • oshi-common/src/main/java/oshi/hardware/common/platform/mac/package-info.java
  • oshi-common/src/main/java/oshi/software/common/os/mac/MacOSThread.java
  • oshi-common/src/main/java/oshi/software/common/os/mac/package-info.java
  • oshi-core-java25/src/main/java/oshi/software/os/mac/MacOSProcessFFM.java
  • oshi-core/src/main/java/oshi/hardware/platform/mac/MacHardwareAbstractionLayer.java
  • oshi-core/src/main/java/oshi/software/os/mac/MacOSProcess.java
  • oshi-core/src/main/java/oshi/software/os/mac/MacOperatingSystem.java
  • oshi-core/src/test/java/oshi/driver/mac/ThreadInfoTest.java
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (9)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Test JDK 25, macos-latest
  • GitHub Check: Test JDK 21, windows-latest
  • GitHub Check: Test JDK 11, windows-latest
  • GitHub Check: Test JDK 25, windows-latest
  • GitHub Check: Test JDK 21, macos-latest
  • GitHub Check: Test JDK 11, macos-latest
  • GitHub Check: Analyze (java)
  • GitHub Check: Lint (Spotless, Checkstyle, ForbiddenAPIs, Javadoc)
🧰 Additional context used
🧠 Learnings (8)
📓 Common learnings
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.
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:51.516Z
Learning: In the oshi/oshi project, the public API is strictly limited to interfaces and classes in the `oshi`, `oshi.hardware`, and `oshi.software.os` packages. All platform-specific code under subpackages like `oshi.software.os.linux`, `oshi.hardware.platform.linux`, etc., is considered implementation detail — not public API. Do not flag changes to platform-specific classes (e.g., making `LinuxOperatingSystem` abstract, narrowing constructor visibility, adding abstract methods) as public API breaks.
📚 Learning: 2026-04-06T21:48:11.921Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3122
File: oshi-core/src/main/java/oshi/hardware/platform/mac/MacUsbDeviceJNA.java:85-111
Timestamp: 2026-04-06T21:48:11.921Z
Learning: In `oshi-core/src/main/java/oshi/hardware/platform/mac/MacUsbDeviceJNA.java` (and `MacUsbDeviceFFM.java`), the `id = 0L` sentinel is intentional when `device.getParentEntry(IOSERVICE)` returns null. It acts as a catch-all controller group for devices whose controller cannot be identified (an edge case that "should never happen" given the IORegistry format). Do not flag this as a bug or suggest skipping such devices; the design intentionally avoids both silently dropping orphaned devices and placing them at the top level without a controller context.

Applied to files:

  • oshi-core/src/test/java/oshi/driver/mac/ThreadInfoTest.java
  • oshi-core-java25/src/main/java/oshi/software/os/mac/MacOSProcessFFM.java
  • oshi-common/src/main/java/oshi/driver/common/mac/ThreadInfo.java
  • oshi-common/src/main/java/oshi/hardware/common/platform/mac/MacSoundCard.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/src/test/java/oshi/driver/mac/ThreadInfoTest.java
  • oshi-common/src/main/java/oshi/driver/common/mac/package-info.java
  • oshi-common/src/main/java/oshi/hardware/common/platform/mac/package-info.java
  • oshi-common/src/main/java/oshi/software/common/os/mac/package-info.java
  • oshi-core-java25/src/main/java/oshi/software/os/mac/MacOSProcessFFM.java
  • oshi-common/src/main/java/module-info.java
  • oshi-common/src/main/java/oshi/software/common/os/mac/MacOSThread.java
  • oshi-common/src/main/java/oshi/driver/common/mac/ThreadInfo.java
  • oshi-common/src/main/java/oshi/hardware/common/platform/mac/MacSoundCard.java
  • oshi-core/src/main/java/oshi/software/os/mac/MacOperatingSystem.java
📚 Learning: 2026-04-06T04:45:51.516Z
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:51.516Z
Learning: In the oshi/oshi project, the public API is strictly limited to interfaces and classes in the `oshi`, `oshi.hardware`, and `oshi.software.os` packages. All platform-specific code under subpackages like `oshi.software.os.linux`, `oshi.hardware.platform.linux`, etc., is considered implementation detail — not public API. Do not flag changes to platform-specific classes (e.g., making `LinuxOperatingSystem` abstract, narrowing constructor visibility, adding abstract methods) as public API breaks.

Applied to files:

  • oshi-core/src/test/java/oshi/driver/mac/ThreadInfoTest.java
  • oshi-common/src/main/java/oshi/driver/common/mac/package-info.java
  • oshi-common/src/main/java/oshi/hardware/common/platform/mac/package-info.java
  • oshi-common/src/main/java/oshi/software/common/os/mac/package-info.java
  • oshi-common/src/main/java/module-info.java
  • oshi-common/src/main/java/oshi/software/common/os/mac/MacOSThread.java
  • CHANGELOG.md
  • oshi-common/src/main/java/oshi/hardware/common/platform/mac/MacSoundCard.java
📚 Learning: 2026-04-03T02:07:47.621Z
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:47.621Z
Learning: In OSHI’s Java FFM/API implementation classes (e.g., *FFM.java) that implement/override `updateAttributes()`, preserve the intentional failure-handling pattern: catch `Throwable` and return `false` without logging. `updateAttributes()` is a public API whose contract is to signal failure via the boolean return value, and callers rely on that return value (so emitting logs from this path is not desired and should not be introduced during review unless the method contract changes).

Applied to files:

  • oshi-core-java25/src/main/java/oshi/software/os/mac/MacOSProcessFFM.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/hardware/platform/mac/MacHardwareAbstractionLayer.java
  • oshi-core/src/main/java/oshi/software/os/mac/MacOSProcess.java
  • oshi-core/src/main/java/oshi/software/os/mac/MacOperatingSystem.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/hardware/platform/mac/MacHardwareAbstractionLayer.java
📚 Learning: 2026-04-08T17:30:11.929Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3127
File: CHANGELOG.md:3-3
Timestamp: 2026-04-08T17:30:11.929Z
Learning: In the oshi/oshi repository's `CHANGELOG.md`, the standard layout uses `#` (h1) for release version headers and `#####` (h5) for subsection headers such as "New Features" and "Bug fixes / Improvements". This intentional heading level skip is the project's established convention and should not be flagged as a markdownlint MD001 violation.

Applied to files:

  • CHANGELOG.md
🔇 Additional comments (13)
config/checkstyle-suppressions.xml (1)

41-41: Suppression range update looks correct.

The VisibilityModifier suppression now matches the shifted field declaration lines in MacOperatingSystem.java.

CHANGELOG.md (1)

20-20: Changelog entry is clear and consistent.

This addition accurately documents the macOS class split into oshi-common.

oshi-common/src/main/java/oshi/driver/common/mac/ThreadInfo.java (1)

5-5: Package move preserves behavior.

ThreadInfo relocation is clean, and the thread-state mapping logic remains intact.

Also applies to: 80-98

oshi-common/src/main/java/oshi/hardware/common/platform/mac/MacSoundCard.java (1)

20-20: Visibility update is appropriate for the package split.

Making the class and constructor public enables the intended cross-package construction after relocation.

Also applies to: 31-31

oshi-core/src/test/java/oshi/driver/mac/ThreadInfoTest.java (1)

15-15: Test import update is correct.

The test now references the relocated ThreadInfo type from oshi-common.

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

86-86: Import migration is consistent with the refactor.

MacOSProcessFFM now correctly depends on relocated ThreadInfo and MacOSThread classes.

Also applies to: 91-91

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

28-28: getCurrentThread() fallback wiring is correct.

The fallback now instantiates the relocated MacOSThread implementation from oshi-common.

Also applies to: 133-137

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

42-47: Import migration is consistent and safe.

Line 42 and Line 47 correctly point to the relocated oshi-common macOS classes, and the existing getThreadDetails() construction path remains compatible.

oshi-common/src/main/java/module-info.java (1)

8-8: Module exports correctly match relocated packages.

The new exports cleanly enable access to the moved macOS common classes without unrelated module-surface changes.

Also applies to: 13-13, 18-18

oshi-common/src/main/java/oshi/software/common/os/mac/MacOSThread.java (1)

2-2: MacOSThread relocation looks clean.

The package move and header update are consistent with the new oshi-common structure, with no logic regression.

Also applies to: 5-5

oshi-common/src/main/java/oshi/hardware/common/platform/mac/package-info.java (1)

1-8: Good package metadata addition.

Adding package-info.java here keeps the new macOS common hardware package documented and consistent with module exports.

oshi-common/src/main/java/oshi/software/common/os/mac/package-info.java (1)

1-8: Package documentation is aligned with the refactor.

This package-info.java addition is consistent with the new macOS software-common package setup.

oshi-core/src/main/java/oshi/hardware/platform/mac/MacHardwareAbstractionLayer.java (1)

14-14: MacSoundCard import update is correct.

Line 14 correctly targets the relocated class, and getSoundCards() delegation remains fully compatible.

@dbwiddis
dbwiddis merged commit d6a8095 into oshi:master Apr 12, 2026
15 of 16 checks passed
@dbwiddis
dbwiddis deleted the mac-common-split branch April 12, 2026 03:22
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