Skip to content

Move Linux OS classes to oshi-common - #3140

Merged
dbwiddis merged 1 commit into
oshi:masterfrom
dbwiddis:linux-os
Apr 11, 2026
Merged

dbwiddis merged 1 commit into
oshi:masterfrom
dbwiddis:linux-os

Conversation

@dbwiddis

@dbwiddis dbwiddis commented Apr 11, 2026 •

Copy link
Copy Markdown
Member

Move 8 Linux OS classes from oshi-core (oshi.software.os.linux) to oshi-common (oshi.software.common.os.linux).

Abstract base classes

  • LinuxOperatingSystem
  • LinuxOSProcess
  • LinuxFileSystem
  • LinuxNetworkParams (made public for cross-package subclass access)

Native-free classes (moved directly)

  • LinuxOSThread
  • LinuxOSFileStore
  • LinuxInternetProtocolStats
  • LinuxInstalledApps

Notable changes

  • Removed getSessions() from LinuxOperatingSystem since it depended on WhoJNA. Both LinuxOperatingSystemJNA and LinuxOperatingSystemFFM already override it with their respective Who implementations; the AbstractOperatingSystem default provides a safe fallback.
  • Added getSessions() override to LinuxOperatingSystemJNA (previously inherited from the base).
  • Updated all JNA and FFM subclasses with imports from the new oshi.software.common.os.linux package.
  • Exported oshi.software.common.os.linux from oshi-common module-info.

Summary by CodeRabbit

  • Refactor
    • Reorganized platform-specific implementation code and consolidated shared components for improved code organization and maintainability across the project.

Move 8 Linux OS classes from oshi-core to oshi-common:
- LinuxOperatingSystem, LinuxOSProcess, LinuxFileSystem (abstract bases)
- LinuxNetworkParams (made public for cross-package subclass access)
- LinuxOSThread, LinuxOSFileStore, LinuxInternetProtocolStats,
  LinuxInstalledApps (native-free, moved directly)

Remove getSessions() from LinuxOperatingSystem since it used WhoJNA;
both LinuxOperatingSystemJNA and LinuxOperatingSystemFFM already
override it with their respective Who implementations.

Add getSessions() override to LinuxOperatingSystemJNA.

Update JNA and FFM subclasses with imports from the new
oshi.software.common.os.linux package.
@coderabbitai

coderabbitai Bot commented Apr 11, 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: 487e63d6-945a-4c46-9cbc-1b0db6a3e657

📥 Commits

Reviewing files that changed from the base of the PR and between 9dc0c2d and 17bde1f.

📒 Files selected for processing (19)
  • CHANGELOG.md
  • oshi-common/src/main/java/module-info.java
  • oshi-common/src/main/java/oshi/software/common/os/linux/LinuxFileSystem.java
  • oshi-common/src/main/java/oshi/software/common/os/linux/LinuxInstalledApps.java
  • oshi-common/src/main/java/oshi/software/common/os/linux/LinuxInternetProtocolStats.java
  • oshi-common/src/main/java/oshi/software/common/os/linux/LinuxNetworkParams.java
  • oshi-common/src/main/java/oshi/software/common/os/linux/LinuxOSFileStore.java
  • oshi-common/src/main/java/oshi/software/common/os/linux/LinuxOSProcess.java
  • oshi-common/src/main/java/oshi/software/common/os/linux/LinuxOSThread.java
  • oshi-common/src/main/java/oshi/software/common/os/linux/LinuxOperatingSystem.java
  • oshi-common/src/main/java/oshi/software/common/os/linux/package-info.java
  • oshi-core-java25/src/main/java/oshi/software/os/linux/LinuxFileSystemFFM.java
  • oshi-core-java25/src/main/java/oshi/software/os/linux/LinuxNetworkParamsFFM.java
  • oshi-core-java25/src/main/java/oshi/software/os/linux/LinuxOSProcessFFM.java
  • oshi-core-java25/src/main/java/oshi/software/os/linux/LinuxOperatingSystemFFM.java
  • oshi-core/src/main/java/oshi/software/os/linux/LinuxFileSystemJNA.java
  • oshi-core/src/main/java/oshi/software/os/linux/LinuxNetworkParamsJNA.java
  • oshi-core/src/main/java/oshi/software/os/linux/LinuxOSProcessJNA.java
  • oshi-core/src/main/java/oshi/software/os/linux/LinuxOperatingSystemJNA.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). (9)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Test JDK 21, macos-latest
  • 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, macos-latest
  • GitHub Check: Analyze (java)
  • GitHub Check: Test JDK 25, macos-latest
  • GitHub Check: Lint (Spotless, Checkstyle, ForbiddenAPIs, Javadoc)
🧰 Additional context used
🧠 Learnings (9)
📓 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.
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3117
File: oshi-core-java25/src/main/java/oshi/hardware/platform/linux/LinuxPowerSourceFFM.java:62-65
Timestamp: 2026-04-05T05:40:45.797Z
Learning: In OSHI's Linux FFM and JNA udev code, a null guard on `udev_enumerate_new()` is intentionally absent and should not be flagged. This is consistent across all four FFM classes (LinuxPowerSourceFFM, LinuxHWDiskStoreFFM, LinuxLogicalVolumeGroupFFM, LinuxUsbDeviceFFM) and the JNA implementation (which also does not guard `enumerateNew()` for null). Per libudev semantics, `udev_enumerate_new()` only returns NULL when udev itself is broken (e.g. OOM), so a successful `udev_new()` (which is guarded) implies `udev_enumerate_new()` will succeed. Adding a null guard would be both redundant and inconsistent with the established pattern.
📚 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/linux/LinuxFileSystemFFM.java
  • oshi-common/src/main/java/module-info.java
  • oshi-core-java25/src/main/java/oshi/software/os/linux/LinuxOSProcessFFM.java
  • oshi-core/src/main/java/oshi/software/os/linux/LinuxOSProcessJNA.java
  • oshi-core-java25/src/main/java/oshi/software/os/linux/LinuxOperatingSystemFFM.java
  • oshi-common/src/main/java/oshi/software/common/os/linux/LinuxOSThread.java
  • oshi-core-java25/src/main/java/oshi/software/os/linux/LinuxNetworkParamsFFM.java
  • oshi-common/src/main/java/oshi/software/common/os/linux/LinuxFileSystem.java
  • oshi-core/src/main/java/oshi/software/os/linux/LinuxFileSystemJNA.java
  • oshi-common/src/main/java/oshi/software/common/os/linux/LinuxOSProcess.java
  • oshi-common/src/main/java/oshi/software/common/os/linux/LinuxInstalledApps.java
  • oshi-common/src/main/java/oshi/software/common/os/linux/LinuxNetworkParams.java
  • oshi-common/src/main/java/oshi/software/common/os/linux/package-info.java
  • oshi-common/src/main/java/oshi/software/common/os/linux/LinuxInternetProtocolStats.java
  • oshi-core/src/main/java/oshi/software/os/linux/LinuxOperatingSystemJNA.java
  • oshi-common/src/main/java/oshi/software/common/os/linux/LinuxOperatingSystem.java
  • oshi-common/src/main/java/oshi/software/common/os/linux/LinuxOSFileStore.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-java25/src/main/java/oshi/software/os/linux/LinuxFileSystemFFM.java
  • oshi-common/src/main/java/module-info.java
  • oshi-core-java25/src/main/java/oshi/software/os/linux/LinuxOSProcessFFM.java
  • oshi-core-java25/src/main/java/oshi/software/os/linux/LinuxOperatingSystemFFM.java
  • oshi-common/src/main/java/oshi/software/common/os/linux/LinuxOSThread.java
  • oshi-core-java25/src/main/java/oshi/software/os/linux/LinuxNetworkParamsFFM.java
  • oshi-common/src/main/java/oshi/software/common/os/linux/LinuxFileSystem.java
  • oshi-common/src/main/java/oshi/software/common/os/linux/LinuxOSProcess.java
  • oshi-common/src/main/java/oshi/software/common/os/linux/LinuxInstalledApps.java
  • oshi-common/src/main/java/oshi/software/common/os/linux/LinuxNetworkParams.java
  • oshi-common/src/main/java/oshi/software/common/os/linux/package-info.java
  • oshi-common/src/main/java/oshi/software/common/os/linux/LinuxInternetProtocolStats.java
  • oshi-common/src/main/java/oshi/software/common/os/linux/LinuxOperatingSystem.java
  • oshi-common/src/main/java/oshi/software/common/os/linux/LinuxOSFileStore.java
📚 Learning: 2026-04-05T05:40:45.797Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3117
File: oshi-core-java25/src/main/java/oshi/hardware/platform/linux/LinuxPowerSourceFFM.java:62-65
Timestamp: 2026-04-05T05:40:45.797Z
Learning: In OSHI's Linux FFM and JNA udev code, a null guard on `udev_enumerate_new()` is intentionally absent and should not be flagged. This is consistent across all four FFM classes (LinuxPowerSourceFFM, LinuxHWDiskStoreFFM, LinuxLogicalVolumeGroupFFM, LinuxUsbDeviceFFM) and the JNA implementation (which also does not guard `enumerateNew()` for null). Per libudev semantics, `udev_enumerate_new()` only returns NULL when udev itself is broken (e.g. OOM), so a successful `udev_new()` (which is guarded) implies `udev_enumerate_new()` will succeed. Adding a null guard would be both redundant and inconsistent with the established pattern.

Applied to files:

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

Applied to files:

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

Applied to files:

  • oshi-core-java25/src/main/java/oshi/software/os/linux/LinuxOperatingSystemFFM.java
  • oshi-common/src/main/java/oshi/software/common/os/linux/LinuxOSProcess.java
  • oshi-common/src/main/java/oshi/software/common/os/linux/package-info.java
  • oshi-core/src/main/java/oshi/software/os/linux/LinuxOperatingSystemJNA.java
📚 Learning: 2026-04-05T05:39:21.126Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3117
File: oshi-core-java25/src/main/java/oshi/hardware/platform/linux/LinuxPowerSourceFFM.java:62-65
Timestamp: 2026-04-05T05:39:21.126Z
Learning: In OSHI's Linux FFM/JNA udev code, a null guard on `udev_enumerate_new()` is unnecessary if `udev_new()` has already been guarded: per libudev semantics, `udev_enumerate_new()` only returns NULL when udev itself is broken (e.g. OOM), so a successful `udev_new()` implies `udev_enumerate_new()` will succeed as well. Do not flag missing null checks on `udev_enumerate_new()` as an issue.

Applied to files:

  • oshi-core-java25/src/main/java/oshi/software/os/linux/LinuxOperatingSystemFFM.java
  • oshi-common/src/main/java/oshi/software/common/os/linux/package-info.java
  • oshi-core/src/main/java/oshi/software/os/linux/LinuxOperatingSystemJNA.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 (20)
CHANGELOG.md (1)

10-11: Changelog entry is clear and correctly scoped.

The new #3140 bullet accurately reflects the module split and class move, and keeps the release notes coherent with neighboring entries.

oshi-core-java25/src/main/java/oshi/software/os/linux/LinuxFileSystemFFM.java (1)

15-15: Superclass import update looks correct.

Line 15 now resolves LinuxFileSystem from the shared oshi-common package, matching the PR’s module-boundary refactor without changing runtime behavior.

oshi-core/src/main/java/oshi/software/os/linux/LinuxNetworkParamsJNA.java (1)

23-23: Import relocation is consistent with the package move.

Line 23 correctly points the JNA implementation to the shared LinuxNetworkParams base class in oshi-common.

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

13-13: Module export is necessary and correctly added.

Exporting oshi.software.common.os.linux enables downstream modules to compile against the relocated shared Linux abstractions.

oshi-core-java25/src/main/java/oshi/software/os/linux/LinuxOSProcessFFM.java (1)

15-16: Type imports are correctly aligned with relocated base classes.

Lines 15-16 correctly bind this FFM process implementation to the moved common Linux abstractions.

oshi-core-java25/src/main/java/oshi/software/os/linux/LinuxNetworkParamsFFM.java (1)

17-17: FFM network params import update is correct.

Line 17 cleanly points to the shared Linux network params base in oshi-common, consistent with the refactor.

oshi-core/src/main/java/oshi/software/os/linux/LinuxOSProcessJNA.java (1)

11-12: JNA process type imports are updated correctly.

The new imports on Lines 11-12 match the relocated common Linux base types and preserve class wiring.

oshi-core/src/main/java/oshi/software/os/linux/LinuxFileSystemJNA.java (1)

14-14: Linux filesystem base import migration is correct.

Line 14 now references the shared LinuxFileSystem abstraction in oshi-common, which matches the PR objective.

oshi-common/src/main/java/oshi/software/common/os/linux/LinuxFileSystem.java (1)

5-5: Package relocation looks consistent.

LinuxFileSystem now lives in the shared linux-common package, and downstream subclasses/imports are aligned with this move.

oshi-common/src/main/java/oshi/software/common/os/linux/LinuxOSThread.java (1)

5-5: Package move is clean and non-disruptive.

This relocation matches the common Linux class extraction pattern in this PR.

oshi-core-java25/src/main/java/oshi/software/os/linux/LinuxOperatingSystemFFM.java (1)

23-23: FFM base-class import update is correct.

The class now extends the relocated common Linux operating-system base without logic changes.

oshi-common/src/main/java/oshi/software/common/os/linux/LinuxOSProcess.java (1)

5-5: Relocation is consistent with downstream subclasses.

The new package path aligns with both Linux JNA and FFM process implementations.

oshi-common/src/main/java/oshi/software/common/os/linux/LinuxInstalledApps.java (1)

5-20: Namespace and import updates look good.

Package migration is consistent, and the added LinkedHashMap/LinkedHashSet imports correctly match current usage.

oshi-common/src/main/java/oshi/software/common/os/linux/LinuxOSFileStore.java (1)

5-5: Package move preserves file-store integration.

This relocation keeps the class aligned with the moved Linux filesystem implementation.

oshi-core/src/main/java/oshi/software/os/linux/LinuxOperatingSystemJNA.java (2)

21-31: Import realignment for moved Linux base is correct.

Dependencies now point to the relocated common Linux classes and the proper session type.


106-109: getSessions() override cleanly preserves JNA behavior.

The fallback logic (Who.queryWho() vs WhoJNA.queryUtxent()) is explicit and matches the intended split after removing base implementation.

oshi-common/src/main/java/oshi/software/common/os/linux/LinuxInternetProtocolStats.java (1)

5-5: Package migration is straightforward and safe.

This aligns with the linux-common extraction and does not alter runtime behavior.

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

5-8: Package-level documentation and namespace alignment look correct.

The package declaration and Javadoc are clear and consistent with the shared Linux common-module extraction.

oshi-common/src/main/java/oshi/software/common/os/linux/LinuxNetworkParams.java (1)

5-5: Relocation + visibility change are correctly applied for cross-module subclassing.

The new package path and public abstract visibility are consistent with downstream JNA/FFM subclasses importing and extending this base class.

Based on learnings, platform-specific classes under Linux subpackages are implementation details, so this visibility/package change is not a public API break.

Also applies to: 19-19

oshi-common/src/main/java/oshi/software/common/os/linux/LinuxOperatingSystem.java (1)

5-5: Package migration for the Linux common base class is clean.

This namespace move is consistent with the PR’s module split strategy and keeps shared Linux OS logic centralized in oshi-common.

Based on learnings, this Linux-specific class is implementation detail rather than public API surface, so the relocation is acceptable.


📝 Walkthrough

Walkthrough

Linux OS classes are migrated from oshi.software.os.linux to a new shared package oshi.software.common.os.linux in the oshi-common module. The getSessions() method is moved from the common base class to the JNA-specific implementation. Corresponding imports are updated across JNA and FFM modules to reference the relocated classes.

Changes

Cohort / File(s) Summary
Changelog & Module Configuration
CHANGELOG.md, oshi-common/src/main/java/module-info.java
Updated changelog entry for PR #3138/#3140; added oshi.software.common.os.linux to module exports.
oshi-common Linux Classes
oshi-common/src/main/java/oshi/software/common/os/linux/Linux{FileSystem, InstalledApps, InternetProtocolStats, NetworkParams, OSFileStore, OSProcess, OSThread, OperatingSystem}.java, package-info.java
Package declarations migrated from oshi.software.os.linux to oshi.software.common.os.linux; LinuxNetworkParams access modifier changed to public; getSessions() method removed from LinuxOperatingSystem common base; new package documentation added.
oshi-core-java25 FFM Implementations
oshi-core-java25/src/main/java/oshi/software/os/linux/Linux{FileSystem, NetworkParams, OSProcess, OperatingSystem}FFM.java
Added imports for relocated common Linux classes from oshi.software.common.os.linux.
oshi-core JNA Implementations
oshi-core/src/main/java/oshi/software/os/linux/Linux{FileSystem, NetworkParams, OSProcess, OperatingSystem}JNA.java
Added imports for relocated common Linux classes; LinuxOperatingSystemJNA now includes getSessions() override with conditional logic for Who.queryWho() vs. WhoJNA.queryUtxent().

Possibly Related PRs

  • PR #3133: Moves common OSHI software classes into oshi-common module with matching package/export updates.
  • PR #3137: Complements this refactor by splitting Linux Who drivers and adding getSessions() overrides to JNA/FFM variants.
  • PR #3134: Relocates Linux-related code to oshi-common and updates package/module exports across core modules.

Estimated Code Review Effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Hoppy refactor, classes take flight,
From os.linux to common.os.linux so bright!
Module exports grow, imports align,
JNA claims getSessions, FFM joins the line—
One shared foundation, implementations entwined! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.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 describes the main change: moving Linux OS classes from oshi-core to the oshi-common module, which is the primary objective of this PR.

✏️ 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 11, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.25%. Comparing base (9dc0c2d) to head (17bde1f).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3140      +/-   ##
============================================
+ Coverage     61.91%   62.25%   +0.34%     
  Complexity       12       12              
============================================
  Files            39       39              
  Lines          2329     2329              
  Branches        407      407              
============================================
+ Hits           1442     1450       +8     
+ Misses          777      769       -8     
  Partials        110      110              

☔ 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.

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