Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where are the sources of sun.reflect?

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?

like image 997
fernacolo Avatar asked Nov 10 '11 18:11

fernacolo


1 Answers

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

like image 103
tolitius Avatar answered Oct 30 '22 23:10

tolitius