Oracle documentation describes /jdk1.7.0/jre/lib/rt.jar as bootstrap classes for java runtime, I am curious if these are ever loaded when running a JDK rather than a JRE and if so how these get replaced with hotspot classes at runtime?
For example rt.jar does not appear to contain a class corresponding to hotspot/jdk/src/share/classes/java/util/Collections.java, so if I add a JDK6 version into eclipse as a JDK and step through the following in a debugger:
Collections.emptySet().iterator();
I get the code corresponding to the rt.jar/java.util.Collections which creates a new iterator instance, wheras the hotspot version from src.zip which pools an empty iterator does not appear to be present.
My understanding has always been that the hotspot code will be what is linked in prior to/during runtime, so I suspect I have just missed the location, but if this is not true how does the hotspot code get linked in?