-
1. Re: try catch in NewExpr
chiba Jun 5, 2004 12:11 PM (in response to vladsk)The reason of that exception is that $_ is not initialized if an OutOfMemoryError exception is thrown.
So the problem should be fixed if you assign some value to $_ in the catch block.
I have also modified Javassist so that $_ is automatically initialized. If you use Javassist directly downloaded from the CVS head (or use an upcoming beta 3 or later), your code above should run without any problem. -
2. Re: try catch in NewExpr
vladsk Jun 6, 2004 1:16 PM (in response to vladsk)During last week I made instrumentaton of a large project.
And some time I have seen java.lang.VerifyError at run time.
Is it posible to run code verification before saving class file? -
3. Re: try catch in NewExpr
chiba Jun 7, 2004 10:35 PM (in response to vladsk)Currently, no.
I'm putting error checking code to avoid
wrong instrumentation, but it is not a simple
thing to produce useful error messages.
Also, I have to consider the range of possible
instrumentation. For example, changing
a public method to be private would cause
VerifyError if some methods in another
class access that method. Detecting this
error before saving a class file is a complicated
task under the current architecture of Javassist.
It would be great if you give me back your
experiences of VerifyError. I can improve
erorr checking code.