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?
from Oracle :
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
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.