Skip to content

add nullability annotations#1494

Open
gavinking wants to merge 2 commits into
jakartaee:mainfrom
gavinking:null
Open

add nullability annotations#1494
gavinking wants to merge 2 commits into
jakartaee:mainfrom
gavinking:null

Conversation

@gavinking

Copy link
Copy Markdown
Member

These were mostly robotically generated. I have done some review, but perhaps not quite as thorough as I should.

@gavinking gavinking requested review from njr-11 and otaviojava and removed request for otaviojava June 19, 2026 13:22

@njr-11 njr-11 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.

The changes will Nonnull and Nullable look fine. I noted a couple of minor things with some other changes in the PR.
Given how many places this modifies and the merge conflicts it is likely to cause (as well as soft merge conflicts), we should consider delaying merging it until after the current backlog of PRs is merged

Comment thread api/src/main/java/jakarta/data/repository/Is.java
* <li>a {@link Query} or {@link jakarta.persistence.query.JakartaQuery}
* annotation specifying a query with an {@code ORDER BY} clause, nor</li>
* <li>a {@code jakarta.persistence.query.NativeQuery} annotation.</li>
* <li>a {@link jakarta.persistence.query.NativeQuery} annotation.</li>

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.

We definitely want to change this to link, but I noticed that afterward the build generates the Javadoc without any link and without any package, as,

Image

which is worse than just {@code which at least includes the package name when there is no link. Are there more build steps that are needed to get it to find Persistence 4.0?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@njr-11 Fixed now, I believe, but please test it.

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.

Nice - it is working now.

@gavinking

Copy link
Copy Markdown
Member Author

the merge conflicts it is likely to cause

I strongly suspect that the merge conflicts will be pretty trivial, but also FYI Codex is fantastic at resolving merge conflicts, even highly nontrivial ones.

@njr-11 njr-11 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.

Looks good now

I have no idea what we could have set up differently that would cause these inconsistencies.

I don't know why we are getting inconsistent warnings either. Probably the best thing to do in the hopefully rare cases where this occurs will be to align with the maven build output and then put a comment in the code where the SuppressWarnings would be indicating that the warning suppression should either be left there or not added, so that we don't go back and forth on adding and removing the suppression. In this case, it looks like Maven is okay with removing SuppressWarnings, so we can remove it and add the note so that I don't put it back in later when I see it.

the merge conflicts it is likely to cause

I strongly suspect that the merge conflicts will be pretty trivial, but also FYI Codex is fantastic at resolving merge conflicts, even highly nontrivial ones.

Every outstanding PR that adds a method will have a soft merge conflict with this. Nothing will show up as a merge conflict, but those PRs will be lacking the Nonnull/Nullable

* <li>a {@link Query} or {@link jakarta.persistence.query.JakartaQuery}
* annotation specifying a query with an {@code ORDER BY} clause, nor</li>
* <li>a {@code jakarta.persistence.query.NativeQuery} annotation.</li>
* <li>a {@link jakarta.persistence.query.NativeQuery} annotation.</li>

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.

Nice - it is working now.

@gavinking

Copy link
Copy Markdown
Member Author

Every outstanding PR that adds a method will have a soft merge conflict with this. Nothing will show up as a merge conflict, but those PRs will be lacking the Nonnull/Nullable

Sure, but nothing a robotic review won't quickly catch.

Comment on lines +226 to +229
if ( expression == null ) {
throw new IllegalStateException(
Messages.get("013.no-expression"));
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

👀

@gavinking

Copy link
Copy Markdown
Member Author

I have updated to resolve the conflicts.

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.

2 participants