Skip to content

Conversation

@dondonz
Copy link
Member

@dondonz dondonz commented Aug 23, 2025

Trying out IntelliJ's Infer Nullity tool to speed things up

I gave https://github.com/ucr-riple/NullAwayAnnotator a try but I couldn't get it to work. I'm sure I am missing something, but anyway IntelliJ's tool works pretty well and doesn't require extra installation

@github-actions
Copy link
Contributor

Test Results

  326 files    326 suites   3m 31s ⏱️
5 022 tests 5 016 ✅ 6 💤 0 ❌
5 111 runs  5 105 ✅ 6 💤 0 ❌

Results for commit afdd408.

if (enumValueDefinition == null) {
assertShouldNeverHappen(i18nMsg(locale, "Enum.badName", name, input.toString()));
};
}
Copy link
Member

Choose a reason for hiding this comment

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

I hated that semi colon!

Copy link
Member Author

Choose a reason for hiding this comment

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

Take that semi colon!!! Nah I just did what the IDE told me to do, because I was looking for NullAway errors

public GraphQLCodeRegistry getCodeRegistry() {
public @Nullable GraphQLCodeRegistry getCodeRegistry() {
return codeRegistry;
}
Copy link
Member

Choose a reason for hiding this comment

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

Really??? This seems odd

Copy link
Member Author

Choose a reason for hiding this comment

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

I thought it was strange too, if I recall correctly it's because we have an unusual constructor where it's allowed to be null. I was going to ask if there's a historical reason for that case. I'll check when I'm at a computer next!

Copy link
Member Author

@dondonz dondonz Aug 27, 2025

Choose a reason for hiding this comment

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

Check out the first constructor in this class where the code registry is set to null

this.codeRegistry = null;

In the same constructor there is also an assertion that it's not null in the builder, which seems unusual

 assertNotNull(builder.codeRegistry, () -> "codeRegistry can't be null");

I guess the first constructor is a "partial" one, but because the object is created, we have to annotate the code registry as nullable

Copy link
Member Author

Choose a reason for hiding this comment

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

Perhaps that first constructor was acting more like a builder. We could also change the constructor to avoid this nullable annotation

@dondonz dondonz added this to the 25.x breaking changes milestone Aug 27, 2025
@dondonz dondonz modified the milestones: 25.x breaking changes, 26.x Nov 9, 2025
@dondonz
Copy link
Member Author

dondonz commented Dec 4, 2025

All the changes here are contained in #4105, continued on that PR

@dondonz dondonz closed this Dec 4, 2025
@dondonz dondonz removed this from the 26.x milestone Dec 4, 2025
@dondonz dondonz mentioned this pull request Dec 4, 2025
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.

3 participants