This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Re: Exception when calling fn. using for-each in Java
- To: Jocelyn Paine <popx at pop3 dot ifs dot org dot uk>, kawa at sourceware dot cygnus dot com
- Subject: Re: Exception when calling fn. using for-each in Java
- From: Emmanuel Castro <castro at lirmm dot fr>
- Date: Tue, 19 Dec 2000 13:15:26 +0100
- References: <Pine.LNX.4.10.10012190945490.30573-100000@pop3.ifs.org.uk>
Jocelyn Paine wrote:
> ... Tentative hypothesis: when Kawa compiles a 'for-each', it generates some
> kind of initialisation code which needs to be executed when the function
> is called for the first time. This is automatic when calling from Kawa,
> but not from Java. Any suggestions?
I think you're right when you say that there is an automatic initialisation
when called from Kawa. When you load or require the class test, Kawa
execute the method test.run. I think you should try to add in your code
something like that (correct me if I'm wrong):
...
public class test1
{
static { // add that
test.run(); //
} //
public static final void main( String[] argv )
{
System.out.println( test.pairToVector(null) );
}
}
The lines "static {...}" are executed when java classload load the class test1.
Manu
PS : I am eager to know if it really works