Skip to content

refactor(core): Replace vendored ISO8601Utils with java.time#5377

Closed
runningcode wants to merge 1 commit intomainfrom
no/remove-iso8601-vendor
Closed

refactor(core): Replace vendored ISO8601Utils with java.time#5377
runningcode wants to merge 1 commit intomainfrom
no/remove-iso8601-vendor

Conversation

@runningcode
Copy link
Copy Markdown
Contributor

Summary

  • Remove the vendored ISO8601Utils class (adapted from FasterXML Jackson Databind) and replace with java.time APIs in DateUtils
  • Keep a compact legacy fallback using Calendar for Android API 21-25 where java.time is unavailable without core library desugaring
  • Runtime detection via Class.forName("java.time.Instant") selects the implementation, following the existing SentryInstantDate/SentryAutoDateProvider pattern

Notes on Android compatibility

java.time is only available on Android API 26+. Customers on API 21-25 without core library desugaring enabled would crash if we used java.time unconditionally. Since desugaring is opt-in (requires isCoreLibraryDesugaringEnabled = true + adding the desugar_jdk_libs dependency), and the SDK does not require it, we use runtime detection to fall back to a manual parser/formatter on older devices.

Breaking change

ISO8601Utils was in the .api surface (though marked @ApiStatus.Internal). Removing it is a binary-incompatible change for anyone who happened to depend on it directly.

🤖 Generated with Claude Code

Remove the vendored ISO8601Utils (adapted from FasterXML Jackson) and
replace it with java.time APIs in DateUtils. A legacy fallback using
Calendar is kept for Android API 21-25 where java.time is unavailable
without core library desugaring.

Runtime detection via Class.forName("java.time.Instant") selects the
appropriate implementation, following the same pattern as
SentryInstantDate/SentryAutoDateProvider.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@runningcode runningcode closed this May 6, 2026
@sentry
Copy link
Copy Markdown

sentry Bot commented May 6, 2026

📲 Install Builds

Android

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

⚙️ sentry-android Build Distribution Settings

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 305.96 ms 367.40 ms 61.44 ms
Size 0 B 0 B 0 B

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
2195398 319.02 ms 342.38 ms 23.36 ms
d364ace 411.72 ms 430.81 ms 19.10 ms
d15471f 286.65 ms 314.68 ms 28.03 ms
ff8eea4 313.42 ms 337.08 ms 23.66 ms
17a0955 372.53 ms 446.70 ms 74.17 ms
23d6b12 354.10 ms 408.38 ms 54.28 ms
cf708bd 408.35 ms 458.98 ms 50.63 ms
6edfca2 305.52 ms 432.78 ms 127.26 ms
72020f8 312.32 ms 370.94 ms 58.62 ms
6b019b7 343.31 ms 417.23 ms 73.91 ms

App size

Revision Plain With Sentry Diff
2195398 0 B 0 B 0 B
d364ace 1.58 MiB 2.11 MiB 539.75 KiB
d15471f 1.58 MiB 2.13 MiB 559.54 KiB
ff8eea4 1.58 MiB 2.28 MiB 718.64 KiB
17a0955 1.58 MiB 2.10 MiB 533.20 KiB
23d6b12 1.58 MiB 2.10 MiB 532.31 KiB
cf708bd 1.58 MiB 2.11 MiB 539.71 KiB
6edfca2 1.58 MiB 2.13 MiB 559.07 KiB
72020f8 1.58 MiB 2.19 MiB 620.21 KiB
6b019b7 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