@NotNull/@Nullable Annotations

Do you have to do anything special to enable intentions for these annotations?

I've imported the library and I've marked method parameters as @NotNull, but I'm not getting any warning when I then call these methods with null parameters.

I've checked the compiler options for using the @Nullable assertion and I've got the Error inspections set to detect problems with the annotations (it detects annotation declaration problems fine).

3 comments
Comment actions Permalink

Hello Simon,

Do you have to do anything special to enable intentions for these
annotations?

I've imported the library and I've marked method parameters as
@NotNull, but I'm not getting any warning when I then call these
methods with null parameters.

I've checked the compiler options for using the @Nullable assertion
and I've got the Error inspections set to detect problems with the
annotations (it detects annotation declaration problems fine).


The "Constant conditions and exceptions" inspection must be enabled for the
highlighting to work.

--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

This was already enabled in my default project profile, but still no joy unfortunately.

I created a little test project and it works in there, so there's obviously something wrong with my current project. I'll clear the caches down and see if that helps at all.

0
Comment actions Permalink

Well it seems to work for some method calls, but doesn't warn me about others. I'll try and find out what's causing them to not appear as warnings and raise a JIRA, although it's not critical for us.

0

Please sign in to leave a comment.