🔧 chore: update version to 3.27.5 and improve service loader fallback…#387
Conversation
… method - increment version in gradle.properties to 3.27.5 - refactor requiredService function to simplify service loading logic - add deprecated method for binary compatibility with existing code
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 36168b4e23
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @Deprecated("Binary compatibility", ReplaceWith("serviceWithFallback(loader, type)"), DeprecationLevel.HIDDEN) | ||
| @PublishedApi | ||
| internal fun <T : Any> serviceWithFallback(loader: ServiceLoader<T>, type: Class<T>): T? { | ||
| return serviceWithFallback(type) |
There was a problem hiding this comment.
Preserve the caller-provided service loader
For already-compiled callers of the previous inline requiredService, the caller class loader is passed in through this loader argument. Delegating to the one-arg overload discards that loader and reloads with type.classLoader, so any existing caller whose META-INF/services entry is only visible from its own/plugin class loader will start throwing ServiceConfigurationError after upgrading. Please iterate the supplied loader here to preserve the old binary-compatible behavior.
Useful? React with 👍 / 👎.
| } | ||
|
|
||
| @PublishedApi | ||
| internal fun <T : Any> serviceWithFallback(type: Class<T>): T? { |
There was a problem hiding this comment.
Update the API dump for the new ABI
This module applies api-validation, and the tracked surf-api-core/surf-api-core/api/surf-api-core.api still only lists the existing two-arg serviceWithFallback entry. Because @PublishedApi internal members are emitted in the public ABI, adding this overload without updating the API dump will make :surf-api-core:surf-api-core:apiCheck fail for builds/releases with the expected JDK. Please update the dump with the new signature or avoid adding a new ABI entry.
Useful? React with 👍 / 👎.
… method