Repository navigation
Merge oshi-core-java11 into oshi-core; add module descriptor and redirection pom - #3181
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (36)
💤 Files with no reviewable changes (3)
✅ Files skipped from review due to trivial changes (11)
🚧 Files skipped from review as they are similar to previous changes (17)
📜 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). (1)
🧰 Additional context used🧠 Learnings (4)📓 Common learnings📚 Learning: 2026-03-29T20:01:06.452ZApplied to files:
📚 Learning: 2026-04-06T04:45:51.516ZApplied to files:
📚 Learning: 2026-04-08T17:30:11.929ZApplied to files:
🪛 LanguageToolREADME.md[uncategorized] ~14-~14: The official name of this software platform is spelled with a capital “H”. (GITHUB) src/site/markdown/Upgrading.md[uncategorized] ~33-~33: The official name of this software platform is spelled with a capital “H”. (GITHUB) src/site/markdown/index.md[uncategorized] ~14-~14: The official name of this software platform is spelled with a capital “H”. (GITHUB) 🔇 Additional comments (8)
📝 WalkthroughWalkthroughConsolidates Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches✨ Simplify 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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3181 +/- ##
==========================================
- Coverage 57.34% 57.31% -0.03%
==========================================
Files 424 424
Lines 20346 20346
Branches 3577 3577
==========================================
- Hits 11667 11661 -6
- Misses 6911 6921 +10
+ Partials 1768 1764 -4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
oshi-core/pom.xml (1)
131-131: Use-nosubstitution: trueto disable package substitution globally.The concern about clause-scoped directives is valid—only
oshi.util.platform.*currently has-noimport:=true, leaving the other exported packages substitutable. However, rather than adding-noimport:=trueto each clause individually (which is error-prone), the bnd best practice is to use the global-nosubstitution: trueinstruction. This achieves the same effect more reliably and is the recommended approach for library bundles.Add
-nosubstitution: trueto the bnd configuration (e.g., before or after theExport-Packageline) instead of manually applying the directive to each clause.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@oshi-core/pom.xml` at line 131, Replace the per-clause directive approach for package substitution by adding the global bnd instruction -nosubstitution: true to the bnd configuration so Export-Package (and other package clauses) are not subject to substitution; locate the Export-Package clause shown (the CDATA containing "Export-Package: oshi.jna.*,...oshi.util.platform.*;-noimport:=true") and insert the global -nosubstitution: true instruction in the same bnd section (before or after the Export-Package entry) instead of relying on clause-scoped -noimport:=true markers.
🤖 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-core-java11/pom.xml`:
- Around line 12-23: The current POM publishes oshi-core-java11 as a POM-only
artifact but lacks Maven relocation, so consumers trying to resolve the jar will
fail; update the POM to add a <distributionManagement><relocation> entry that
relocates the old coordinates (artifactId oshi-core-java11, groupId
${project.groupId}, version ${project.version}) to the new target artifact
(artifactId oshi-core, same groupId and version), include a clear relocation
message indicating the module is deprecated and now provided by oshi-core, and
ensure the relocation block is placed under <distributionManagement> so Maven
clients are redirected transparently.
---
Nitpick comments:
In `@oshi-core/pom.xml`:
- Line 131: Replace the per-clause directive approach for package substitution
by adding the global bnd instruction -nosubstitution: true to the bnd
configuration so Export-Package (and other package clauses) are not subject to
substitution; locate the Export-Package clause shown (the CDATA containing
"Export-Package: oshi.jna.*,...oshi.util.platform.*;-noimport:=true") and insert
the global -nosubstitution: true instruction in the same bnd section (before or
after the Export-Package entry) instead of relying on clause-scoped
-noimport:=true markers.
🪄 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: aa745845-c9de-4d76-b50e-12aa45d5d7bc
📒 Files selected for processing (34)
CHANGELOG.mdREADME.mdoshi-common/pom.xmloshi-core-java11/pom.xmloshi-core-java11/src/site/site.xmloshi-core/pom.xmloshi-core/src/main/java/module-info.javaoshi-core/src/test/java/module-info.testoshi-core/src/test/java/oshi/hardware/platform/shared/CentralProcessorTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/ComputerSystemTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/DisksTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/DisplayTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/GlobalMemoryTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/GpuStatsTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/GraphicsCardTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/NetworksTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/PowerSourceTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/PrinterTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/SensorsTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/SoundCardTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/UsbDeviceTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/VirtualMemoryTest.javaoshi-core/src/test/java/oshi/software/os/shared/ApplicationInfoTest.javaoshi-core/src/test/java/oshi/software/os/shared/FileSystemTest.javaoshi-core/src/test/java/oshi/software/os/shared/InternetProtocolStatsTest.javaoshi-core/src/test/java/oshi/software/os/shared/NetworkParamsTest.javaoshi-core/src/test/java/oshi/software/os/shared/OperatingSystemTest.javaoshi-core/src/test/java/oshi/util/platform/unix/freebsd/ProcstatUtilTest.javaoshi-core/src/test/java/oshi/util/platform/unix/openbsd/FstatUtilTest.javaoshi-dist/pom.xmloshi-dist/src/assembly/assembly.xmlpom.xmlsrc/site/markdown/Upgrading.mdsrc/site/markdown/index.md
💤 Files with no reviewable changes (3)
- oshi-core-java11/src/site/site.xml
- oshi-dist/pom.xml
- oshi-dist/src/assembly/assembly.xml
📜 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). (12)
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: Test JDK 25, ubuntu-latest (+ JNA==FFM)
- GitHub Check: Analyze (java)
- GitHub Check: Test JDK 25, windows-latest (+ JNA==FFM)
- GitHub Check: Test JDK 21, ubuntu-latest
- GitHub Check: Test JDK 11, ubuntu-latest
- GitHub Check: Test JDK 11, macos-latest
- GitHub Check: Test JDK 25, macos-latest (+ JNA==FFM)
- GitHub Check: Test JDK 21, windows-latest
- GitHub Check: Test JDK 21, macos-latest
- GitHub Check: Test JDK 11, windows-latest
- GitHub Check: Lint (Spotless, Checkstyle, ForbiddenAPIs, Javadoc)
🧰 Additional context used
🧠 Learnings (15)
📓 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.
📚 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/software/os/shared/NetworkParamsTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/NetworksTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/GlobalMemoryTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/UsbDeviceTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/SensorsTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/SoundCardTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/PrinterTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/VirtualMemoryTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/PowerSourceTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/CentralProcessorTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/GraphicsCardTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/DisksTest.javaoshi-core/src/test/java/oshi/software/os/shared/FileSystemTest.javaoshi-core/src/test/java/oshi/util/platform/unix/openbsd/FstatUtilTest.javaoshi-core/src/main/java/module-info.javaoshi-core/src/test/java/oshi/software/os/shared/InternetProtocolStatsTest.javaoshi-core/src/test/java/oshi/software/os/shared/ApplicationInfoTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/DisplayTest.javaREADME.mdoshi-core/src/test/java/oshi/hardware/platform/shared/GpuStatsTest.javasrc/site/markdown/index.mdpom.xmlCHANGELOG.mdoshi-core/src/test/java/oshi/software/os/shared/OperatingSystemTest.javaoshi-core/src/test/java/module-info.testoshi-common/pom.xmloshi-core-java11/pom.xmloshi-core/src/test/java/oshi/hardware/platform/shared/ComputerSystemTest.javasrc/site/markdown/Upgrading.md
📚 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/software/os/shared/NetworkParamsTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/NetworksTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/GlobalMemoryTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/UsbDeviceTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/SensorsTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/SoundCardTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/PrinterTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/VirtualMemoryTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/PowerSourceTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/CentralProcessorTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/GraphicsCardTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/DisksTest.javaoshi-core/src/test/java/oshi/software/os/shared/FileSystemTest.javaoshi-core/src/test/java/oshi/util/platform/unix/openbsd/FstatUtilTest.javaoshi-core/src/main/java/module-info.javaoshi-core/src/test/java/oshi/software/os/shared/InternetProtocolStatsTest.javaoshi-core/src/test/java/oshi/software/os/shared/ApplicationInfoTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/DisplayTest.javaREADME.mdoshi-core/src/test/java/oshi/hardware/platform/shared/GpuStatsTest.javasrc/site/markdown/index.mdpom.xmloshi-core/src/test/java/oshi/util/platform/unix/freebsd/ProcstatUtilTest.javaCHANGELOG.mdoshi-core/src/test/java/oshi/software/os/shared/OperatingSystemTest.javaoshi-core/src/test/java/module-info.testoshi-common/pom.xmloshi-core-java11/pom.xmloshi-core/src/test/java/oshi/hardware/platform/shared/ComputerSystemTest.javasrc/site/markdown/Upgrading.mdoshi-core/pom.xml
📚 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/test/java/oshi/software/os/shared/NetworkParamsTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/VirtualMemoryTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/DisksTest.javaoshi-core/src/test/java/oshi/util/platform/unix/openbsd/FstatUtilTest.javaoshi-core/src/test/java/oshi/software/os/shared/OperatingSystemTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/ComputerSystemTest.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/test/java/oshi/software/os/shared/NetworkParamsTest.javaoshi-core/src/test/java/oshi/software/os/shared/ApplicationInfoTest.java
📚 Learning: 2026-04-18T03:18:03.725Z
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:03.725Z
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/src/test/java/oshi/software/os/shared/NetworkParamsTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/NetworksTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/GlobalMemoryTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/UsbDeviceTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/SensorsTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/SoundCardTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/PrinterTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/VirtualMemoryTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/PowerSourceTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/CentralProcessorTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/GraphicsCardTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/DisksTest.javaoshi-core/src/test/java/oshi/software/os/shared/FileSystemTest.javaoshi-core/src/test/java/oshi/software/os/shared/InternetProtocolStatsTest.javaoshi-core/src/test/java/oshi/software/os/shared/ApplicationInfoTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/DisplayTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/GpuStatsTest.javaoshi-core/src/test/java/oshi/util/platform/unix/freebsd/ProcstatUtilTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/ComputerSystemTest.java
📚 Learning: 2026-04-19T01:28:43.529Z
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:43.529Z
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/src/test/java/oshi/hardware/platform/shared/NetworksTest.java
📚 Learning: 2026-04-11T05:51:52.684Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3139
File: oshi-core-java25/src/main/java/oshi/hardware/platform/linux/LinuxGpuStatsFFM.java:36-58
Timestamp: 2026-04-11T05:51:52.684Z
Learning: In OSHI's `LinuxGpuStats` (oshi-common/src/main/java/oshi/hardware/common/platform/linux/LinuxGpuStats.java), the abstract `nvml*` methods (nvmlGetVramUsed, nvmlGetCoreClockMhz, nvmlGetMemoryClockMhz, nvmlGetTemperature, nvmlGetPowerDraw, nvmlGetFanSpeedPercent) are contractually expected to return `-1` (long or double) on failure. The base class applies `if (val >= 0)` guards before using any NVML result and falls through to sysfs/hwmon paths when negative. Subclasses (LinuxGpuStatsJNA, LinuxGpuStatsFFM) correctly pass through the -1 sentinel unchanged — do not flag this as a missing clamp or contract violation.
Applied to files:
oshi-core/src/test/java/oshi/hardware/platform/shared/NetworksTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/DisplayTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/GpuStatsTest.java
📚 Learning: 2026-04-08T00:58:10.736Z
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:10.736Z
Learning: In `oshi-core/src/main/java/oshi/hardware/platform/windows/WindowsPowerSourceJNA.java` and `oshi-core-java25/src/main/java/oshi/hardware/platform/windows/WindowsPowerSourceFFM.java`, the `getPowerSources()` method intentionally returns a singleton list wrapping a single `getPowerSource("System Battery")` call, and the enumeration loop short-circuits after the first eligible battery pack. This matches the longstanding JNA behavior and is not a bug. A broader refactor to support zero-or-more batteries across both implementations is planned for a later date. Do not flag this as an issue.
Applied to files:
oshi-core/src/test/java/oshi/hardware/platform/shared/GlobalMemoryTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/UsbDeviceTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/SoundCardTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/VirtualMemoryTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/PowerSourceTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/DisksTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/ComputerSystemTest.java
📚 Learning: 2026-04-06T22:30:07.083Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3122
File: oshi-core/src/main/java/oshi/hardware/platform/mac/MacUsbDeviceJNA.java:215-234
Timestamp: 2026-04-06T22:30:07.083Z
Learning: In `oshi-core/src/main/java/oshi/hardware/platform/mac/MacUsbDeviceJNA.java`, the `found` flag in `getControllerIdByLocation` is intentionally set to `true` as soon as either `vendor-id` or `device-id` is found in a matching service's parent. This is a deliberate design choice: a partial match (one of the two IDs) is preferred over continuing to iterate, because iterating further risks pairing IDs from two different and potentially mismatched services. Do not flag this as a bug or suggest splitting into separate `foundVendor`/`foundProduct` flags.
Applied to files:
oshi-core/src/test/java/oshi/hardware/platform/shared/GlobalMemoryTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/SensorsTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/SoundCardTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/CentralProcessorTest.java
📚 Learning: 2026-04-05T15:37:17.867Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3117
File: oshi-core-java25/src/main/java/oshi/hardware/platform/linux/LinuxUsbDeviceFFM.java:59-65
Timestamp: 2026-04-05T15:37:17.867Z
Learning: In OSHI's Linux USB device implementations (LinuxUsbDeviceFFM, and the JNA equivalent), when `getUsbDevices(boolean tree)` is called with `tree=false`, the returned flat list intentionally **includes** controller nodes — it does not exclude them. The existing Javadoc that says "returns a flat list excluding controllers" is incorrect. Do not flag the implementation for including controllers in flat mode; instead, flag only the Javadoc if it claims controllers are excluded.
Applied to files:
oshi-core/src/test/java/oshi/hardware/platform/shared/UsbDeviceTest.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/src/test/java/oshi/hardware/platform/shared/UsbDeviceTest.java
📚 Learning: 2026-04-14T23:28:18.252Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3160
File: oshi-common/src/test/java/oshi/hardware/common/platform/linux/LinuxSensorsTest.java:34-40
Timestamp: 2026-04-14T23:28:18.252Z
Learning: In oshi/oshi, `vcgencmd` (used in `LinuxSensors.queryCpuTemperatureFromVcGenCmd()` and related methods) is a Raspberry Pi-specific binary. It will never be present on standard x86/amd64 CI runners or developer machines. Tests that pass `isPi=true` to `LinuxSensors` and assert 0/empty returns are deterministic in practice; do not flag them as potentially flaky due to `vcgencmd` availability.
Applied to files:
oshi-core/src/test/java/oshi/hardware/platform/shared/SensorsTest.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/test/java/oshi/hardware/platform/shared/SoundCardTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/PrinterTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/VirtualMemoryTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/DisksTest.javaoshi-core/src/test/java/oshi/util/platform/unix/openbsd/FstatUtilTest.javaoshi-core/src/test/java/oshi/hardware/platform/shared/GpuStatsTest.javaoshi-core/src/test/java/oshi/util/platform/unix/freebsd/ProcstatUtilTest.javaoshi-core/src/test/java/oshi/software/os/shared/OperatingSystemTest.javaoshi-core/src/test/java/module-info.testoshi-core/src/test/java/oshi/hardware/platform/shared/ComputerSystemTest.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:
README.mdsrc/site/markdown/index.mdCHANGELOG.mdsrc/site/markdown/Upgrading.md
🪛 LanguageTool
README.md
[uncategorized] ~14-~14: The official name of this software platform is spelled with a capital “H”.
Context: ...ess/jna). Supports JDK 8+. JPMS module: com.github.oshi. - FFM (oshi-core-ffm): Use...
(GITHUB)
src/site/markdown/index.md
[uncategorized] ~14-~14: The official name of this software platform is spelled with a capital “H”.
Context: ...ess/jna). Supports JDK 8+. JPMS module: com.github.oshi. - FFM (oshi-core-ffm): Use...
(GITHUB)
src/site/markdown/Upgrading.md
[uncategorized] ~33-~33: The official name of this software platform is spelled with a capital “H”.
Context: ... declared an Automatic-Module-Name of com.github.oshi in its manifest but had no module...
(GITHUB)
🔇 Additional comments (24)
oshi-core/src/test/java/oshi/util/platform/unix/freebsd/ProcstatUtilTest.java (1)
5-17: LGTM — clean relocation to the FreeBSD util package.Now in the same package as
ProcstatUtil, so no import needed there, andoshi.util.PlatformEnum(non-deprecated) is used correctly. Aligns with the JPMS split-package avoidance goal of this PR.oshi-core/src/test/java/oshi/software/os/shared/ApplicationInfoTest.java (1)
5-23: LGTM.Package move to
oshi.software.os.sharedwith the explicitApplicationInfoimport is consistent with the other relocated OS tests in this PR.oshi-core/src/test/java/oshi/software/os/shared/NetworkParamsTest.java (1)
5-14: LGTM.Package relocation and the added
NetworkParamsimport are correct.oshi-core/src/test/java/oshi/software/os/shared/FileSystemTest.java (1)
5-17: LGTM.Relocation plus the explicit
FileSystem/OSFileStoreimports correctly decouple the test from its previous in-package access.oshi-core/src/test/java/oshi/software/os/shared/InternetProtocolStatsTest.java (1)
5-26: LGTM.Top-level
InternetProtocolStatsimport added alongside the existing nested-type imports — matches the new package location.oshi-core/src/test/java/oshi/software/os/shared/OperatingSystemTest.java (1)
5-51: LGTM — imports updated cleanly for the package move.All the now-required production types (
OperatingSystem,OSProcess,OSService,OSSession,OSThread,OSDesktopWindow) are imported, and the existing nested-type imports (OSVersionInfo,ProcessFiltering,ProcessSorting) remain correctly anchored toOperatingSystem.oshi-core/src/test/java/oshi/hardware/platform/shared/GlobalMemoryTest.java (1)
5-25: LGTM.Move to
oshi.hardware.platform.sharedwith theGlobalMemory/PhysicalMemoryimports is consistent with the other hardware test relocations.oshi-core/src/test/java/oshi/hardware/platform/shared/SoundCardTest.java (1)
5-14: LGTM.Package relocation and
SoundCardimport are correct.oshi-core/src/test/java/oshi/hardware/platform/shared/UsbDeviceTest.java (1)
5-5: Package relocation looks good.The new shared test package matches the file path, and the explicit
UsbDeviceimport keeps the test referencing the production API cleanly after the move.Also applies to: 18-18
oshi-core/src/test/java/oshi/hardware/platform/shared/PrinterTest.java (1)
5-5: Package move is consistent.The test now lives under the shared platform test namespace and imports
Printerexplicitly, which is the right adjustment after leaving the original package.Also applies to: 14-14
oshi-core/src/test/java/oshi/hardware/platform/shared/NetworksTest.java (1)
5-5: Shared test namespace update looks correct.The package declaration and explicit
NetworkIFimport align with the JPMS split-package cleanup without changing the test behavior.Also applies to: 18-18
oshi-core/src/test/java/oshi/hardware/platform/shared/PowerSourceTest.java (1)
5-5: Package/import relocation is clean.The test package now matches the shared test path, and the explicit
PowerSourceimport preserves the original API reference.Also applies to: 19-19
oshi-core/src/test/java/oshi/hardware/platform/shared/SensorsTest.java (1)
5-5: Relocation is aligned with the shared test package.The
Sensorsimport is the expected follow-up to moving this test out ofoshi.hardware.Also applies to: 19-19
CHANGELOG.md (1)
8-8: Changelog entry is clear.This captures both the
oshi-core-java11merge intooshi-coreand the migration path via the redirection POM.oshi-core/src/test/java/oshi/hardware/platform/shared/VirtualMemoryTest.java (1)
5-5: Virtual memory test relocation is covered.The package matches the shared test namespace, and the added imports make the API dependencies explicit after the package move.
Also applies to: 17-19
oshi-core/src/main/java/module-info.java (1)
16-16: Openingoshi.jna.commonis the right JPMS adjustment.
oshi.jna.commoncontains JNAStructurebindings, so grantingcom.sun.jnareflective access matches the existing module descriptor pattern.oshi-core/src/test/java/oshi/hardware/platform/shared/DisksTest.java (1)
2-2: Package move and imports look consistent.The new test package matches the directory layout, and the explicit hardware imports keep the moved test resolving the same public API types.
Also applies to: 5-5, 20-21
oshi-core/src/test/java/oshi/hardware/platform/shared/GraphicsCardTest.java (1)
5-5: Package/import update aligns with the JPMS test layout.This matches the
oshi.hardware.platform.sharedtest package opened inoshi-core/src/test/java/module-info.test, and the added imports are the expected public hardware API types.Also applies to: 15-16
oshi-core/src/test/java/oshi/util/platform/unix/openbsd/FstatUtilTest.java (1)
5-5: OpenBSD test relocation looks good.The package now matches the OpenBSD-specific path, and the added
PlatformEnumimport preserves the existing platform guard while allowing same-package access toFstatUtil.Also applies to: 17-17
oshi-core/src/test/java/oshi/hardware/platform/shared/CentralProcessorTest.java (1)
5-5: Central processor test move is clean.The package relocation is consistent with the shared hardware test layout, and the explicit
CentralProcessorimport correctly replaces the previous same-package resolution.Also applies to: 25-25
src/site/markdown/index.md (1)
14-14: Docs match theoshi-coreJPMS consolidation.The module name, API link, and download labels are consistent with moving the JPMS descriptor into
oshi-core; keepingcom.github.oshilowercase is correct for the module identifier.Also applies to: 26-26, 37-37, 43-43
oshi-core/src/test/java/oshi/hardware/platform/shared/GpuStatsTest.java (1)
5-5: GPU stats test imports are correct after the package move.The moved test now explicitly imports the public GPU API types it uses, with no change to the lifecycle/sentinel assertions.
Also applies to: 24-26
oshi-core/src/test/java/oshi/hardware/platform/shared/ComputerSystemTest.java (1)
2-2: Computer system test relocation looks consistent.The package path and added imports line up with the shared hardware test namespace, while keeping the assertions on the same public API types.
Also applies to: 5-5, 18-20
oshi-core/src/test/java/oshi/hardware/platform/shared/DisplayTest.java (1)
2-2: Display test move is straightforward.The new package matches the shared hardware test location, and the explicit
Displayimport preserves the same API reference.Also applies to: 5-5, 16-16
0b3bd03 to
a9512a9
Compare
This PR eliminates the separate
oshi-core-java11artifact by adding amodule-info.javadirectly tooshi-core(compiled at release 9, all other classes at release 8).Changes
module-info.javaandmodule-info.testtooshi-core, using the same dual-compilation approach asoshi-commonoshi-corefromjna/jna-platformtojna-jpms/jna-platform-jpmsdependencies to avoid automatic module warningsExport-Packageoverride inoshi-coreto prevent split-package issues withoshi-commonoshi-commonto remove unusedjLibreHardwareMonitorimport warning-split-package:=merge-firstfrom parent bnd config (no longer needed)Automatic-Module-Namemanifest entry with proper module descriptoroshi.hardware→oshi.hardware.platform.sharedoshi.software.os→oshi.software.os.sharedoshi.util.FstatUtilTest→oshi.util.platform.unix.openbsdoshi.util.ProcstatUtilTest→oshi.util.platform.unix.freebsdoshi-core-java11source; recreate as a redirection pom tooshi-coreSummary by CodeRabbit
Breaking Changes
oshi-core-java11consolidated intooshi-core; redirection POM added for compatibility.New Features
oshi-coreships with a JPMS module name (com.github.oshi) and OSGi bundle metadata.Documentation
Tests