是@ParametersAreNonnullByDefault适用于方法的返回值吗? [英] Is @ParametersAreNonnullByDefault applies to method return values too?

查看:1419
本文介绍了是@ParametersAreNonnullByDefault适用于方法的返回值吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

的<一个href=\"http://jsr-305.google$c$c.com/svn/trunk/javadoc/javax/annotation/ParametersAreNonnullByDefault.html\"相对=nofollow>为 @ParametersAreNonnullByDefault 文档说,认为:

The documentation for @ParametersAreNonnullByDefault says, that:

此注解可以应用到一个包,类或方法来指示方法参数在元素都是非空默认情况下,除非...

This annotation can be applied to a package, class or method to indicate that the method parameters in that element are nonnull by default unless ...

我不认为一个方法的返回类型/值是它的参数。这是其标志性的一部分,所以这是一种模糊的我。

I don't consider a method's return type/value to be it's parameter. It is only part of its signature, so this is kind of ambiguous for me.

有关方法的 Java教程似乎觉得像我这样

The Java tutorial for methods seems to think like me.

由于约阿希姆绍尔在他的<一个注释部分指出了我href=\"http://stackoverflow.com/questions/7658353/is-parametersarenonnullbydefault-applies-to-method-return-values-too/7658375#7658375\">answer,名称 @ParametersAreNonnullByDefault 参数)应为我已经清楚地表明,这个注释并不适用于方法'的返回类型/值。我是个瞎子! :)谢谢约阿希姆!

As Joachim Sauer pointed out for me in the comments section of his answer, the name @ParametersAreNonnullByDefault (parameters) should've clearly indicated for me that this annotation doesn't apply to methods' return types/values. I was blind! :) Thanks Joachim!

在此我可以照亮只说一个 @EverythingIsNonnullByDefault 应somwhere存在。 :)

In light of this I can only says that an @EverythingIsNonnullByDefault should exist somwhere. :)

推荐答案

我不明白了一个道理,为什么 @ParametersAreNonnullByDefault 应适用于返回值。

I don't see a reason why @ParametersAreNonnullByDefault should apply to return values.

这篇关于是@ParametersAreNonnullByDefault适用于方法的返回值吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆