Rt.jar com.sun.istack.internal packages

jre comes with many libraries in rt.jar, one of which is com.sun.istack.internal *. I needed the documentation com.sun.istack.internal.Nullable ( which I thought was used by google in CacheBuilder ), and at first I thought I had to go to docs.oracle.com to find its documentation and there I don’t found about it. Then I went to the original folder obtained using jdk, and I did not find the com name object in the specified folder. Then I looked at the jre7 release and looked at all the packages and the class and did not find a mention of Nullable. Although SO had one mention of this , but nothing concrete. I am still puzzled by where, if necessary, to get its documentation and src. I even looked at the oracle sun api documentation, but this was not mentioned. where the oracle documents there the policy of ported packages, and they are standard or non-standard. They had to document it somewhere, it's just that I take too much time to get there.

Please point me there.

EDIT: Actually javax.annotation.Nullable is used in google CacheBuilder, not com.sun.istack.internal.Nullable. Also for those who may run into this problem: javax.annotation.Nullable is not part of Java SE at the moment and is ported to jsr305 jar. Therefore, if you plan to use CacheBuilder or just look at its code, add jsr305 jar to your class path, otherwise eclipse will get confused and point you to com.sun.istack.intenal.Nullable when you hover over Nullable.

+7
source share
2 answers

Guava does not use com.sun.istack.internal.Nullable . Everything that is not described in the official Java Java javadoc is internal code and should not be used in applications.

You are javax.annotation.Nullable looking for javax.annotation.Nullable , which is part of JSR305 .

+12
source

Here is the link to the source code:

(This link may be broken in the future, but you can find the equivalent using a Google search.)

The reason you cannot find the source code or javadocs in standard JDK / JRE distributions is because it is the INTERNAL class. There is a long-standing Oracle / Sun strategy that discourages developers from writing code that depends on internal Java classes.

FWIW is just an annotation, and meaning pretty much means the name of the class.


UPDATE . Apparently, the real reason for this confusion is that you did not include JSR305 in your build path. This is a dependency for CacheBuilder . The completion of the Eclipse class does its best ... but does not work.

+5
source

All Articles