JSR 305的状态是什么? [英] What is the status of JSR 305?

查看:386
本文介绍了JSR 305的状态是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我见过这个问题 JSR305与JSR308(Java类型Anotations) - 哪个将成为标准?我理解 JSR 308 JSR 305

I have seen the question JSR305 vs. JSR308 (Java Type Anotations) - Which is going to be the standard? and I understand the difference between JSR 308 and JSR 305.

我也明白,在这个时候,308是针对Java 7而305则不是,我很好奇305的整体状态。

I also understand that, at this time, 308 is slated for Java 7, and 305 is not, and I am curious about the overall status of 305.

具体来说,我使用的是 Google Collections 并在我的一些项目中 JSR-305 (与< a href =http://code.google.com/p/google-guice/wiki/UseNullable =noreferrer> Guice最佳做法倡导者之一)并且想知道是否还有更多未来的方向 - 我应该使用的友好方法。我打算在JSR-305小组上询问这个问题,但该小组没有太多活动,我只是想知道这里是否有人有更多的信息。

Specifically, I am using Google Collections and JSR-305 in some of my projects (in a similar manner to what one of the Guice best practices advocates) and was wondering if there is a more "future direction"-friendly approach I should be using instead. I am planning to also ask about this on the JSR-305 group, but that group does not have much activity and I was just wondering if anyone here had any more info.

推荐答案

答案 JSR- 305 提出了新的注释,例如 @NonNull ,而 JSR-308 建议在新的地方允许注释,例如通用声明。

As described in this answer, JSR-305 proposes new annotations such as @NonNull, while JSR-308 proposes allowing annotations in new places such as on generic declarations.

引用 JSR 308 page:


...本文档未提出任何注释,仅指定它们在Java代码中的显示位置。

…this document does not propose any annotations, merely specifying where they can appear in Java code.

JSR 308(新地方的注释)包含在 JEP 104 下的noreferrer> java 8 。

JSR 308 (annotations in new places) is included in java 8 under JEP 104.

截至2017年, JSR 305 (新的注释)继续具有休眠的官方地位。关于它在Google群组中的状态的问题一直未得到答复2010.

As of 2017, JSR 305 (new annotations) continues to carry official status of "Dormant". A question about it's status in the google group has been unanswered since 2010.

有一个JSR-305注释的参考实现这里,包括番石榴在内的许多项目都使用过。使用maven,你可以通过将它添加到你的pom来使用JSR-305参考实现,

There is a reference implementation of the JSR-305 annotations here which is used by many projects, including guava. With maven you can use the JSR-305 reference implementation by adding this to your pom,

<dependency>
    <groupId>com.google.code.findbugs</groupId>
    <artifactId>jsr305</artifactId>
    <version>3.0.0</version>
</dependency>

这篇关于JSR 305的状态是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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