ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nico Seessle" <n...@apache.org>
Subject Re: compiler feature
Date Fri, 14 Dec 2001 20:50:04 GMT
----- Original Message -----
From: "Sundberg Jukka" <Jukka.Sundberg@aldata.fi>
To: <ant-user@jakarta.apache.org>
Sent: Thursday, December 13, 2001 1:26 PM
Subject: compiler feature


> Running a following target causes ant to create two instances of the java
> class:
>
This is probably caused by the AntClassLoader:

--- cut ---
    /**
     * Force initialization of a class in a JDK 1.1 compatible, albeit hacky
     * way
     */
    public static void initializeClass(Class theClass) {
        // ***HACK*** We try to create an instance to force the VM to run
the
        // class' static initializer. We don't care if the instance can't
        // be created - we are just interested in the side effect.
        try {
            theClass.newInstance();
        }
        catch (Throwable t) {
            //ignore - our work is done
        }
    }
--- cut ---

Sorry, no idea how to fix this.

Nico



--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message