You probably want to create a ConstantPoolGen from the ConstantPool object, and use addMethodref(classname, methodname, methodsig) to add the reference to your method. Then you can call getFinalConstantPool() to convert the ConstantPoolGen back to a ConstantPool, and then use setConstantPool(ConstantPool) in JavaClass.
-- Parker On Mon, May 20, 2002 at 10:58:20PM -0600,[EMAIL PROTECTED] wrote: > I am trying to use JavaClass to see if a method exists. I want to create > the method if it doesn't exist, but I don't understand how to add the > method name to the ConstantPool. Do I need to do an arraycopy to make the > ConstantPool bigger or are there extra slots to put new constants. If that > is true, how do I tell where the next available slot is? Do I check for > nulls? > > What about the signature index? What do I point to and how are the > elements of the signature set up? > > Thanks, > -Phil -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
