Jay Dee
Jay Dee

Reputation: 2646

How to set IntelliJ IDEA to treat parameters as-if they were annotated with @Nullable?

Is it possible to setup IntelliJ IDEA to treat code like this:

private void myMethod(final String item) {
    ...
}

as if it were actually

private void myMethod(final @Nullable String item) {
    ...
}

So that I would be forced to add @NotNull/@NonNull, if I really mean it?

Solution: Where to find the correct checkbox...

Upvotes: 1

Views: 219

Answers (1)

Peter Gromov
Peter Gromov

Reputation: 18931

There's a setting in Settings | Inspections | Constant Conditions & Exceptions to treat non-annotated members and parameters as nullable, although it'd apply also to methods and fields.

Upvotes: 1

Related Questions