refactor(core): Replace vendored ISO8601Utils with java.time#5377
Closed
runningcode wants to merge 1 commit intomainfrom
Closed
refactor(core): Replace vendored ISO8601Utils with java.time#5377runningcode wants to merge 1 commit intomainfrom
runningcode wants to merge 1 commit intomainfrom
Conversation
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>
📲 Install BuildsAndroid
|
Contributor
Performance metrics 🚀
|
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ISO8601Utilsclass (adapted from FasterXML Jackson Databind) and replace withjava.timeAPIs inDateUtilsCalendarfor Android API 21-25 wherejava.timeis unavailable without core library desugaringClass.forName("java.time.Instant")selects the implementation, following the existingSentryInstantDate/SentryAutoDateProviderpatternNotes on Android compatibility
java.timeis only available on Android API 26+. Customers on API 21-25 without core library desugaring enabled would crash if we usedjava.timeunconditionally. Since desugaring is opt-in (requiresisCoreLibraryDesugaringEnabled = true+ adding thedesugar_jdk_libsdependency), and the SDK does not require it, we use runtime detection to fall back to a manual parser/formatter on older devices.Breaking change
ISO8601Utilswas in the.apisurface (though marked@ApiStatus.Internal). Removing it is a binary-incompatible change for anyone who happened to depend on it directly.🤖 Generated with Claude Code