Skip to content

Deprecate Display.getEdid(); remove unreleased Display.isEdidSynthetic() - #3438

Merged
dbwiddis merged 1 commit into
oshi:masterfrom
dbwiddis:deprecate-display-getedid
Jul 8, 2026
Merged

dbwiddis merged 1 commit into
oshi:masterfrom
dbwiddis:deprecate-display-getedid

Conversation

@dbwiddis

@dbwiddis dbwiddis commented Jul 8, 2026 •

Copy link
Copy Markdown
Member

Consolidates all display data access under Display.getDisplayInfo(), so DisplayInfo is the single accessor going forward.

Changes

  • Deprecate Display.getEdid() in favor of getDisplayInfo().getEdid(). The @deprecated javadoc documents "as of 7.4.0" and "scheduled for removal in the next major version" (oshi-common targets Java 8, so plain @Deprecated — no since/forRemoval elements).
  • Remove Display.isEdidSynthetic(). It was introduced in Add DisplayInfo and EDID encoding to expose display attributes without a raw EDID #3415 during this still-unreleased 7.4.0 cycle, so removing it now avoids shipping-then-deprecating a redundant method. DisplayInfo.isEdidSynthetic() remains the accessor.
  • Migrate internal consumers (DisplayTest, OsHwTextPanel demo) to getDisplayInfo().getEdid(); AbstractDisplayTest keeps getEdid() coverage via @SuppressWarnings("deprecation") until removal.
  • Modernize the Display javadoc example to lead with getDisplayInfo().
  • CHANGELOG: correct the Add DisplayInfo and EDID encoding to expose display attributes without a raw EDID #3415 entry (no longer advertises the removed Display.isEdidSynthetic()) and add the deprecation note.

Why now

The API surface should be settled before 7.4.0 ships. isEdidSynthetic() is unreleased, so this is the last free window to drop it without a deprecation cycle; deprecating getEdid() in the same release gives consumers a clean pointer to the richer DisplayInfo API (including synthetic-EDID displays, currently macOS built-in Retina).

Summary by CodeRabbit

  • Bug Fixes
    • Display EDID details now come through the updated display information view, with synthetic-EDID status exposed there as well.
    • The older direct EDID access path is now deprecated in favor of the newer display information-based method.
    • Display-related output and checks were updated to use the revised EDID access path, keeping results consistent for end users.

Consolidate display data access under Display.getDisplayInfo():

- Deprecate Display.getEdid() (javadoc points to getDisplayInfo().getEdid();
  scheduled for removal in the next major version). Java 8 target, so plain
  @deprecated with the since/removal intent documented in the @deprecated tag.
- Remove Display.isEdidSynthetic(). It was added in #3415 during this (still
  unreleased) 7.4.0 cycle, so removing it now avoids shipping then deprecating
  a redundant method; DisplayInfo.isEdidSynthetic() remains the accessor.
- Migrate internal consumers (DisplayTest, OsHwTextPanel demo) to
  getDisplayInfo().getEdid(); AbstractDisplayTest keeps getEdid() coverage via
  @SuppressWarnings until removal.
- CHANGELOG: correct the #3415 entry and add the deprecation note.
@coderabbitai

coderabbitai Bot commented Jul 8, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 46c45154-1cca-416f-aefc-afa18b2193cc

📥 Commits

Reviewing files that changed from the base of the PR and between 2b74b20 and b178f56.

📒 Files selected for processing (6)
  • CHANGELOG.md
  • oshi-common/src/main/java/oshi/hardware/Display.java
  • oshi-common/src/main/java/oshi/hardware/common/AbstractDisplay.java
  • oshi-common/src/test/java/oshi/hardware/common/AbstractDisplayTest.java
  • oshi-core/src/test/java/oshi/hardware/platform/shared/DisplayTest.java
  • oshi-demo/src/main/java/oshi/demo/gui/OsHwTextPanel.java
📜 Recent review details
⏰ Context from checks skipped due to timeout. (14)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Analyze (java)
  • GitHub Check: Test JDK 26, ubuntu-latest
  • GitHub Check: Test JDK 21, windows-latest
  • GitHub Check: Test JDK 26, windows-latest
  • GitHub Check: Test JDK 21, macos-latest
  • GitHub Check: Test JDK 25, windows-latest (+ JNA==FFM)
  • GitHub Check: Test JDK 25, ubuntu-latest (+ JNA==FFM)
  • GitHub Check: Test JDK 26, macos-latest
  • GitHub Check: Test JDK 25, macos-latest (+ JNA==FFM)
  • GitHub Check: Test JDK 25, OpenBSD (+ JNA==FFM)
  • GitHub Check: Lint (Spotless, Checkstyle, ForbiddenAPIs, Javadoc)
  • GitHub Check: Test JDK 25, OpenIndiana (+ JNA==FFM)
  • GitHub Check: Test JDK 25, FreeBSD (+ JNA==FFM)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2026-07-06T19:25:59.225Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3432
File: oshi-common/src/main/java/oshi/util/ExceptionUtil.java:26-56
Timestamp: 2026-07-06T19:25:59.225Z
Learning: In this repo’s SLF4J 1.x-compatible logging code, do not flag cases where a logger call uses SLF4J 1.6+ implicit-cause handling—e.g., `log.error("...{}", value, t)` (or similar with a single `{}` placeholder) where `t` is passed as the final/trailing argument. SLF4J will attach `t` as the log event’s cause with the full stack trace; this is equivalent to SLF4J 2.x’s fluent `atLevel(...).setCause(t).log(...)` and is intentionally used to preserve SLF4J 1.x runtime compatibility.

Applied to files:

  • oshi-demo/src/main/java/oshi/demo/gui/OsHwTextPanel.java
  • oshi-common/src/main/java/oshi/hardware/Display.java
  • oshi-common/src/main/java/oshi/hardware/common/AbstractDisplay.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/Display.java
  • oshi-common/src/main/java/oshi/hardware/common/AbstractDisplay.java
🔇 Additional comments (6)
oshi-common/src/main/java/oshi/hardware/Display.java (1)

13-55: LGTM!

oshi-common/src/main/java/oshi/hardware/common/AbstractDisplay.java (1)

39-53: LGTM!

oshi-common/src/test/java/oshi/hardware/common/AbstractDisplayTest.java (1)

17-17: LGTM!

Also applies to: 49-49, 58-58, 68-68

oshi-core/src/test/java/oshi/hardware/platform/shared/DisplayTest.java (1)

31-32: LGTM!

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

150-150: LGTM!

CHANGELOG.md (1)

5-5: LGTM!

Also applies to: 16-16


📝 Walkthrough

Walkthrough

This PR deprecates Display.getEdid() and removes Display.isEdidSynthetic(), consolidating EDID-related access under the new DisplayInfo interface. AbstractDisplay, tests, and a demo caller are updated accordingly, along with changelog entries documenting both changes.

Changes

EDID API consolidation under DisplayInfo

Layer / File(s) Summary
Display interface documentation and deprecation
oshi-common/src/main/java/oshi/hardware/Display.java
Reworked Javadoc around getDisplayInfo(), marked getEdid() as @Deprecated, and removed isEdidSynthetic().
AbstractDisplay implementation updates
oshi-common/src/main/java/oshi/hardware/common/AbstractDisplay.java
Annotated getEdid() with @Deprecated and removed the isEdidSynthetic() override.
Test updates for DisplayInfo-based EDID access
oshi-common/src/test/java/oshi/hardware/common/AbstractDisplayTest.java, oshi-core/src/test/java/oshi/hardware/platform/shared/DisplayTest.java
Tests updated to call getDisplayInfo().isEdidSynthetic() and getDisplayInfo().getEdid(), with a @SuppressWarnings("deprecation") annotation added.
Demo caller update and changelog
oshi-demo/src/main/java/oshi/demo/gui/OsHwTextPanel.java, CHANGELOG.md
Demo panel now reads EDID via getDisplayInfo().getEdid(); changelog updated for PR #3415 and a new bullet added for PR #3438.

Estimated code review effort: 2 (Simple) | ~15 minutes

Possibly related PRs

  • oshi/oshi#3415: Introduced the isEdidSynthetic() API on Display and DisplayInfo that this PR relocates and refactors.

Poem

A rabbit hops through EDID bytes,
Moving flags to DisplayInfo heights,
getEdid() waves a deprecated paw,
Tests now follow the new-found law,
Hop, hop, hooray for cleaner code! 🐇✨

🚥 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 accurately summarizes the main API change: deprecating Display.getEdid() and removing the unreleased isEdidSynthetic() method.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@codecov

codecov Bot commented Jul 8, 2026 •

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3438      +/-   ##
============================================
- Coverage     74.45%   74.38%   -0.07%     
  Complexity       76       76              
============================================
  Files           580      580              
  Lines         21980    21979       -1     
  Branches       3670     3670              
============================================
- Hits          16365    16350      -15     
- Misses         3580     3590      +10     
- Partials       2035     2039       +4     
Flag Coverage Δ
freebsd 26.73% <ø> (+0.01%) ⬆️
linux 31.25% <ø> (-0.01%) ⬇️
macos 31.73% <ø> (-0.05%) ⬇️
openbsd 26.22% <ø> (-0.01%) ⬇️
solaris 28.24% <ø> (+0.01%) ⬆️
windows 39.57% <ø> (-0.04%) ⬇️

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

☔ View full report in Codecov by Harness.
📢 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 ab7b913 into oshi:master Jul 8, 2026
20 checks passed
@dbwiddis
dbwiddis deleted the deprecate-display-getedid branch July 8, 2026 22:37
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