Why doesn't @NotNull anotation remove the warning?

I wrote a class that implements a comparable interface. I used annotation @NotNullto suppress waring in the method parameter. But he still shows a warning. The IDE automatically imports this package com.sun.istack.internal.NotNullfor @NotNull. Why is this so? Without using this annotation, how to remove this warning?
I am using Inteij Ultimate with java 8 SE. Here is my code snippet.enter image description here

Thank.

+4
source share
2 answers

Apparently you should use

public int compareTo(@NonNull Node node) {

instead

public int compareTo(@NotNull Node node) {

The compiler can detect cases where the code path can be zero, without having to debug NullPointerException.

From here.

Checker Framework. , .

+5

, com.intellij.annotations.NotNull, javax.annotation.Nonnull javax.validation.constraints.NotNull.

IntelliJ, , / , . .

, , , , @override, , .

+1

All Articles