Skip to content

Conversation

@jonathanpeppers
Copy link
Member

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:

--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.

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`.
@jonathanpeppers jonathanpeppers requested a review from Copilot July 23, 2025 17:09
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.NonNull annotation type in the null-check logic
  • Alphabetically sorts the existing annotation cases for better maintainability

@jonathanpeppers jonathanpeppers enabled auto-merge (squash) July 23, 2025 17:28
@jonathanpeppers jonathanpeppers merged commit dba12b8 into main Jul 23, 2025
2 checks passed
@jonathanpeppers jonathanpeppers deleted the dev/peppers/org.jspecify.annotations branch July 23, 2025 17:33
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.
@github-actions github-actions bot locked and limited conversation to collaborators Aug 23, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants