Skip to content

[PSI] Add org.jetbrains.annotations.NotNull to properties in KtTokens.java and KtNodeTypes.java#6512

Open
Grigorii Solnyshkin (GrigoriiSolnyshkin) wants to merge 4 commits into
masterfrom
gsolnyshkin/annotate-kt-tokens-kt-node-types
Open

[PSI] Add org.jetbrains.annotations.NotNull to properties in KtTokens.java and KtNodeTypes.java#6512
Grigorii Solnyshkin (GrigoriiSolnyshkin) wants to merge 4 commits into
masterfrom
gsolnyshkin/annotate-kt-tokens-kt-node-types

Conversation

@GrigoriiSolnyshkin

Copy link
Copy Markdown
Collaborator

No description provided.

Currently, from `something?.token == KtTokens.SOME_TOKEN` our logic
system deduces that `something != null` although `KtTokens.SOME_TOKEN`
is flexible and from type system POV can be null. In the scope of
KT-87278 we'd like to prohibit this under LF. Affected places in
kotlin.git are due to usage of properties from `KtTokens` or
`KtNodeTypes`. Hence, we annotate them here with nullability
annotations.
Currently, from `something?.token == KtTokens.SOME_TOKEN` our logic
system deduces that `something != null` although `KtTokens.SOME_TOKEN`
is flexible and from type system POV can be null. In the scope of
KT-87278 we'd like to prohibit this under LF. Affected places in
kotlin.git are due to usage of properties from `KtTokens` or
`KtNodeTypes`. Hence, we annotate them here with nullability
annotations.
@kotlin-safemerge

kotlin-safemerge Bot commented Jul 2, 2026

Copy link
Copy Markdown

@kodee-bot

kodee-bot Bot commented Jul 2, 2026

Copy link
Copy Markdown

This merge request potentially modifies the stubs format, but doesn't update KotlinStubVersions.kt.
Please verify whether a stub version bump is needed in compiler/psi/psi-api/src/org/jetbrains/kotlin/psi/stubs/KotlinStubVersions.kt.
If you are unsure, please consult with the Analysis API team (#kotlin-analysis-api in Slack).

@GrigoriiSolnyshkin

Copy link
Copy Markdown
Collaborator Author

/dry-run

@KotlinBuild

Build Server (KotlinBuild) commented Jul 2, 2026

Copy link
Copy Markdown

THIS IS A DRY RUN

Quality gate is triggered at https://buildserver.labs.intellij.net/build/991991038 — use this link to get full insight.

Quality gate was triggered with the following revisions:

kotlin
Branch: refs/merge/GITHUB-6512/safe-merge
Commit: 5e5ac66


Quality gate failed. See https://buildserver.labs.intellij.net/build/991991038 to get full insight.

@GrigoriiSolnyshkin

Copy link
Copy Markdown
Collaborator Author

JIC: the hits can be found here #6501

@yanex Yan Zhulanow (yanex) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/final

@abelkov

Copy link
Copy Markdown
Contributor

Let's do this for KDocTokens as well?

Previous commits did this for `KtTokens.java` and `KtNodeTypes.java`.
For consistency, it makes sense to do the same for `KDocTokens.java`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants