Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to JSpecify #143

Open
koppor opened this issue Sep 11, 2023 · 3 comments
Open

Switch to JSpecify #143

koppor opened this issue Sep 11, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@koppor
Copy link
Contributor

koppor commented Sep 11, 2023

I really like that the code has non-null annotations.

There is a long discussion about the "right" null annotation: https://stackoverflow.com/q/4963300/873282

Fortunately, Google, JetBrains, Facebook, Uber and others managed to agree on one annotation: JSpecify. I especially like @NullMarked which indicates that the all nullalbes places have explicitly marked - and all other places are non-null.

I suggest to switch from the JetBrains-focused Nullable annotations to the ones of JSpecify.

@charphi
Copy link
Member

charphi commented Sep 11, 2023

I agree; NPE is a recurring problem.

However, I have some concerns about the stability of this new API/specification. It was announced a couple of years ago but is still not released.

@charphi charphi added the enhancement New feature or request label Sep 11, 2023
@koppor
Copy link
Contributor Author

koppor commented Sep 12, 2023

I also kind of hesitated to use/switch. However, the adoption page reads very interesting: https://github.com/jspecify/jspecify/wiki/adoption

As of JSpecify 0.3, it's now extremely unlikely there will be any compilation-breaking change to the four annotation interfaces (exception [NullMarked on methods]). We're not moving, renaming, or removing anything anymore. So once your tools recognize them at all, then switching probably couldn't hurt much.

@koppor
Copy link
Contributor Author

koppor commented Oct 22, 2023

Side note: When switching, internal.nbbrd.service.com.github.javaparser.quality.NotNull needs to re replaced, too. 😋

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants