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

Idea - null / not null annotation #2707

Open
MysterAitch opened this issue Jun 1, 2020 · 1 comment
Open

Idea - null / not null annotation #2707

MysterAitch opened this issue Jun 1, 2020 · 1 comment
Labels
Improvement Not a bug, but a way that JP can be be enhanced to work better. Metamodel/code generation

Comments

@MysterAitch
Copy link
Member

As an idea, we could have our own @Nullable and @NotNull annotations on method parameters.

We could then use a generator to ensure that the first lines of the method include a null check (e.g. assertNotNull() or Objects.requireNonNull() or similar).

Maybe this could be extended out to fields?

@MysterAitch MysterAitch added Improvement Not a bug, but a way that JP can be be enhanced to work better. Metamodel/code generation labels Jun 1, 2020
@MysterAitch MysterAitch changed the title Idea - not null annotation Idea - null / not null annotation Jun 1, 2020
@matozoid
Copy link
Contributor

matozoid commented Jun 1, 2020

Here's the history, check the oldest issues: https://github.com/javaparser/javaparser/issues?q=is%3Aissue+nullable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement Not a bug, but a way that JP can be be enhanced to work better. Metamodel/code generation
Projects
None yet
Development

No branches or pull requests

2 participants