-
-
Notifications
You must be signed in to change notification settings - Fork 454
Second attempt to fix Kotlin 2.2 #4610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Second attempt to fix Kotlin 2.2 #4610
Conversation
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Instructions and example for changelogPlease add an entry to Example: ## Unreleased
- Second attempt to fix Kotlin 2.2 ([#4610](https://github.com/getsentry/sentry-java/pull/4610)) If none of the above apply, you can opt out of this check by adding |
Performance metrics 🚀
|
c97638e
to
68a8b1d
Compare
0e05d21
to
6a8b15d
Compare
7e8868f
into
08-04-attempt_to_fix_kotlin_2.2_issue
Merging this so we don't have to review changes in other PRs that were replaced in this PR |
@@ -145,7 +145,7 @@ fun toRequestUrl(uri: URI): StringBuffer? { | |||
url.append(':').append(port) | |||
} | |||
|
|||
if (uri?.isNotBlank()) { | |||
if (uri.isNotBlank()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Null Safety Issue with URI Handling
The removal of the null-safe operator from uri?.isNotBlank()
introduces a potential NullPointerException
. The uri
variable is assigned from uri.rawPath
, which can return null
according to Java URI documentation. This could cause a runtime NullPointerException
or a compilation error when rawPath
is null and assigned to a non-nullable String
.
kotlin { | ||
compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8 | ||
compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_8 | ||
compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Kotlin Version Mismatch in Sentry Modules
The sentry-android-fragment
and sentry-android-timber
modules are configured with Kotlin language and API version 1.8 (KOTLIN_1_8
) via compilerOptions.languageVersion
and compilerOptions.apiVersion
. This is inconsistent with most other modules in the codebase, which are updated to Kotlin 1.9 (KOTLIN_1_9
), potentially causing compatibility issues and appearing to be an oversight.
📜 Description
💡 Motivation and Context
💚 How did you test it?
📝 Checklist
sendDefaultPII
is enabled.🔮 Next steps