sun.reflect 的来源在哪里?
在 Eclipse 中调试使用反射的 Java 代码时,有时我需要单步执行调用的方法或构造函数。但是反射类(例如 java.lang.reflect.Method 和 java.lang.Class )会对 sun.reflect.DelegatingConstructorAccessorImpl 进行内部调用,<代码>sun.reflect.NativeConstructorAccessorImpl、sun.reflect.ReflectionFactory
等。这些类不在 JDK 附带的 src.zip 中。
这需要我将 sun.reflect.*
添加到调试器步骤过滤器。否则,我将不得不在字节码视图中多次按 F5(步入),而没有任何线索知道它何时会进入我的代码。
但作为一个好奇的人,我想知道发生了什么。如果存在这样的链接或存储库,请有人告诉我可以从哪里下载这些源代码?
While debugging Java code that uses reflection in Eclipse, some times I need to step into my invoked method or constructor. But reflection classes such as java.lang.reflect.Method
and java.lang.Class
do internal calls to sun.reflect.DelegatingConstructorAccessorImpl
, sun.reflect.NativeConstructorAccessorImpl
, sun.reflect.ReflectionFactory
and others. These classes are not in the src.zip that is shipped with JDK.
This requires me to add sun.reflect.*
to the debugger Step Filters. Otherwise I would have to press F5 (Step Into) multiple times in bytecode view, without any clue of when it will get into my code.
But being a curious person, I wish to know what's going on. Someone please can tell from where can I download those sources, if such a link or repository exists?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
来自 Oracle:
Java SE 6 JDK 源代码
JDK 6 源有兴趣探索 JDK 细节的人可以使用代码。这包括出于个人兴趣或研究和目的而想要检查源代码的学校、大学、公司和个人。发展。许可不会对那些希望从事独立开源项目的人施加限制。
http://download.java.net/jdk6/source/
和 OpenJDK 源 jar 是此处
from Oracle:
Java SE 6 JDK Source Code
JDK 6 source code is available for those interested in exploring the details of the JDK. This includes schools, universities, companies, and individuals who want to examine the source code for personal interest or research & development. The licensing does not impose restrictions upon those who wish to work on independent open-source projects.
http://download.java.net/jdk6/source/
and OpenJDK source jars are here