Drew Noakes
Drew Noakes

Reputation: 310872

Disable IntelliJ's runtime verification of nullability

I have a project that uses @NotNull and @CanBeNull annotations.

The tests pass when run from Maven, but some unit tests fail when run from IntelliJ with:

Unexpected exception, expected java.lang.NullPointerException but was java.lang.IllegalArgumentException

It seems IntelliJ is adding code to verify the annotation's claims at run-time.

How can I disable this?

Upvotes: 1

Views: 277

Answers (1)

Drew Noakes
Drew Noakes

Reputation: 310872

You can disable this in the compiler settings:

enter image description here

Upvotes: 2

Related Questions