Juozas Baliuka wrote:
We use this in cglib without problems on sun jdk implementations,
reflection is used to invoke protected method,
but it is possible to extend ClassLoader and call this method "normal" way
if you do not need  to cast generated classes
or accsess superclass loaded by different classloaders.

Here is the problem I am running into. I am trying to use a protected field from a superclass, but the generated bytecode is not what I am expecting it to be.

The javap output is this:

aload_0
getfield #18 <Field null>


The code I am using to generate the code is:


m_instructions.append(InstructionFactory.createLoad(Type.OBJECT, 0));
m_instructions.append(m_factory.createFieldAccess(m_generator.getClassName(),
            "m_contentHandler", CONTENT_HANDLER, Constants.GETFIELD));


What's up with that?


Is there something I am missing?


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to