> On Jul 12, 2016, at 2:00 PM, Paul Benedict <pbened...@apache.org> wrote:
> 
> Mandy, perhaps there is a JVM technicality here I'm unfamiliar with. My 
> understanding of loading a class has always been that it's coupled with 
> running its static initializers.

Loading, linking, and initializing are separate parts specified in JVM spec 
section 5 [1].

A good reference is that 3-arg Class::forName takes an initialize parameter 
that specifies if the class initializer should be invoked after a class is 
loaded.

> So my inference was that the class does not get loaded into memory because 
> the latter no longer occurs with --dry-run.
> 

To be clear, -—dry-run initiaizes the VM, loads the main class but the main 
method is not invoked.  The main class’s <clinit> is not invoked.

Mandy
[1] https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-5.html

Reply via email to