Skip to content

Use openrewrite to enforce nullability annotations#2976

Merged
MinnDevelopment merged 1 commit intomasterfrom
fix/nullability-annotations
Dec 12, 2025
Merged

Use openrewrite to enforce nullability annotations#2976
MinnDevelopment merged 1 commit intomasterfrom
fix/nullability-annotations

Conversation

@MinnDevelopment
Copy link
Copy Markdown
Member

@MinnDevelopment MinnDevelopment commented Dec 12, 2025

Pull Request Etiquette

  • I have checked the PRs for upcoming features/bug fixes.
  • I have read the contributing guidelines.
  • I applied the code formatter to my changes with ./gradlew format

Changes

  • Internal code
  • Library interface (affecting end-user code)
  • Documentation
  • Other: Static code analysis

Closes Issue: NaN

Description

This automatically replaces the NotNull/Nullable annotations with the intended ones to improve consistency. Note that you can also change your intellij settings to use the correct annotations automatically with Build, Executation, Deployment > Compiler > Configure annotations...

image

Copy link
Copy Markdown
Contributor

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 implements automated enforcement of nullability annotations by migrating from JetBrains annotations to javax annotations using OpenRewrite. The migration ensures consistency across the codebase by replacing @NotNull with @Nonnull and configuring build-time validation.

  • Adds OpenRewrite recipe to automatically migrate annotation types
  • Configures Gradle to fail on parse errors during rewrite operations
  • Updates existing code to use the standardized javax annotations

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
rewrite.yml Defines OpenRewrite recipe to migrate from JetBrains to javax annotations
build.gradle.kts Activates the migration recipe and enables strict parse error handling
MessageSerializationTest.java Replaces @NotNull import and usage with @Nonnull
PollVotersPaginationActionImpl.java Replaces @NotNull import and usage with @Nonnull
ApplicationEmojiManagerImpl.java Replaces @NotNull import and usages with @Nonnull
MessageCreateBuilder.java Replaces @NotNull import and usage with @Nonnull

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@MinnDevelopment MinnDevelopment added this pull request to the merge queue Dec 12, 2025
Merged via the queue into master with commit 2a71f08 Dec 12, 2025
7 checks passed
@MinnDevelopment MinnDevelopment deleted the fix/nullability-annotations branch December 12, 2025 13:59
MrPowerGamerBR pushed a commit to LorittaBot/DeviousJDA that referenced this pull request Dec 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants