sun.reflect 的来源在哪里?

发布于 2024-12-14 23:13:52 字数 446 浏览 3 评论 0原文

在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

笛声青案梦长安 2024-12-21 23:13:53

来自 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文