Skip to content

ref(core): Drop the Java 9+ check now that the SDK requires Java 11 - #6792

Open
sentry-junior[bot] wants to merge 1 commit into
9.x.xfrom
ref/drop-java-nine-plus-check
Open

sentry-junior[bot] wants to merge 1 commit into
9.x.xfrom
ref/drop-java-nine-plus-check

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

📜 Description

Removes Platform.isJavaNinePlus() together with the java.specification.version parsing behind it. Its two callers now check only Platform.isJvm():

  • SentryAutoDateProvider uses SentryInstantDateProvider on the JVM and SentryNanotimeDateProvider on Android
  • SystemEpochClock reads Instant on the JVM and currentTimeMillis on Android

The SentryNanotimeDate Javadoc no longer describes it as a pre-Java 9 workaround.

💡 Motivation and Context

Since #6459, 9.x compiles for Java 11, and the SDK can't load on Java 8 at all. On the JVM isJavaNinePlus is therefore always true, and on Android it was already hard-coded to false. The Java 8 branches were dead code. What remained was a static initializer that parsed a system property inside a broad catch (Throwable) on the startup path.

Behavior only changes for a runtime that isn't detected as Android but reports a spec version below 9. Android itself reports 0.9, but it is detected through java.vendor. Such a runtime now gets Instant instead of the nanotime fallback.

Platform is @ApiStatus.Internal. The removed getter appears only in sentry.api, so this has no changelog entry.

#skip-changelog

via alexander.dinauer.

--

View Session [Sentry]

Co-Authored-By: Alexander Dinauer <alexander.dinauer@sentry.io>
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 26, 2026
@github-actions

Copy link
Copy Markdown
Contributor

PR risk: medium

For commit efe7e0c.

Main concerns: public contract, reach.

Rules that block low also fired:

  • R4: a public API record changed: sentry/api/sentry.api

This label is a hint for reviewers, not an approval.

@sentry

sentry Bot commented Nov 26, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.66.0 (1) release

⚙️ sentry-android Build Distribution Settings

@adinauer
adinauer marked this pull request as ready for review November 26, 2026 13:57
@adinauer
adinauer requested review from a team and adinauer as code owners November 26, 2026 13:57
@adinauer
adinauer requested review from markushi and romtsn and removed request for a team November 26, 2026 13:57
@github-actions github-actions Bot added risk: medium PR risk score: medium and removed risk: medium PR risk score: medium labels Nov 26, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants