java rt.jar com.sun.istack.internal 包
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10673876/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
rt.jar com.sun.istack.internal packages
提问by mawia
jre comes with many libraries in rt.jar one of which is com.sun.istack.internal*. I needed the documentation of com.sun.istack.internal.Nullable(which I found being used by google in its CacheBuilder) and first I thought was to go to docs.oracle.com to find its documentation and there I found nothing about it. Next went to source folder sourced with jdk and I didn't find com name entity in the said folder. Next I take a look at the jre7 release and take a look at all the packages and class and found no mention of Nullable there. Though SO had one mention of it, but nothing concrete. I am still puzzled where to get its documentaion and src if needed. I even looked legacy sun api documentation at oracle but nothing mentioned about it. where does oracle document there policy about ported packages and their being standard or not-standard.They must have documented it somewhere it is just that I'm taking too much of time to get there.
jre 在 rt.jar 中有许多库,其中之一是 com.sun.istack.internal*。我需要 com.sun.istack.internal.Nullable 的文档(我发现谷歌在它的 CacheBuilder 中使用了它),首先我想是去 docs.oracle.com 找到它的文档,但在那里我一无所获. 接下来转到来自 jdk 的源文件夹,我没有在所述文件夹中找到 com 名称实体。接下来我查看 jre7 版本并查看所有包和类,发现那里没有提及 Nullable。虽然 SO 有一次提到它,但没有什么具体的。如果需要,我仍然不知道从哪里获取它的文档和 src。我什至在 oracle 上查看了遗留的 sun api 文档,但没有提到它。oracle 在哪里记录有关移植包的政策及其标准或非标准。他们必须在某处记录它只是我花了太多时间到达那里。
Please point me there.
请指点我那里。
EDIT: Actually the javax.annotation.Nullable is being used in google CacheBuilder and not com.sun.istack.internal.Nullable. Also for someone who may face this issue: javax.annotation.Nullable is not part of Java SE as of now, and it is being ported in jsr305 jar. So if you are planning to use CacheBuilder or just going through its code, do add jsr305 jar in your class path, else eclipse get confuse and will point you to com.sun.istack.intenal.Nullable when ever you hover your cursor over Nullable.
编辑:实际上 javax.annotation.Nullable 正在 google CacheBuilder 中使用,而不是 com.sun.istack.internal.Nullable。同样对于可能面临这个问题的人:javax.annotation.Nullable 目前不是 Java SE 的一部分,它正在被移植到 jsr305 jar 中。因此,如果您打算使用 CacheBuilder 或只是通过它的代码,请在您的类路径中添加 jsr305 jar,否则 eclipse 会混淆并在您将光标悬停在 Nullable 上时将您指向 com.sun.istack.intenal.Nullable .
回答by JB Nizet
Guava doesn't use com.sun.istack.internal.Nullable
. Everything that is not documented in the official Java SE javadoc is internal code, and should not be used in applications.
番石榴不使用com.sun.istack.internal.Nullable
. 官方 Java SE javadoc 中未记录的所有内容都是内部代码,不应在应用程序中使用。
You're probably looking for javax.annotation.Nullable
, which is part of JSR305.
您可能正在寻找javax.annotation.Nullable
,它是JSR305 的一部分。
回答by Stephen C
Here is a link to the source code:
这是源代码的链接:
(This link may break in the future, but you should be able to find an equivalent using a Google search.)
(此链接将来可能会断开,但您应该能够使用 Google 搜索找到等效链接。)
The reason that you can't find the source code or javadocs in the standard JDK / JRE distributions is that this is a INTERNAL class. There is a long-standing Oracle / Sun policy of discouraging developers from writing code that is dependent on Java internal classes.
在标准 JDK / JRE 发行版中找不到源代码或 javadoc 的原因是这是一个 INTERNAL 类。Oracle / Sun 有一个长期存在的政策,即不鼓励开发人员编写依赖于 Java 内部类的代码。
FWIW - this is just an annotation, and the meaning is pretty much what the class name implies.
FWIW - 这只是一个注释,其含义几乎与类名称所暗示的一样。
UPDATE- Apparently, the real cause of this confusion is that you didn't include the JSR305 jar in your buildpath. It is a dependency for CacheBuilder
. Eclipse classname completion is then doing its best ... but failing.
更新- 显然,这种混淆的真正原因是您没有在构建路径中包含 JSR305 jar。它是CacheBuilder
. Eclipse 类名完成然后尽其所能......但失败了。