Skip to content

Remove deprecated methods and classes - #3182

Merged
dbwiddis merged 1 commit into
oshi:masterfrom
dbwiddis:remove-deprecated
Apr 21, 2026
Merged

dbwiddis merged 1 commit into
oshi:masterfrom
dbwiddis:remove-deprecated

Conversation

@dbwiddis

@dbwiddis dbwiddis commented Apr 21, 2026 •

Copy link
Copy Markdown
Member

Remove deprecated API elements:

  • OSProcess.getResidentSetSize() — replaced by getResidentMemory() and getPrivateResidentMemory()
  • oshi.PlatformEnum (oshi-core) and oshi.PlatformEnumFFM (oshi-core-ffm) — replaced by oshi.util.PlatformEnum
  • SystemInfo.getCurrentPlatform() and SystemInfoFFM — replaced by PlatformEnum.getCurrentPlatform() and oshi.ffm.SystemInfo
  • Misspelled GlobalConfig constants (DIABLED → DISABLED)

Updates Upgrading.md with migration guide and CHANGELOG.md with summary.

Summary by CodeRabbit

  • Breaking Changes

    • Removed OSProcess.getResidentSetSize(); use getResidentMemory() or getPrivateResidentMemory()
    • Removed deprecated platform APIs (osh i.PlatformEnum, PlatformEnumFFM) — migrate to oshi.util.PlatformEnum.getCurrentPlatform()
    • Removed SystemInfo.getCurrentPlatform() and SystemInfoFFM — use oshi.util.PlatformEnum.getCurrentPlatform() and oshi.ffm.SystemInfo
    • Removed three misspelled GlobalConfig constants
  • Documentation

    • Updated upgrade guide with v7.0.0 migration and FFM/JPMS notes

@coderabbitai

coderabbitai Bot commented Apr 21, 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: 8753ee7f-208b-4d4f-8ec3-90aa880ea306

📥 Commits

Reviewing files that changed from the base of the PR and between 62281b8 and baf548e.

📒 Files selected for processing (19)
  • CHANGELOG.md
  • oshi-common/src/main/java/oshi/software/common/os/windows/WindowsOSProcess.java
  • oshi-common/src/main/java/oshi/software/os/OSProcess.java
  • oshi-common/src/main/java/oshi/util/GlobalConfig.java
  • oshi-common/src/test/java/oshi/software/os/OSProcessTest.java
  • oshi-core-ffm/src/main/java/module-info.java
  • oshi-core-ffm/src/main/java/oshi/PlatformEnumFFM.java
  • oshi-core-ffm/src/main/java/oshi/SystemInfoFFM.java
  • oshi-core-ffm/src/test/java/oshi/ffm/SystemInfoTest.java
  • oshi-core-java11/.gitignore
  • oshi-core/src/main/java/oshi/PlatformEnum.java
  • oshi-core/src/main/java/oshi/SystemInfo.java
  • oshi-core/src/test/java/oshi/SystemInfoTest.java
  • oshi-core/src/test/java/oshi/software/os/shared/OperatingSystemTest.java
  • oshi-core/src/test/java/oshi/util/platform/unix/openbsd/FstatUtilTest.java
  • oshi-demo/src/main/java/oshi/demo/gui/FileStorePanel.java
  • oshi-demo/src/main/java/oshi/demo/gui/ProcessPanel.java
  • oshi-demo/src/main/java/oshi/demo/jmx/JMXOshiAgentServer.java
  • src/site/markdown/Upgrading.md
💤 Files with no reviewable changes (9)
  • oshi-core-ffm/src/main/java/module-info.java
  • oshi-common/src/test/java/oshi/software/os/OSProcessTest.java
  • oshi-common/src/main/java/oshi/software/os/OSProcess.java
  • oshi-common/src/main/java/oshi/software/common/os/windows/WindowsOSProcess.java
  • oshi-core-ffm/src/main/java/oshi/PlatformEnumFFM.java
  • oshi-core-ffm/src/main/java/oshi/SystemInfoFFM.java
  • oshi-common/src/main/java/oshi/util/GlobalConfig.java
  • oshi-core/src/test/java/oshi/software/os/shared/OperatingSystemTest.java
  • oshi-core/src/main/java/oshi/PlatformEnum.java
✅ Files skipped from review due to trivial changes (5)
  • oshi-core/src/test/java/oshi/SystemInfoTest.java
  • oshi-demo/src/main/java/oshi/demo/gui/ProcessPanel.java
  • oshi-demo/src/main/java/oshi/demo/gui/FileStorePanel.java
  • oshi-core-java11/.gitignore
  • CHANGELOG.md
🚧 Files skipped from review as they are similar to previous changes (5)
  • oshi-core-ffm/src/test/java/oshi/ffm/SystemInfoTest.java
  • oshi-demo/src/main/java/oshi/demo/jmx/JMXOshiAgentServer.java
  • oshi-core/src/main/java/oshi/SystemInfo.java
  • oshi-core/src/test/java/oshi/util/platform/unix/openbsd/FstatUtilTest.java
  • src/site/markdown/Upgrading.md
📜 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)
  • 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, windows-latest (+ JNA==FFM)
  • GitHub Check: Test JDK 11, macos-latest
  • GitHub Check: Test JDK 11, windows-latest
  • GitHub Check: Test JDK 25, macos-latest (+ JNA==FFM)
  • GitHub Check: Lint (Spotless, Checkstyle, ForbiddenAPIs, Javadoc)
  • GitHub Check: Analyze (java)
  • GitHub Check: Codacy Static Code Analysis

📝 Walkthrough

Walkthrough

This PR removes several deprecated public APIs and constants for v7.0.0: OSProcess.getResidentSetSize(), legacy PlatformEnum/PlatformEnumFFM and SystemInfoFFM entry points, misspelled GlobalConfig constants, plus related tests, imports, module export, and upgrade documentation updates.

Changes

Cohort / File(s) Summary
Memory API Removals
oshi-common/src/main/java/oshi/software/os/OSProcess.java, oshi-common/src/main/java/oshi/software/common/os/windows/WindowsOSProcess.java
Removed deprecated getResidentSetSize() from the OSProcess interface and Windows implementation; consumers should use getResidentMemory() / getPrivateResidentMemory().
Platform Enum & FFM Entry-Point Removals
oshi-core/src/main/java/oshi/PlatformEnum.java, oshi-core-ffm/src/main/java/oshi/PlatformEnumFFM.java, oshi-core-ffm/src/main/java/oshi/SystemInfoFFM.java, oshi-core/src/main/java/oshi/SystemInfo.java, oshi-core-ffm/src/main/java/module-info.java
Deleted deprecated oshi.PlatformEnum and FFM-specific PlatformEnumFFM and SystemInfoFFM; removed SystemInfo.getCurrentPlatform(); replaced usages/imports with oshi.util.PlatformEnum; removed exports oshi; from FFM module-info.
Configuration Constant Removals
oshi-common/src/main/java/oshi/util/GlobalConfig.java
Removed three misspelled deprecated GlobalConfig constants (*_DIABLED variants); keep using correctly spelled constants (*_DISABLED).
Tests: ResidentSetSize & Platform Adjustments
oshi-common/src/test/java/oshi/software/os/OSProcessTest.java, oshi-core/src/test/java/oshi/software/os/shared/OperatingSystemTest.java, oshi-core-ffm/src/test/java/oshi/ffm/SystemInfoTest.java, oshi-core/src/test/java/oshi/util/platform/unix/openbsd/FstatUtilTest.java
Removed tests that asserted deprecated getResidentSetSize() behavior; updated tests/imports/assertions to use oshi.util.PlatformEnum (replacing deprecated enums) and removed deprecation suppressions.
Demo/Example Import Updates
oshi-demo/src/main/java/oshi/demo/gui/FileStorePanel.java, oshi-demo/src/main/java/oshi/demo/gui/ProcessPanel.java, oshi-demo/src/main/java/oshi/demo/jmx/JMXOshiAgentServer.java
Replaced imports from deprecated oshi.PlatformEnum with oshi.util.PlatformEnum; logic unchanged.
Documentation & Changelog
CHANGELOG.md, src/site/markdown/Upgrading.md
Added breaking-changes entry for v7.0.0 and expanded upgrade guide with migration steps for removed APIs, FFM artifact/JPMS notes, and corrected GlobalConfig constant names.
Project Config
oshi-core-java11/.gitignore
Added /bin/ to .gitignore.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

Deprecated flags now fade away, 🌅
Enums and methods step aside,
Imports shift to their new home,
Tests and docs updated in stride,
v7 tidies the API ride. 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and clearly summarizes the main objective of the pull request: removal of deprecated methods and classes across multiple modules.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
✨ 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
oshi-core/src/test/java/oshi/SystemInfoTest.java (1)

60-69: ⚠️ Potential issue | 🟡 Minor

Mangled class Javadoc and misplaced import.

The class-level Javadoc got truncated during editing — lines 65-66 currently read:

/** of access to many of OSHI's capabilities
 */

That's a dangling fragment (the opening sentence, e.g. "A demonstration of access to many of OSHI's capabilities.", is gone), and it will surface in generated Javadoc / IDE tooltips as-is. Additionally, the newly added import oshi.util.PlatformEnum; on line 63 is separated from the preceding oshi.util.Util import by a blank line, orphaning it from the oshi.util.* group.

🩹 Proposed fix
 import oshi.util.FormatUtil;
+import oshi.util.PlatformEnum;
 import oshi.util.Util;
 
-import oshi.util.PlatformEnum;
-
-/** of access to many of OSHI's capabilities
+/**
+ * A demonstration of access to many of OSHI's capabilities.
  */
 `@Execution`(ExecutionMode.SAME_THREAD)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@oshi-core/src/test/java/oshi/SystemInfoTest.java` around lines 60 - 69,
Restore the class Javadoc in SystemInfoTest to a complete sentence (e.g., "A
demonstration of access to many of OSHI's capabilities.") replacing the dangling
fragment between /** and */ and ensure the import grouping is tidy by moving the
import oshi.util.PlatformEnum so it sits with the other oshi.util imports
(alongside oshi.util.FormatUtil and oshi.util.Util) without the extra blank
line.
🧹 Nitpick comments (2)
oshi-core-ffm/src/test/java/oshi/ffm/SystemInfoTest.java (1)

45-47: Minor: import grouping.

import oshi.util.PlatformEnum; (line 45) is placed before oshi.hardware.* / oshi.software.os.*, breaking the alphabetical oshi.* grouping used elsewhere in the file. Consider moving it after line 47 to keep the section sorted. Same checkstyle consideration as noted on oshi-core/src/main/java/oshi/SystemInfo.java.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@oshi-core-ffm/src/test/java/oshi/ffm/SystemInfoTest.java` around lines 45 -
47, The import order breaks the alphabetical grouping for oshi.* imports: move
the import of PlatformEnum so that the three oshi imports are alphabetically
ordered (HardwareAbstractionLayer, OperatingSystem, PlatformEnum) e.g., place
the PlatformEnum import after the OperatingSystem import to satisfy the
project's import grouping/checkstyle rules and keep imports consistent with
other files.
oshi-core/src/main/java/oshi/SystemInfo.java (1)

11-19: Import ordering: oshi.util.PlatformEnum is out of place.

Line 13 places oshi.util.PlatformEnum between oshi.hardware.platform.linux.* and oshi.hardware.platform.mac.* imports, which breaks the logical grouping. The FFM variant (oshi-core-ffm/src/main/java/oshi/ffm/SystemInfo.java) correctly places oshi.util.* imports after the oshi.software.os.* block. Consider moving PlatformEnum to the same position here for consistency.

Suggested reordering
 import oshi.hardware.HardwareAbstractionLayer;
 import oshi.hardware.platform.linux.LinuxHardwareAbstractionLayerJNA;
-import oshi.util.PlatformEnum;
 import oshi.hardware.platform.mac.MacHardwareAbstractionLayerJNA;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@oshi-core/src/main/java/oshi/SystemInfo.java` around lines 11 - 19, The
import order in SystemInfo.java is inconsistent: move the oshi.util.PlatformEnum
import so it is grouped with other oshi.util.*/oshi.software.os.* imports (i.e.,
place PlatformEnum after the oshi.hardware.platform.* imports block) to match
the FFM variant; update the import list in the SystemInfo class (referencing the
PlatformEnum symbol) so imports are logically grouped and consistent with
oshi-core-ffm's ordering.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@oshi-core/src/test/java/oshi/SystemInfoTest.java`:
- Around line 60-69: Restore the class Javadoc in SystemInfoTest to a complete
sentence (e.g., "A demonstration of access to many of OSHI's capabilities.")
replacing the dangling fragment between /** and */ and ensure the import
grouping is tidy by moving the import oshi.util.PlatformEnum so it sits with the
other oshi.util imports (alongside oshi.util.FormatUtil and oshi.util.Util)
without the extra blank line.

---

Nitpick comments:
In `@oshi-core-ffm/src/test/java/oshi/ffm/SystemInfoTest.java`:
- Around line 45-47: The import order breaks the alphabetical grouping for
oshi.* imports: move the import of PlatformEnum so that the three oshi imports
are alphabetically ordered (HardwareAbstractionLayer, OperatingSystem,
PlatformEnum) e.g., place the PlatformEnum import after the OperatingSystem
import to satisfy the project's import grouping/checkstyle rules and keep
imports consistent with other files.

In `@oshi-core/src/main/java/oshi/SystemInfo.java`:
- Around line 11-19: The import order in SystemInfo.java is inconsistent: move
the oshi.util.PlatformEnum import so it is grouped with other
oshi.util.*/oshi.software.os.* imports (i.e., place PlatformEnum after the
oshi.hardware.platform.* imports block) to match the FFM variant; update the
import list in the SystemInfo class (referencing the PlatformEnum symbol) so
imports are logically grouped and consistent with oshi-core-ffm's ordering.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2c6ffad1-7dda-4325-9980-e156e6716be5

📥 Commits

Reviewing files that changed from the base of the PR and between 93da646 and 62281b8.

📒 Files selected for processing (19)
  • CHANGELOG.md
  • oshi-common/src/main/java/oshi/software/common/os/windows/WindowsOSProcess.java
  • oshi-common/src/main/java/oshi/software/os/OSProcess.java
  • oshi-common/src/main/java/oshi/util/GlobalConfig.java
  • oshi-common/src/test/java/oshi/software/os/OSProcessTest.java
  • oshi-core-ffm/src/main/java/module-info.java
  • oshi-core-ffm/src/main/java/oshi/PlatformEnumFFM.java
  • oshi-core-ffm/src/main/java/oshi/SystemInfoFFM.java
  • oshi-core-ffm/src/test/java/oshi/ffm/SystemInfoTest.java
  • oshi-core-java11/.gitignore
  • oshi-core/src/main/java/oshi/PlatformEnum.java
  • oshi-core/src/main/java/oshi/SystemInfo.java
  • oshi-core/src/test/java/oshi/SystemInfoTest.java
  • oshi-core/src/test/java/oshi/software/os/shared/OperatingSystemTest.java
  • oshi-core/src/test/java/oshi/util/platform/unix/openbsd/FstatUtilTest.java
  • oshi-demo/src/main/java/oshi/demo/gui/FileStorePanel.java
  • oshi-demo/src/main/java/oshi/demo/gui/ProcessPanel.java
  • oshi-demo/src/main/java/oshi/demo/jmx/JMXOshiAgentServer.java
  • src/site/markdown/Upgrading.md
💤 Files with no reviewable changes (9)
  • oshi-core-ffm/src/main/java/module-info.java
  • oshi-common/src/main/java/oshi/software/common/os/windows/WindowsOSProcess.java
  • oshi-common/src/main/java/oshi/software/os/OSProcess.java
  • oshi-core/src/test/java/oshi/software/os/shared/OperatingSystemTest.java
  • oshi-common/src/test/java/oshi/software/os/OSProcessTest.java
  • oshi-core-ffm/src/main/java/oshi/SystemInfoFFM.java
  • oshi-core-ffm/src/main/java/oshi/PlatformEnumFFM.java
  • oshi-common/src/main/java/oshi/util/GlobalConfig.java
  • oshi-core/src/main/java/oshi/PlatformEnum.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 25, windows-latest (+ JNA==FFM)
  • GitHub Check: Test JDK 21, windows-latest
  • GitHub Check: Test JDK 11, windows-latest
  • GitHub Check: Test JDK 25, ubuntu-latest (+ JNA==FFM)
  • GitHub Check: Test JDK 11, macos-latest
  • GitHub Check: Test JDK 21, macos-latest
  • GitHub Check: Test JDK 25, macos-latest (+ JNA==FFM)
  • GitHub Check: Lint (Spotless, Checkstyle, ForbiddenAPIs, Javadoc)
  • GitHub Check: Analyze (java)
🧰 Additional context used
🧠 Learnings (8)
📚 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-java11/.gitignore
  • oshi-demo/src/main/java/oshi/demo/jmx/JMXOshiAgentServer.java
  • oshi-demo/src/main/java/oshi/demo/gui/ProcessPanel.java
  • oshi-demo/src/main/java/oshi/demo/gui/FileStorePanel.java
  • oshi-core/src/main/java/oshi/SystemInfo.java
  • oshi-core-ffm/src/test/java/oshi/ffm/SystemInfoTest.java
  • CHANGELOG.md
  • src/site/markdown/Upgrading.md
  • oshi-core/src/test/java/oshi/SystemInfoTest.java
📚 Learning: 2026-03-29T20:01:06.452Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3014
File: oshi-core-java11/src/main/java/module-info.java:10-17
Timestamp: 2026-03-29T20:01:06.452Z
Learning: In the oshi project, `oshi-core-java25/src/main/java/module-info.java` intentionally does NOT export `oshi.util.platform.unix.freebsd`, `oshi.util.platform.unix.openbsd`, or `oshi.util.platform.unix.solaris`, because the FFM (Foreign Function & Memory) implementation only supports Windows, macOS, and Linux. This differs from `oshi-core-java11/src/main/java/module-info.java` which exports all Unix platform packages. The asymmetry is by design.

Applied to files:

  • oshi-core-java11/.gitignore
  • oshi-demo/src/main/java/oshi/demo/jmx/JMXOshiAgentServer.java
  • oshi-core/src/test/java/oshi/util/platform/unix/openbsd/FstatUtilTest.java
  • oshi-demo/src/main/java/oshi/demo/gui/ProcessPanel.java
  • oshi-demo/src/main/java/oshi/demo/gui/FileStorePanel.java
  • oshi-core/src/main/java/oshi/SystemInfo.java
  • oshi-core-ffm/src/test/java/oshi/ffm/SystemInfoTest.java
  • CHANGELOG.md
  • src/site/markdown/Upgrading.md
  • oshi-core/src/test/java/oshi/SystemInfoTest.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-demo/src/main/java/oshi/demo/jmx/JMXOshiAgentServer.java
  • oshi-core/src/test/java/oshi/util/platform/unix/openbsd/FstatUtilTest.java
  • oshi-demo/src/main/java/oshi/demo/gui/ProcessPanel.java
  • oshi-demo/src/main/java/oshi/demo/gui/FileStorePanel.java
  • oshi-core/src/main/java/oshi/SystemInfo.java
  • oshi-core-ffm/src/test/java/oshi/ffm/SystemInfoTest.java
  • oshi-core/src/test/java/oshi/SystemInfoTest.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-core/src/test/java/oshi/util/platform/unix/openbsd/FstatUtilTest.java
  • oshi-core/src/main/java/oshi/SystemInfo.java
  • oshi-core-ffm/src/test/java/oshi/ffm/SystemInfoTest.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/util/platform/unix/openbsd/FstatUtilTest.java
  • oshi-core-ffm/src/test/java/oshi/ffm/SystemInfoTest.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/main/java/oshi/SystemInfo.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/src/main/java/oshi/SystemInfo.java
  • oshi-core-ffm/src/test/java/oshi/ffm/SystemInfoTest.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/test/java/oshi/ffm/SystemInfoTest.java
🔇 Additional comments (8)
oshi-core-java11/.gitignore (1)

1-1: Good cleanup — ignoring /bin/ is a sensible repo hygiene change.

This helps prevent accidental commits of local/generated artifacts, and I don’t see any downside in this context.

oshi-demo/src/main/java/oshi/demo/jmx/JMXOshiAgentServer.java (1)

40-40: LGTM!

Import swap to oshi.util.PlatformEnum is correct; PlatformEnum.getCurrentPlatform() on line 105 resolves to the new API.

oshi-demo/src/main/java/oshi/demo/gui/FileStorePanel.java (1)

30-30: LGTM!

Mechanical migration to oshi.util.PlatformEnum; PlatformEnum.WINDOWS comparison on line 101 remains valid.

oshi-demo/src/main/java/oshi/demo/gui/ProcessPanel.java (1)

28-28: LGTM!

Import update aligns with the deprecated oshi.PlatformEnum removal; enum usages at lines 76 and 132 resolve correctly against oshi.util.PlatformEnum.

oshi-core/src/test/java/oshi/util/platform/unix/openbsd/FstatUtilTest.java (1)

12-17: Clean migration to oshi.util.PlatformEnum.

Both the static OPENBSD import (line 12) and the type import (line 17) correctly resolve to the new oshi.util.PlatformEnum in oshi-common, matching the PR-wide rename.

oshi-core-ffm/src/test/java/oshi/ffm/SystemInfoTest.java (1)

55-66: Assertions correctly retargeted to PlatformEnum.UNKNOWN.

testPlatformEnum and testGetCurrentPlatform now use the unified oshi.util.PlatformEnum, and dropping @SuppressWarnings("deprecation") is appropriate since the old PlatformEnumFFM/SystemInfoFFM.getCurrentPlatform() paths are gone. Semantics of UNKNOWN (fallback when os.name is unrecognized) match the old UNSUPPORTED usage here.

CHANGELOG.md (1)

9-9: Breaking-changes entry accurately captures all four removals.

The bullet correctly enumerates getResidentSetSize(), oshi.PlatformEnum / PlatformEnumFFM, SystemInfo.getCurrentPlatform() / SystemInfoFFM, and the misspelled GlobalConfig constants, with the right replacements. Consistent with the deprecations originally announced in #3082 and #3112.

src/site/markdown/Upgrading.md (1)

3-36: Migration guide reads well and matches the code changes.

Each removed API is paired with its replacement, including the subtle Windows-specific note that old getResidentSetSize() returned the private working set (so getPrivateResidentMemory() is the drop-in there, not getResidentMemory()). The GlobalConfig DIABLED → DISABLED table is a nice touch.

One tiny nit (non-blocking): the section header on line 5 "replaced by two methods" and the PlatformEnum section could benefit from an explicit @since 7.0.0 style note or a link to the CHANGELOG entry for readers arriving here from release notes — but given the doc lives under a clearly versioned 6.x→7.x heading, this is purely optional.

@codecov

codecov Bot commented Apr 21, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.37%. Comparing base (93da646) to head (baf548e).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3182      +/-   ##
==========================================
+ Coverage   57.36%   57.37%   +0.01%     
==========================================
  Files         424      421       -3     
  Lines       20346    20272      -74     
  Branches     3577     3563      -14     
==========================================
- Hits        11671    11632      -39     
+ Misses       6907     6878      -29     
+ Partials     1768     1762       -6     
Flag Coverage Δ
linux 22.55% <ø> (-0.15%) ⬇️
macos 25.77% <ø> (-0.08%) ⬇️
windows 34.85% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Remove OSProcess.getResidentSetSize() (replaced by getResidentMemory()
and getPrivateResidentMemory()), oshi.PlatformEnum and PlatformEnumFFM
(replaced by oshi.util.PlatformEnum), SystemInfo.getCurrentPlatform()
and SystemInfoFFM (replaced by PlatformEnum.getCurrentPlatform() and
oshi.ffm.SystemInfo), and misspelled GlobalConfig constants.

Update Upgrading.md with migration guide.
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