Can IntelliJ inspections assume that every parameter or instance variable is `@Nonnull` without actually adding it?

已回答

Can IntelliJ inspections assume that every parameter or instance variable is @Nonnull without actually adding it?

I know in IntelliJ (Java | Probable bugs | Nullability and data flow problems) there is an option that says Treat non-annotated members and parameters as @Nullable.

What I am looking for is the inverse. I want every member to be @Nonnull and I will add then @Nullable to those ones that are nullable.

I have IntellJ setup with these 2 inspections:
 

And configured to use the `jakarta` annotations.

I would like the following to happen:

Is this possible in Intellij wihtout using checkerframework, error prone of a 3rd party libary?

0

Hello,

It's not supported so far. Would you mind creating a feature request at https://youtrack.jetbrains.com/newIssue?project=IDEA, and I'll assign it to the right developer?

Please share the link to here.

0

请先登录再写评论。