Repository navigation
Move shared Unix drivers to oshi.driver.common.unix.* - #3351
Conversation
Sweeps the older Unix ports to match the AIX convention established in #3350. The shared (oshi-common) drivers for BSD, FreeBSD, and Solaris were sitting at the top-level `oshi.driver.unix.<os>` namespace, which worked only because the JNA-only drivers in oshi-core happened to live in disjoint sub-packages (e.g. oshi-core's `oshi.driver.unix.solaris` holds `PsInfo`/`Who`, oshi-common's `oshi.driver.unix.solaris.disk` holds `Iostat`/`Lshal`/`Prtvtoc` — different Java packages, no split). The new convention puts every oshi-common driver under `oshi.driver.common.unix.<os>[.sub]`, mirroring `oshi.driver.common.mac` and `oshi.driver.common.windows.*` and avoiding the top-level-namespace-shared-across-modules fragility. Moved (oshi-common): * oshi.driver.unix.bsd.Systat -> oshi.driver.common.unix.bsd.Systat * oshi.driver.unix.bsd.disk.Disklabel -> oshi.driver.common.unix.bsd.disk.Disklabel * oshi.driver.unix.freebsd.disk.{GeomDiskList,GeomPartList,Mount} -> oshi.driver.common.unix.freebsd.disk.* * oshi.driver.unix.solaris.disk.{Iostat,Lshal,Prtvtoc} -> oshi.driver.common.unix.solaris.disk.* * Tests follow their drivers under oshi-common/src/test/java/oshi/driver/common/unix/... Updated: * Consumer imports in 8 hardware classes across oshi-common, oshi-core, and oshi-core-ffm (FreeBsd/OpenBsd/NetBsd/Solaris HW disk/sensors/ power source FFM + JNA peers). * oshi-common module-info.java exports: the four old `oshi.driver.unix.*` entries replaced by their `oshi.driver.common.unix.*` equivalents, sorted alphabetically. * oshi-common module-info.test add-opens: matching package renames so JUnit Platform can still introspect each test class. * oshi-core and oshi-core-ffm bnd Export-Package globs: the moved packages are now covered by the existing `!oshi.driver.common.*` exclude, so the explicit `!oshi.driver.unix.{bsd,freebsd.disk,solaris.disk}.*` overrides drop out. Pure refactor — no public API surface changes (everything in the moved packages was already shared between oshi-common consumers; the exported package names change but the class names don't). Full `mvn clean install` green through oshi-dist; bnd manifests show the new export paths with no leaks of the old paths.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (29)
📜 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). (14)
🧰 Additional context used🧠 Learnings (10)📓 Common learnings📚 Learning: 2026-03-29T20:01:06.452ZApplied to files:
📚 Learning: 2026-04-06T04:45:47.644ZApplied to files:
📚 Learning: 2026-05-31T04:49:19.668ZApplied to files:
📚 Learning: 2026-04-06T04:45:51.516ZApplied to files:
📚 Learning: 2026-04-12T19:22:09.716ZApplied to files:
📚 Learning: 2026-04-03T18:44:48.200ZApplied to files:
📚 Learning: 2026-04-08T00:58:10.736ZApplied to files:
📚 Learning: 2026-04-03T18:43:51.290ZApplied to files:
📚 Learning: 2026-04-03T02:07:49.467ZApplied to files:
🔇 Additional comments (29)
📝 WalkthroughWalkthroughThis PR consolidates Unix/BSD disk driver utilities by relocating classes from ChangesUnix Driver Package Consolidation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3351 +/- ##
============================================
- Coverage 74.95% 74.94% -0.01%
Complexity 76 76
============================================
Files 602 602
Lines 25845 25845
Branches 3990 3990
============================================
- Hits 19371 19369 -2
+ Misses 4221 4217 -4
- Partials 2253 2259 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
Sweeps the older Unix ports to match the AIX convention established in #3350. The shared (
oshi-common) drivers for BSD, FreeBSD, and Solaris were sitting at the top-leveloshi.driver.unix.<os>namespace, which worked only because the JNA-only drivers inoshi-corehappened to live in disjoint sub-packages (e.g.oshi-core'soshi.driver.unix.solarisholdsPsInfo/Who,oshi-common'soshi.driver.unix.solaris.diskholdsIostat/Lshal/Prtvtoc— different Java packages, no split). The new convention puts everyoshi-commondriver underoshi.driver.common.unix.<os>[.sub], mirroringoshi.driver.common.macandoshi.driver.common.windows.*and avoiding the top-level-namespace-shared-across-modules fragility.Moves
In
oshi-common/src/main/java:oshi.driver.unix.bsd.Systat→oshi.driver.common.unix.bsd.Systatoshi.driver.unix.bsd.disk.Disklabel→oshi.driver.common.unix.bsd.disk.Disklabeloshi.driver.unix.freebsd.disk.{GeomDiskList,GeomPartList,Mount}→oshi.driver.common.unix.freebsd.disk.*oshi.driver.unix.solaris.disk.{Iostat,Lshal,Prtvtoc}→oshi.driver.common.unix.solaris.disk.*Tests follow their drivers under
oshi-common/src/test/java/oshi/driver/common/unix/....Updated
oshi-common,oshi-core, andoshi-core-ffm(the FreeBSD/OpenBSD/NetBSD/SolarisHWDiskStore/Sensors/PowerSourcepeers, both JNA and FFM).oshi-common/src/main/java/module-info.javaexports: the four oldoshi.driver.unix.*entries replaced by theiroshi.driver.common.unix.*equivalents, sorted alphabetically.oshi-common/src/test/java/module-info.test--add-opensdirectives: matching package renames so JUnit Platform can still introspect each test class.oshi-core/pom.xmlandoshi-core-ffm/pom.xmlbndExport-Packageglobs: the moved packages are now covered by the existing!oshi.driver.common.*exclude, so the explicit!oshi.driver.unix.{bsd,freebsd.disk,solaris.disk}.*overrides drop out.Notes
oshi-commonconsumers; the exported package names change but the class names don't).oshi-corepackages move. Theoshi.driver.unix.aixJNA-only package (PsInfoJNA+ theperfstat/Perfstat*JNAdrivers) stays put, as dooshi.driver.unix.freebsd.Whoandoshi.driver.unix.solaris.{PsInfo,Who,kstat.SystemPages}.Test plan
./mvnw clean install -Djacoco.skip=truegreen throughoshi-dist(where bnd conflicts typically surface)oshi-commonexports the four new paths, nooshi.driver.unix.{bsd,freebsd,solaris}leaks from any moduleoshi-commontests pass undermvn clean install🤖 Generated with Claude Code
Summary by CodeRabbit