Class.newInstance always locates default constructor

Alexandre Oliva oliva at
Tue Oct 27 10:32:06 PST 1998

Given the attached code snippet, Kaffe will fail to throw a
NoSuchMethodException because execute_java_constructor calls
lookupClassMethod, that calls findMethod, that ends up finding the
constructor <init>()V in superclasses, for example, in

I can see two ways to fix this:

1) modify findMethod so that it strcmp()s name with
makeUtf8Const(constructor_name->data,-1), and behaves differently for

2) create lookupConstructor and findConstructor, and modify
execute_java_constructor_v to use lookupConstructor instead of

I seem to prefer the second alternative.  What do others think?

Alexandre Oliva
mailto:oliva at mailto:oliva at mailto:aoliva at
Universidade Estadual de Campinas, SP, Brasil
-------------- next part --------------
A non-text attachment was scrubbed...
Type: application/octet-stream
Size: 190 bytes
Desc: not available
Url : 

More information about the kaffe mailing list