Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Deprecate and hide @Nullable, @NonNull annotations to avoid name clashes with jspecify

Open
#134 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
kotlin
Domain
tooling

Research direction

The issue names kotlin-stdlib 2.2.21, org.jetbrains.annotations.Nullable and NonNull, ACC_SYNTHETIC, and @Deprecated(level = HIDDEN), but no repository files or tests. Start by locating how these annotations are compiled and published; completion requires a decided deprecation and hiding approach that preserves old runtime compatibility and includes the release announcement.

Written by the indexing model from the issue text.

Description

Currently, org.jetbrains.kotlin:kotlin-stdlib:2.2.21 depends on org.jetbrains:annotations, so it brings org.jetbrains.annotations.Nullable to IDE autocomplete.

The ecosystem moves towards https://jspecify.dev/, so it would be nice if you could deprecate and hide @Nullable and @NonNull annotations.

Deprecation is straightforward: @Deprecated + release announcement.
Hiding would probably involve adding ACC_SYNTHETIC modifier after the compilation. It would still keep the class in the bytecode, so the old libraries would still work fine in the runtime, while the new clients would need to move to a different nullability annotations.
An alternative option could be to rewrite @Nullable annotation in Kotlin and use @Deprecated(level = HIDDEN)

Dominant language
Kotlin
Stars
464
Forks
73
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from JetBrains/java-annotations

All issues in JetBrains/java-annotations

Similar issues

More Kotlin issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.