Quantcast
Channel: JetBrains Developer Community : Thread List - IntelliJ IDEA Users
Viewing all articles
Browse latest Browse all 5661

'@NotNull' not applicable to type use

$
0
0

I would like to use the @NotNull and @Nullable annotations on types, as was introduced with java 8. I understood that IDEA 13.1 supports java 8, and therefore also type annotations.

I've set up my project to use language level 8.0, and I've added the annotations.jar (from <IDEA>/lib) to my module's dependencies.

 

However, when I create a class like this:

 

public class Test {

    private List<@NotNull String> list;

}

 

I'm getting an error on @NotNull, saying "'@NotNull' not applicable to type use".

 

I'm new to IDEA, and I wanted to see if it handles @NotNull type annotations better than Eclipse does, but so far I haven't been able to get it working. Obviously I missed something, but I wouldn't now what. Any help is appreciated.

 

Thanks,

Tom


Viewing all articles
Browse latest Browse all 5661


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>