Skip to content

test: Verify Java 8 API compatibility coverage#5747

Draft
adinauer wants to merge 1 commit into
ci/java8-api-compatibilityfrom
test/java8-api-compatibility-multiple
Draft

test: Verify Java 8 API compatibility coverage#5747
adinauer wants to merge 1 commit into
ci/java8-api-compatibilityfrom
test/java8-api-compatibility-multiple

Conversation

@adinauer

@adinauer adinauer commented Jul 8, 2026

Copy link
Copy Markdown
Member

📜 Description

Intentionally introduce Java 8-incompatible JDK API references across several JVM integration modules.

This PR is a validation PR for #5745 and is expected to fail the Animal Sniffer checks wired into check.

Intentional violations:

  • :sentry-logback: Objects.requireNonNullElse(Object, Object)
  • :sentry-jul: Objects.requireNonNullElse(Object, Object)
  • :sentry-apache-http-client-5: Objects.requireNonNullElse(Object, Object)
  • :sentry-okhttp: Objects.requireNonNullElse(Object, Object)

This covers both modules that already had Animal Sniffer and modules that #5745 newly configures. The core :sentry violation was intentionally removed so the normal check lifecycle reaches non-core module failures in CI.

💡 Motivation and Context

This verifies the Java 8 runtime API compatibility coverage added in #5745 catches newer JDK API references across multiple JVM SDK integration modules while leaving Android builds unaffected.

💚 How did you test it?

Normal check fails in a non-core module once the core violation is removed:

./gradlew check --no-configuration-cache -Dorg.gradle.configureondemand=false

BUILD FAILED

[Undefined reference] io.sentry.transport.apache.(ApacheHttpClientTransportFactory.java:31)
  >> Object java.util.Objects.requireNonNullElse(Object, Object)

Focused --continue run confirms all intentional non-core violations are caught:

./gradlew :sentry-logback:animalsnifferMain \
  :sentry-jul:animalsnifferMain \
  :sentry-apache-http-client-5:animalsnifferMain \
  :sentry-okhttp:animalsnifferMain \
  --continue --no-configuration-cache -Dorg.gradle.configureondemand=false

BUILD FAILED

[Undefined reference] io.sentry.jul.(SentryHandler.java:261)
  >> Object java.util.Objects.requireNonNullElse(Object, Object)
[Undefined reference] io.sentry.logback.(SentryAppender.java:233)
  >> Object java.util.Objects.requireNonNullElse(Object, Object)
[Undefined reference] io.sentry.transport.apache.(ApacheHttpClientTransportFactory.java:31)
  >> Object java.util.Objects.requireNonNullElse(Object, Object)
[Undefined reference | java18-1.0] io.sentry.okhttp.(SentryOkHttpUtils.kt:79)
  >> Object java.util.Objects.requireNonNullElse(Object, Object)

Android still assembles:

./gradlew :sentry-android-core:assembleDebug :sentry-android-timber:assembleDebug \
  --no-configuration-cache -Dorg.gradle.configureondemand=false

BUILD SUCCESSFUL

Formatting/API generation still passes:

./gradlew spotlessApply apiDump
BUILD SUCCESSFUL

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.

🔮 Next steps

Close this PR after confirming the workflow fails as expected.

#skip-changelog

@sentry

sentry Bot commented Jul 8, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

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

⚙️ sentry-android Build Distribution Settings

@adinauer adinauer force-pushed the ci/java8-api-compatibility branch from 0229500 to 305dafe Compare July 8, 2026 14:23
@adinauer adinauer force-pushed the test/java8-api-compatibility-multiple branch from e4d6027 to 53c091c Compare July 8, 2026 14:25
Intentionally introduce Java 8-incompatible JDK API references across existing and newly covered JVM integration modules. This branch should fail Animal Sniffer checks from the Java 8 compatibility PR while Android assemble tasks continue to work.
@adinauer adinauer force-pushed the test/java8-api-compatibility-multiple branch from 53c091c to dcf938e Compare July 8, 2026 14:29
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 311.77 ms 370.84 ms 59.07 ms
Size 0 B 0 B 0 B

Baseline results on branch: ci/java8-api-compatibility

Startup times

Revision Plain With Sentry Diff
29117d4 315.09 ms 353.43 ms 38.34 ms
e122d12 360.71 ms 433.96 ms 73.25 ms
609df4f 315.04 ms 360.96 ms 45.92 ms

App size

Revision Plain With Sentry Diff
29117d4 0 B 0 B 0 B
e122d12 0 B 0 B 0 B
609df4f 0 B 0 B 0 B

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