我想知道我是否应该在每个参数之前放置 javax.annotation.Nonnull
注释:
import javax.annotation.Nonnull;
interface Foo {
void bar(@Nonnull Integer x, @Nonnull String y);
}
或者只放在方法签名之前:
import javax.annotation.Nonnull;
@Nonnull
interface Foo {
void bar(Integer x, String y);
}
我正在使用 Intellij 代码检查。
最佳答案
每个参数之前都有更具体的定义。
关于java - 正确使用 javax.annotation.Nonnull,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45437709/