FYI.

-----Original Message-----
From: Camila Rocha
To: Steven Smith
Sent: 2/11/04 11:27 AM
Subject: Re: The changes don't work

Thank you, thank you , thank you! Now it works. :)

> The basic problem was in the Monitor class.  For the most part, Fila
is
> modified correctly, however it is never written back out to disk so
that
> AccessoFila can find it.  The following two instructions should be
added
> after "methods[1] = mg.getMethod()" in monitorEstado():
>
>   clazz.setConstantPool(cp.getFinalConstantPool());
>   clazz.dump(clazz.getClassName() + ".class");
>

I haven't realize about "setting" other things. Now I understand! After
a
modification, I always have to write that two lines, haven't I?

> Additionally, the code that you now have in monitorEstado() has a
small
bug
> in it where it is modifying Fila.  The code snippet you sent me below
works
> fine, but the one today needs one change in order to work.  The
following
> insert:
>
>   il.insert(ih_7, factory.createInvoke("Monitor",
"incluirTraceEstado",
> Type.VOID, new Type[] { Type.STRING }, (short)184));
>
> should be an append:
>
> il.append(ih_7, factory.createInvoke("Monitor", "incluirTraceEstado",
> Type.VOID, new Type[] { Type.STRING }, (short)184));
>

I forgot about this... I was trying to change everything to append and
forgot the last instruction.

> Also, you make want to make provision for a larger array within
Monitor
(and
> Fila).  When you run with a modified Fila, you get an
ArrayIndexOutOfBounds
> exception in incluirTraceEstadon because the array size it tries to
use is
> fixed at 10, and the loop in AccessoFila loops for 12 times.

That one I knew. I was testing the exception. :)

Thank you very much. Now I enjoy BCEL! :)

Camila Rocha
------------------------------------------------------------------------
Master Student in Computer Science
Institute of Computing - UNICAMP - Brazil
www.ic.unicamp.br/~ra022247

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

Reply via email to