[Xamarin.Android.Tools.Bytecode] add org.jspecify.annotations.NonNull#1351
Merged
jonathanpeppers merged 2 commits intomainfrom Jul 23, 2025
Merged
[Xamarin.Android.Tools.Bytecode] add org.jspecify.annotations.NonNull#1351jonathanpeppers merged 2 commits intomainfrom
org.jspecify.annotations.NonNull#1351jonathanpeppers merged 2 commits intomainfrom
Conversation
Context: https://mvnrepository.com/artifact/org.jspecify/jspecify Context: https://mvnrepository.com/artifact/org.jspecify/jspecify/1.0.0/usages It appears that some newer AndroidX/GPS libraries are now using: ```diff --androidx.annotation.NonNull ++org.jspecify.annotations.NonNull ``` I can see versions of guava and androidx.core taking a dependency on `org.jspecify:jspecify:1.0.0`, which provides the `org.jspecify.annotations.NonNull` annotation type. I sorted the list of annotation types alphabetically, and added the `org.jspecify.annotations.NonNull` annotation type to the list of recognized annotations in `XmlClassDeclarationBuilder.cs`.
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for the org.jspecify.annotations.NonNull annotation type to the XML class declaration builder. The change addresses the migration from older AndroidX/GPS libraries that are transitioning from androidx.annotation.NonNull to the newer org.jspecify.annotations.NonNull annotation.
- Adds recognition for the
org.jspecify.annotations.NonNullannotation type in the null-check logic - Alphabetically sorts the existing annotation cases for better maintainability
jonathanpeppers
added a commit
that referenced
this pull request
Jul 23, 2025
…l` (#1351) Context: https://mvnrepository.com/artifact/org.jspecify/jspecify Context: https://mvnrepository.com/artifact/org.jspecify/jspecify/1.0.0/usages Context: https://github.com/JetBrains/kotlin/blob/03360c0108797b2a98b6608e2bddfacd5f4e87ce/core/compiler.common.jvm/src/org/jetbrains/kotlin/load/java/JvmAnnotationNames.kt#L64-L91 It appears that some newer AndroidX/GPS libraries are now using: ```diff --androidx.annotation.NonNull ++org.jspecify.annotations.NonNull ``` I can see versions of guava and androidx.core taking a dependency on `org.jspecify:jspecify:1.0.0`, which provides the `org.jspecify.annotations.NonNull` annotation type. I sorted the list of annotation types alphabetically, and added the `org.jspecify.annotations.NonNull` annotation type to the list of recognized annotations in `XmlClassDeclarationBuilder.cs`. So, then we found a list of "non-null" annotations in the Kotlin compiler. Updated to include some of the ones they list as well.
10 tasks
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Context: https://mvnrepository.com/artifact/org.jspecify/jspecify
Context: https://mvnrepository.com/artifact/org.jspecify/jspecify/1.0.0/usages
It appears that some newer AndroidX/GPS libraries are now using:
I can see versions of guava and androidx.core taking a dependency on
org.jspecify:jspecify:1.0.0, which provides theorg.jspecify.annotations.NonNullannotation type.I sorted the list of annotation types alphabetically, and added the
org.jspecify.annotations.NonNullannotation type to the list of recognized annotations inXmlClassDeclarationBuilder.cs.