Repository navigation
Add @PublicApi annotation to semver-guaranteed API types - #3183
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 (37)
✅ Files skipped from review due to trivial changes (31)
🚧 Files skipped from review as they are similar to previous changes (5)
📜 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). (10)
🧰 Additional context used🧠 Learnings (4)📓 Common learnings📚 Learning: 2026-04-06T04:45:51.516ZApplied to files:
📚 Learning: 2026-03-29T20:01:06.452ZApplied to files:
📚 Learning: 2026-04-12T19:22:09.716ZApplied to files:
🔇 Additional comments (1)
📝 WalkthroughWalkthroughAdded a new Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
oshi-common/src/main/java/oshi/software/os/OperatingSystem.java (1)
16-16: LGTM — one optional thought on nested types.
@PublicApionOperatingSystemlooks great. One thing worth considering: the nestedOSVersionInfoclass (and, to a lesser extent, theProcessFiltering/ProcessSortingconstant holders) are reachable through the public API surface (e.g.getVersionInfo()returnsOSVersionInfo). Depending on howjapicmp-maven-pluginis configured to discover@PublicApi-annotated types, nested types may or may not inherit that coverage automatically.If the plan is for japicmp to scan annotated types specifically (rather than whole packages), you may want to either annotate
OSVersionInfodirectly or document that nested public types of a@PublicApitype are implicitly covered. Not blocking for this PR — easy to address alongside the japicmp enablement after 7.0.0.Also applies to: 29-31, 388-443
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@oshi-common/src/main/java/oshi/software/os/OperatingSystem.java` at line 16, The PublicApi annotation is applied to the OperatingSystem interface but nested public types like OSVersionInfo (returned by getVersionInfo()) and the ProcessFiltering/ProcessSorting holders may not be recognized by japicmp when it scans only annotated types; to ensure they are included in the public API contract, explicitly annotate the nested types (e.g., annotate OSVersionInfo and the ProcessFiltering/ProcessSorting classes) with `@PublicApi` or add documentation stating nested public types are covered by OperatingSystem’s annotation so japicmp will include them when comparing APIs.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@oshi-common/src/main/java/oshi/software/os/OperatingSystem.java`:
- Line 16: The PublicApi annotation is applied to the OperatingSystem interface
but nested public types like OSVersionInfo (returned by getVersionInfo()) and
the ProcessFiltering/ProcessSorting holders may not be recognized by japicmp
when it scans only annotated types; to ensure they are included in the public
API contract, explicitly annotate the nested types (e.g., annotate OSVersionInfo
and the ProcessFiltering/ProcessSorting classes) with `@PublicApi` or add
documentation stating nested public types are covered by OperatingSystem’s
annotation so japicmp will include them when comparing APIs.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 31699e9f-9876-4bf7-bc20-79b8fd04a6e5
📒 Files selected for processing (37)
CHANGELOG.mdoshi-common/src/main/java/oshi/annotation/PublicApi.javaoshi-common/src/main/java/oshi/hardware/Baseboard.javaoshi-common/src/main/java/oshi/hardware/CentralProcessor.javaoshi-common/src/main/java/oshi/hardware/ComputerSystem.javaoshi-common/src/main/java/oshi/hardware/Display.javaoshi-common/src/main/java/oshi/hardware/Firmware.javaoshi-common/src/main/java/oshi/hardware/GlobalMemory.javaoshi-common/src/main/java/oshi/hardware/GpuStats.javaoshi-common/src/main/java/oshi/hardware/GpuTicks.javaoshi-common/src/main/java/oshi/hardware/GraphicsCard.javaoshi-common/src/main/java/oshi/hardware/HWDiskStore.javaoshi-common/src/main/java/oshi/hardware/HWPartition.javaoshi-common/src/main/java/oshi/hardware/HardwareAbstractionLayer.javaoshi-common/src/main/java/oshi/hardware/LogicalVolumeGroup.javaoshi-common/src/main/java/oshi/hardware/NetworkIF.javaoshi-common/src/main/java/oshi/hardware/PhysicalMemory.javaoshi-common/src/main/java/oshi/hardware/PowerSource.javaoshi-common/src/main/java/oshi/hardware/Printer.javaoshi-common/src/main/java/oshi/hardware/Sensors.javaoshi-common/src/main/java/oshi/hardware/SoundCard.javaoshi-common/src/main/java/oshi/hardware/UsbDevice.javaoshi-common/src/main/java/oshi/hardware/VirtualMemory.javaoshi-common/src/main/java/oshi/software/os/ApplicationInfo.javaoshi-common/src/main/java/oshi/software/os/FileSystem.javaoshi-common/src/main/java/oshi/software/os/InternetProtocolStats.javaoshi-common/src/main/java/oshi/software/os/NetworkParams.javaoshi-common/src/main/java/oshi/software/os/OSDesktopWindow.javaoshi-common/src/main/java/oshi/software/os/OSFileStore.javaoshi-common/src/main/java/oshi/software/os/OSProcess.javaoshi-common/src/main/java/oshi/software/os/OSService.javaoshi-common/src/main/java/oshi/software/os/OSSession.javaoshi-common/src/main/java/oshi/software/os/OSThread.javaoshi-common/src/main/java/oshi/software/os/OperatingSystem.javaoshi-common/src/main/java/oshi/util/PlatformEnum.javaoshi-core-ffm/src/main/java/oshi/ffm/SystemInfo.javaoshi-core/src/main/java/oshi/SystemInfo.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). (10)
- GitHub Check: Codacy Static Code Analysis
- GitHub Check: Test JDK 11, windows-latest
- GitHub Check: Test JDK 25, ubuntu-latest (+ JNA==FFM)
- GitHub Check: Test JDK 21, windows-latest
- GitHub Check: Test JDK 21, macos-latest
- GitHub Check: Test JDK 25, macos-latest (+ JNA==FFM)
- GitHub Check: Test JDK 11, macos-latest
- GitHub Check: Test JDK 25, windows-latest (+ JNA==FFM)
- GitHub Check: Lint (Spotless, Checkstyle, ForbiddenAPIs, Javadoc)
- GitHub Check: Analyze (java)
🧰 Additional context used
🧠 Learnings (14)
📓 Common learnings
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.
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-common/src/main/java/oshi/hardware/GpuTicks.javaoshi-common/src/main/java/oshi/hardware/GlobalMemory.javaoshi-common/src/main/java/oshi/hardware/HWPartition.javaoshi-common/src/main/java/oshi/util/PlatformEnum.javaoshi-common/src/main/java/oshi/hardware/GpuStats.javaoshi-common/src/main/java/oshi/hardware/Firmware.javaoshi-common/src/main/java/oshi/software/os/FileSystem.javaoshi-common/src/main/java/oshi/hardware/Printer.javaoshi-common/src/main/java/oshi/hardware/VirtualMemory.javaoshi-common/src/main/java/oshi/software/os/OSService.javaoshi-common/src/main/java/oshi/hardware/PhysicalMemory.javaoshi-common/src/main/java/oshi/hardware/NetworkIF.javaoshi-core/src/main/java/oshi/SystemInfo.javaoshi-common/src/main/java/oshi/hardware/UsbDevice.javaoshi-common/src/main/java/oshi/hardware/LogicalVolumeGroup.javaoshi-common/src/main/java/oshi/software/os/OSThread.javaoshi-common/src/main/java/oshi/hardware/Display.javaoshi-common/src/main/java/oshi/software/os/InternetProtocolStats.javaoshi-common/src/main/java/oshi/software/os/OperatingSystem.javaoshi-common/src/main/java/oshi/software/os/ApplicationInfo.javaoshi-common/src/main/java/oshi/software/os/OSFileStore.javaoshi-common/src/main/java/oshi/software/os/NetworkParams.javaoshi-common/src/main/java/oshi/annotation/PublicApi.javaoshi-core-ffm/src/main/java/oshi/ffm/SystemInfo.javaoshi-common/src/main/java/oshi/hardware/ComputerSystem.javaoshi-common/src/main/java/oshi/software/os/OSProcess.javaoshi-common/src/main/java/oshi/hardware/CentralProcessor.javaoshi-common/src/main/java/oshi/hardware/SoundCard.javaoshi-common/src/main/java/oshi/hardware/Sensors.javaoshi-common/src/main/java/oshi/hardware/Baseboard.javaoshi-common/src/main/java/oshi/hardware/PowerSource.javaoshi-common/src/main/java/oshi/hardware/HardwareAbstractionLayer.javaoshi-common/src/main/java/oshi/software/os/OSSession.javaCHANGELOG.mdoshi-common/src/main/java/oshi/hardware/HWDiskStore.javaoshi-common/src/main/java/oshi/hardware/GraphicsCard.javaoshi-common/src/main/java/oshi/software/os/OSDesktopWindow.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/hardware/GpuTicks.javaoshi-common/src/main/java/oshi/hardware/GlobalMemory.javaoshi-common/src/main/java/oshi/hardware/HWPartition.javaoshi-common/src/main/java/oshi/util/PlatformEnum.javaoshi-common/src/main/java/oshi/hardware/GpuStats.javaoshi-common/src/main/java/oshi/hardware/Firmware.javaoshi-common/src/main/java/oshi/software/os/FileSystem.javaoshi-common/src/main/java/oshi/hardware/Printer.javaoshi-common/src/main/java/oshi/hardware/VirtualMemory.javaoshi-common/src/main/java/oshi/software/os/OSService.javaoshi-common/src/main/java/oshi/hardware/PhysicalMemory.javaoshi-common/src/main/java/oshi/hardware/NetworkIF.javaoshi-common/src/main/java/oshi/hardware/UsbDevice.javaoshi-common/src/main/java/oshi/hardware/LogicalVolumeGroup.javaoshi-common/src/main/java/oshi/software/os/OSThread.javaoshi-common/src/main/java/oshi/hardware/Display.javaoshi-common/src/main/java/oshi/software/os/InternetProtocolStats.javaoshi-common/src/main/java/oshi/software/os/OperatingSystem.javaoshi-common/src/main/java/oshi/software/os/ApplicationInfo.javaoshi-common/src/main/java/oshi/software/os/OSFileStore.javaoshi-common/src/main/java/oshi/software/os/NetworkParams.javaoshi-common/src/main/java/oshi/annotation/PublicApi.javaoshi-common/src/main/java/oshi/hardware/ComputerSystem.javaoshi-common/src/main/java/oshi/software/os/OSProcess.javaoshi-common/src/main/java/oshi/hardware/CentralProcessor.javaoshi-common/src/main/java/oshi/hardware/SoundCard.javaoshi-common/src/main/java/oshi/hardware/Sensors.javaoshi-common/src/main/java/oshi/hardware/Baseboard.javaoshi-common/src/main/java/oshi/hardware/PowerSource.javaoshi-common/src/main/java/oshi/hardware/HardwareAbstractionLayer.javaoshi-common/src/main/java/oshi/software/os/OSSession.javaoshi-common/src/main/java/oshi/hardware/HWDiskStore.javaoshi-common/src/main/java/oshi/hardware/GraphicsCard.javaoshi-common/src/main/java/oshi/software/os/OSDesktopWindow.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-common/src/main/java/oshi/util/PlatformEnum.javaoshi-common/src/main/java/oshi/software/os/FileSystem.javaoshi-common/src/main/java/oshi/software/os/OSService.javaoshi-core/src/main/java/oshi/SystemInfo.javaoshi-common/src/main/java/oshi/software/os/OperatingSystem.javaoshi-common/src/main/java/oshi/software/os/ApplicationInfo.javaoshi-common/src/main/java/oshi/software/os/OSFileStore.javaoshi-core-ffm/src/main/java/oshi/ffm/SystemInfo.javaoshi-common/src/main/java/oshi/software/os/OSProcess.javaCHANGELOG.mdoshi-common/src/main/java/oshi/software/os/OSDesktopWindow.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-common/src/main/java/oshi/util/PlatformEnum.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-common/src/main/java/oshi/util/PlatformEnum.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-common/src/main/java/oshi/hardware/UsbDevice.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-common/src/main/java/oshi/hardware/UsbDevice.java
📚 Learning: 2026-04-05T16:15:06.124Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3117
File: oshi-core/src/main/java/oshi/hardware/platform/linux/LinuxLogicalVolumeGroupJNA.java:95-97
Timestamp: 2026-04-05T16:15:06.124Z
Learning: In `LinuxLogicalVolumeGroupJNA.getLogicalVolumeGroups()` (oshi-core/src/main/java/oshi/hardware/platform/linux/LinuxLogicalVolumeGroupJNA.java), `physicalVolumesMap.get(e.getKey())` in the final stream mapping cannot return null: both `logicalVolumesMap` and `physicalVolumesMap` are populated via `computeIfAbsent` inside the same conditional block (`!Util.isBlank(vgName) && !Util.isBlank(lvName)`), so every VG key in `logicalVolumesMap` is guaranteed to have a corresponding entry in `physicalVolumesMap`. Do not flag this `.get()` call as a potential null-return issue. The FFM version uses `getOrDefault` as extra defensiveness, not because null is possible here.
Applied to files:
oshi-common/src/main/java/oshi/hardware/LogicalVolumeGroup.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-ffm/src/main/java/oshi/ffm/SystemInfo.javaoshi-common/src/main/java/oshi/hardware/HWDiskStore.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-common/src/main/java/oshi/software/os/OSProcess.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-common/src/main/java/oshi/hardware/Sensors.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-common/src/main/java/oshi/hardware/PowerSource.javaoshi-common/src/main/java/oshi/hardware/HardwareAbstractionLayer.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 (36)
oshi-core-ffm/src/main/java/oshi/ffm/SystemInfo.java (1)
11-11: LGTM.
@PublicApion the FFMSystemInfoentry point matches the intent of marking SemVer-guaranteed entry points. Consistent with the JNAoshi.SystemInfocounterpart.Also applies to: 61-61
oshi-common/src/main/java/oshi/hardware/HWPartition.java (1)
9-9: LGTM.
@PublicApicorrectly applied alongside@Immutable; no API-surface changes.Also applies to: 18-18
oshi-common/src/main/java/oshi/hardware/GpuTicks.java (1)
7-7: LGTM.Consistent marking for a SemVer-guaranteed immutable snapshot type.
Also applies to: 29-29
oshi-common/src/main/java/oshi/hardware/GlobalMemory.java (1)
9-9: LGTM.
@PublicApion theGlobalMemoryinterface is appropriate and matches the rest of theoshi.hardwarepublic surface.Also applies to: 29-29
oshi-common/src/main/java/oshi/hardware/Baseboard.java (1)
7-7: LGTM.Annotation applied consistently with other
oshi.hardwarepublic interfaces.Also applies to: 13-13
oshi-common/src/main/java/oshi/hardware/VirtualMemory.java (1)
7-7: LGTM.Correctly marked alongside
@ThreadSafe; no behavioral change.Also applies to: 32-32
oshi-common/src/main/java/oshi/software/os/OSService.java (1)
7-7: LGTM.
@PublicApiapplied consistently; note the nestedStateenum is public API too, same consideration as onOperatingSystem.OSVersionInfoif japicmp needs explicit per-type annotations.Also applies to: 17-17
oshi-common/src/main/java/oshi/hardware/GpuStats.java (1)
7-7: Looks good —GpuStatsis correctly marked as SemVer-stable public API.
This is a clean metadata-only change and aligns with the PR goal without affecting runtime behavior.Based on learnings: public API in OSHI is intentionally centered on
oshi,oshi.hardware, andoshi.software.ospackages.Also applies to: 80-80
oshi-common/src/main/java/oshi/hardware/SoundCard.java (1)
7-7: Approved —SoundCardannotation is appropriate and non-breaking.
Nice, focused change that supports future API compatibility checks.Also applies to: 13-13
oshi-common/src/main/java/oshi/util/PlatformEnum.java (1)
9-10: LGTM —PlatformEnumis correctly annotated with@PublicApi.
Good change for explicit API-contract tooling, with no impact on existing detection behavior.Also applies to: 15-15
oshi-common/src/main/java/oshi/hardware/PhysicalMemory.java (1)
7-7: Approved —PhysicalMemoryis a valid target for@PublicApi.
This is consistent with the SemVer-stable surface definition and keeps behavior unchanged.Also applies to: 15-15
oshi-common/src/main/java/oshi/software/os/OSSession.java (1)
13-13: Looks good —OSSessionis correctly included in the public API contract.
No functional risk in this change; it cleanly supports upcoming japicmp enforcement.Based on learnings: the
oshi.software.ospackage is part of OSHI’s intended public API surface.Also applies to: 19-19
oshi-common/src/main/java/oshi/software/os/NetworkParams.java (1)
7-7: Approved —NetworkParamsis appropriately marked@PublicApi.
Straightforward, contract-only update with no behavioral side effects.Also applies to: 13-13
oshi-common/src/main/java/oshi/software/os/OSDesktopWindow.java (1)
9-10: LGTM —OSDesktopWindowannotation is correct and helpful.
Good consistency with the rest of the public API annotation rollout.Also applies to: 15-15
oshi-common/src/main/java/oshi/software/os/OSFileStore.java (1)
7-7: Approved —OSFileStoreis correctly annotated as public API.
This matches the PR’s compatibility-contract objective and introduces no runtime or ABI risk by itself.Also applies to: 24-24
oshi-common/src/main/java/oshi/software/os/OSThread.java (1)
9-15: LGTM.@PublicApicorrectly applied to anoshi.software.osinterface per the SemVer-guaranteed surface.oshi-common/src/main/java/oshi/software/os/ApplicationInfo.java (1)
12-19: LGTM. Annotation correctly marks this exportedoshi.software.osclass as public API.oshi-common/src/main/java/oshi/software/os/FileSystem.java (1)
9-17: LGTM.@PublicApialongside@ThreadSafeis consistent with the other annotated interfaces in this package.oshi-common/src/main/java/oshi/hardware/HardwareAbstractionLayer.java (1)
10-17: LGTM. Correct application to the hardware entry-point interface.oshi-core/src/main/java/oshi/SystemInfo.java (1)
11-68: LGTM. Marking the JNASystemInfoentry point as@PublicApiis exactly the intent of this PR; pairs well with the FFM entry point receiving the same treatment. Good prep for enabling japicmp enforcement post-7.0.0.oshi-common/src/main/java/oshi/hardware/Firmware.java (1)
7-14: LGTM.@PublicApi+@Immutablecombination is appropriate here.oshi-common/src/main/java/oshi/software/os/OSProcess.java (1)
10-37: LGTM. Correct annotation on a coreoshi.software.osinterface. No behavioral change.oshi-common/src/main/java/oshi/hardware/NetworkIF.java (1)
10-21: LGTM. Consistent with the rest of theoshi.hardwareinterfaces annotated in this PR.oshi-common/src/main/java/oshi/hardware/CentralProcessor.java (1)
17-17: LGTM.
@PublicApicorrectly applied toCentralProcessor, which is squarely within the SemVer-guaranteed public surface per the project's public API scope (oshi.hardware).Also applies to: 60-60
oshi-common/src/main/java/oshi/hardware/Printer.java (1)
7-7: LGTM.Annotation placement is consistent with the rest of the PR.
Also applies to: 13-13
oshi-common/src/main/java/oshi/hardware/UsbDevice.java (1)
9-9: LGTM.
@PublicApicorrectly added above@Immutableon theUsbDeviceinterface.Also applies to: 16-16
oshi-common/src/main/java/oshi/hardware/LogicalVolumeGroup.java (1)
10-10: LGTM.Consistent with the PR-wide annotation rollout.
Also applies to: 18-18
oshi-common/src/main/java/oshi/hardware/HWDiskStore.java (1)
9-9: LGTM.
@PublicApiplaced above@ThreadSafeonHWDiskStore— consistent withCentralProcessorand the rest of the PR.Also applies to: 43-43
oshi-common/src/main/java/oshi/hardware/PowerSource.java (1)
9-9: LGTM.Annotation correctly applied to the
PowerSourcepublic interface.Also applies to: 15-15
oshi-common/src/main/java/oshi/hardware/GraphicsCard.java (1)
7-7: LGTM.
@PublicApiapplied consistently alongside@ImmutableonGraphicsCard. Note thatGpuStats(referenced bycreateStatsSession()) is also part of the exposed public surface — worth confirming it receives the same annotation elsewhere in the PR for japicmp coverage consistency.Also applies to: 32-32
oshi-common/src/main/java/oshi/hardware/Sensors.java (1)
7-7: LGTM.Annotation addition is consistent with the rest of the
oshi.hardwareinterfaces in this PR. Nice clean rollout across the public surface — this should make japicmp enforcement post-7.0.0 much more tractable.Also applies to: 26-26
oshi-common/src/main/java/oshi/software/os/InternetProtocolStats.java (1)
12-20: Good public API marker placement onInternetProtocolStats.
@PublicApiis applied at the right abstraction boundary with no API surface regressions.CHANGELOG.md (1)
11-14: Changelog entry is clear and convention-aligned.The new feature note is scoped correctly and matches the established formatting for this file.
oshi-common/src/main/java/oshi/hardware/ComputerSystem.java (1)
7-15:ComputerSystemis correctly annotated as SemVer-stable API.This is a clean, non-breaking metadata change and fits the PR goal.
oshi-common/src/main/java/oshi/hardware/Display.java (1)
7-14:Displayannotation update looks correct.The new marker is applied cleanly and keeps the interface behavior unchanged.
oshi-common/src/main/java/oshi/annotation/PublicApi.java (1)
13-24:@PublicApidefinition is well-structured and purpose-fit.The target, retention, and documentation align with the intended SemVer API contract signaling.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3183 +/- ##
==========================================
+ Coverage 57.30% 57.37% +0.06%
==========================================
Files 421 421
Lines 20272 20272
Branches 3563 3563
==========================================
+ Hits 11617 11631 +14
+ Misses 6893 6881 -12
+ Partials 1762 1760 -2
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:
|
New annotation marks types whose API is guaranteed stable within a major version per SemVer. Applied to all interfaces and classes in oshi.hardware, oshi.software.os, both SystemInfo entry points, and PlatformEnum. Prepares for japicmp enforcement post-7.0.0 release.
c76d300 to
374cb38
Compare
New
@PublicApiannotation marks types whose API is guaranteed stable within a major version per SemVer.Applied to:
oshi.hardwareoshi.software.osSystemInfoentry points (JNA and FFM)PlatformEnumTypes not annotated (platform implementations, drivers, utilities) may change between minor releases.
This prepares for
japicmp-maven-pluginenforcement post-7.0.0 release to automatically detect binary-incompatible changes to the public API.Summary by CodeRabbit