Skip to content

Remove relocation modules, switch to --release compiler flag - #3217

Merged
dbwiddis merged 1 commit into
oshi:masterfrom
dbwiddis:remove-relocation-modules
Apr 30, 2026
Merged

dbwiddis merged 1 commit into
oshi:masterfrom
dbwiddis:remove-relocation-modules

Conversation

@dbwiddis

@dbwiddis dbwiddis commented Apr 30, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Remove oshi-core-java11 and oshi-core-java25 relocation modules (published with 7.0.0, no longer needed in the build)
  • Remove java11 profile (its only remaining purpose was setting maven.compiler.release, now set directly)
  • Replace maven.compiler.source/target with maven.compiler.release across all modules
  • Update manifest entries to reference maven.compiler.release

The -Xlint:-options flag is retained because --release 8 on JDK 25 still triggers the "source value 8 is obsolete" warning (confirmed by testing javac directly).

Summary by CodeRabbit

  • Chores

    • Updated build configuration to target Java 25
    • Removed deprecated Java 11 redirect artifact
    • Consolidated Java 25 module to primary oshi-core-ffm artifact
  • Documentation

    • Enhanced test utility documentation for improved clarity

- Remove oshi-core-java11 and oshi-core-java25 relocation modules
- Remove java11 profile (no longer needed for module inclusion)
- Replace maven.compiler.source/target with maven.compiler.release
- Update manifest entries to reference maven.compiler.release
@coderabbitai

coderabbitai Bot commented Apr 30, 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: 5b56c4e6-e7d6-4250-a278-3c24926e6ae7

📥 Commits

Reviewing files that changed from the base of the PR and between 2155651 and d744cd7.

📒 Files selected for processing (8)
  • oshi-benchmark/pom.xml
  • oshi-benchmark/src/test/java/oshi/comparison/ComparisonAssertions.java
  • oshi-benchmark/src/test/java/oshi/comparison/NativeComparisonTest.java
  • oshi-core-ffm/pom.xml
  • oshi-core-java11/.gitignore
  • oshi-core-java11/pom.xml
  • oshi-core-java25/pom.xml
  • pom.xml
💤 Files with no reviewable changes (3)
  • oshi-core-java11/.gitignore
  • oshi-core-java25/pom.xml
  • oshi-core-java11/pom.xml
📜 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). (15)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Test JDK 25, ubuntu-latest (+ JNA==FFM)
  • GitHub Check: Test JDK 11, windows-latest
  • GitHub Check: Test JDK 21, windows-latest
  • GitHub Check: Test JDK 25, windows-latest (+ JNA==FFM)
  • GitHub Check: Test JDK 25, macos-latest (+ JNA==FFM)
  • GitHub Check: Test JDK 11, macos-latest
  • GitHub Check: Test JDK 11, ubuntu-latest
  • GitHub Check: Test JDK 21, ubuntu-latest
  • GitHub Check: Test JDK 21, macos-latest
  • GitHub Check: JMH Benchmarks, macos-latest
  • GitHub Check: JMH Benchmarks, windows-latest
  • GitHub Check: JMH Benchmarks, ubuntu-latest
  • GitHub Check: Lint (Spotless, Checkstyle, ForbiddenAPIs, Javadoc)
  • GitHub Check: Analyze (java)
🧰 Additional context used
🧠 Learnings (5)
📚 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-ffm/pom.xml
  • pom.xml
📚 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-ffm/pom.xml
  • pom.xml
📚 Learning: 2026-04-19T01:28:47.155Z
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:47.155Z
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-benchmark/src/test/java/oshi/comparison/NativeComparisonTest.java
📚 Learning: 2026-04-18T03:18:06.205Z
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:06.205Z
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-benchmark/src/test/java/oshi/comparison/NativeComparisonTest.java
📚 Learning: 2026-04-20T03:07:05.660Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3176
File: oshi-core-java25/src/main/java/oshi/hardware/platform/windows/WindowsVirtualMemoryFFM.java:53-60
Timestamp: 2026-04-20T03:07:05.660Z
Learning: In OSHI's Windows FFM paging file implementation (`oshi-core-java25/src/main/java/oshi/hardware/platform/windows/WindowsVirtualMemoryFFM.java`), the `querySwapUsed()` method uses the Windows PDH raw counter for "% Usage" on the paging file. Despite its name, this raw counter returns page counts: `FirstValue` is the number of pages currently used and `SecondValue` is the total number of pages in the swap file. The formatted counter performs the division and multiplies by 100% to yield a true percentage. Therefore, computing swap used bytes as `pageSize * used.get()` (pages × page size) is correct — do not treat the return value as a percentage.

Applied to files:

  • oshi-benchmark/src/test/java/oshi/comparison/NativeComparisonTest.java
🔇 Additional comments (5)
pom.xml (1)

74-75: Looks good — the release migration is internally consistent.

The parent POM now drives compilation and manifest metadata from the same property, and the Java 25-only modules remain scoped to the java25 profile as intended.

Also applies to: 162-163, 326-327, 362-363, 422-423, 1014-1019

oshi-core-ffm/pom.xml (1)

19-20: LGTM.

Using maven.compiler.release/testRelease here matches the Java 25 requirement of the FFM module and stays consistent with the parent build cleanup.

oshi-benchmark/pom.xml (1)

19-20: Looks good.

These properties now line up cleanly with the module's existing JDK 25 toolchain configuration.

oshi-benchmark/src/test/java/oshi/comparison/NativeComparisonTest.java (1)

65-68: Nice documentation pass.

These method comments make the comparison suite easier to scan without changing any of the test behavior.

Also applies to: 92-92, 102-102, 109-109, 123-123, 137-137, 155-155, 166-166, 179-179, 190-190, 201-201

oshi-benchmark/src/test/java/oshi/comparison/ComparisonAssertions.java (1)

17-24: LGTM.

Documenting both overloads helps clarify how ratio-based tolerance is expected to be used across the comparison tests.

Also applies to: 29-36


📝 Walkthrough

Walkthrough

This PR standardizes the project build to Java 25 by replacing explicit Maven compiler source/target properties with the release configuration property, removes legacy Java 11-specific artifacts and their corresponding profiles, and updates module dependencies. Documentation additions clarify test method purposes.

Changes

Cohort / File(s) Summary
Maven Compiler Configuration Updates
oshi-benchmark/pom.xml, oshi-core-ffm/pom.xml, pom.xml
Replaces explicit source/target and testSource/testTarget properties with release and testRelease set to 25. Main POM also adds -Xlint:-options flag and updates JAR/Javadoc/source plugin manifest metadata to reference release property.
Legacy Java 11 Artifact Removal
oshi-core-java11/pom.xml, oshi-core-java11/.gitignore
Deletes the oshi-core-java11 POM module (which redirected to oshi-core) and removes its bin/ directory from version control ignore rules.
Java 25 Profile Simplification
oshi-core-java25/pom.xml
Removes the oshi-core-java25 POM artifact and its relocation configuration that previously redirected to oshi-core-ffm.
Main POM Profile Changes
pom.xml
Removes the entire java11 Maven profile and updates the java25 profile to exclude oshi-core-java25 module, simplifying version-specific build logic.
Documentation Additions
oshi-benchmark/src/test/java/oshi/comparison/ComparisonAssertions.java, oshi-benchmark/src/test/java/oshi/comparison/NativeComparisonTest.java
Adds Javadoc comments to assertion helper methods and test setup/comparison methods without modifying any test logic or control flow.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🚀 Java eleven's day has passed,
Release properties built to last,
Twenty-five becomes the way,
Build configs bright and clean today!
Legacy profiles drift away. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the two main objectives of the PR: removing relocation modules and switching to the --release compiler flag.
Docstring Coverage ✅ Passed Docstring coverage is 92.86% which is sufficient. The required threshold is 80.00%.
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
Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov

codecov Bot commented Apr 30, 2026 •

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3217      +/-   ##
============================================
- Coverage     61.45%   55.95%   -5.50%     
- Complexity        0     2170    +2170     
============================================
  Files           423      423              
  Lines         20408    20408              
  Branches       3578     3578              
============================================
- Hits          12542    11420    -1122     
- Misses         6079     7305    +1226     
+ Partials       1787     1683     -104     
Flag Coverage Δ
linux 26.02% <ø> (+0.07%) ⬆️
macos 29.57% <ø> (-0.01%) ⬇️
windows 32.18% <ø> (-7.48%) ⬇️

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.

@dbwiddis
dbwiddis merged commit 0dc8995 into oshi:master Apr 30, 2026
18 of 19 checks passed
@dbwiddis
dbwiddis deleted the remove-relocation-modules branch April 30, 2026 22:07
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