Nullable/NotNull
hello there,
how does one enable these annotations in cases like below?
@Nullable
private String bar () {
return null;
}
do we have to have any IntelliJ specific classes in the class path?
i'm using build 3397, project jdk 1.5.03, language level set to 5.0
appreciate your help
best regards,
Parthi
请先登录再写评论。
@Nullable/@NotNull annotations are in the "annotations.jar" file, in you $IDEA_HOME/redist folder.
After you have this in your classpath, how do you enable the functionality? I can use the annotations, but there is not effect. I was expecting a error when assigning a null value to a non-null variable.
Paul Mal wrote:
It should work automatically. You should make sure "Constant conditions
& Exceptions" inspection is enabled in Errors panel of Settings.