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

Remove @Target(MODULE) from @NullUnmarked? #348

Closed
kevinb9n opened this issue Nov 29, 2022 · 3 comments
Closed

Remove @Target(MODULE) from @NullUnmarked? #348

kevinb9n opened this issue Nov 29, 2022 · 3 comments
Labels
design An issue that is resolved by making a decision, about whether and how something should work. nullness For issues specific to nullness analysis.
Milestone

Comments

@kevinb9n
Copy link
Collaborator

Seems like it can't serve any purpose and might confuse someone (who rightly thinks "but I thought it was the default").

@kevinb9n kevinb9n added this to the 0.3 milestone Nov 29, 2022
@kevinb9n kevinb9n added the nullness For issues specific to nullness analysis. label Nov 29, 2022
@cpovirk
Copy link
Collaborator

cpovirk commented Nov 29, 2022

That sounds sensible, and I like it a lot for an additional reason:

Removing MODULE would at least marginally decrease the chances that users would encounter the crash discussed in #302. In fact, if we imagine a world in which users use @NullMarked only at the class, package, and module levels, while perhaps using @NullUnmarked on individual methods, then removing MODULE would eliminate #302. In practice, I'm sure it wouldn't totally eliminate it. But it might help a lot.

The main counterargument I can see is that an enterprising organization might try to "flip the default" for now code so that all code is considered null-marked unless otherwise annotated :) Then they might theoretically want to unmark their already existing modules. But I'm inclined not to worry about that, thanks to some combination of:

  • For that to work, every tool that the organization uses would need to support "null-marked by default."
  • Some people don't make use of modules.
  • It doesn't seem that hard to put in place enforcement that all new modules are @NullMarked.
  • We might even look askance at the idea that code without @NullMarked should be treated as null-marked in general.

@kevinb9n
Copy link
Collaborator Author

This is my askance look.

@kevinb9n kevinb9n added the design An issue that is resolved by making a decision, about whether and how something should work. label Nov 30, 2022
kevinb9n pushed a commit that referenced this issue Dec 1, 2022
Remove MODULE from NullUnmarked (per #348), and small javadoc tweaks
@cpovirk
Copy link
Collaborator

cpovirk commented Dec 1, 2022

#351 did this and updated docs accordingly.

@cpovirk cpovirk closed this as completed Dec 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design An issue that is resolved by making a decision, about whether and how something should work. nullness For issues specific to nullness analysis.
Projects
None yet
Development

No branches or pull requests

2 participants