classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: VM-Writers: Order of class initialization


From: Archie Cobbs
Subject: Re: VM-Writers: Order of class initialization
Date: Fri, 04 Feb 2005 16:05:07 -0600
User-agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.3) Gecko/20041129

Peter Werno wrote:
> To make my life a little easier, I have classes initialized immediately
> after they have been loaded.

This is contrary to the JVM spec, which specifies exactly when
class initialization must happen (can't remember which section).
Probably this is causing the problems you're seeing.

In short, you must initialize a class at its first "active use",
defined as referencing a static field, invoking a static method,
or instantiating an instance.

-Archie

__________________________________________________________________________
Archie Cobbs      *        CTO, Awarix        *      http://www.awarix.com


*
Confidentiality Notice: This e-mail message, including any attachments, is for 
the sole use of the intended recipient(s) and may contain confidential and 
privileged information. Any unauthorized review, use, disclosure or 
distribution is prohibited. If you are not the intended
recipient, please contact the sender by reply e-mail and destroy all copies of 
the original message.
*





reply via email to

[Prev in Thread] Current Thread [Next in Thread]