Well no peoblem with detecting the constructor. The
approach you have mentioned is not full proof. In my
constructor I have the following code, few lines down
the line
if (!(type == MAINUI || type == PROJECTWIZARD))
{
throw new RuntimeException("Invalid type");
}
Even this chap has INVOKESPECIAL and I end up skipping
some of the lines and in fact this line also, if I use
your approach, which I had already tried.
<[EMAIL PROTECTED]>
--- Erik Corry <[EMAIL PROTECTED]> wrote:
> On Wed, Feb 18, 2004 at 01:58:04AM -0800, Nikhil C.
> Khedkar wrote:
> > Now the above mentioned approach doesn't work and
> I
> > end up putting my method call before super() and
> get
> > VerifyError.
>
> Since the constructor has a special name (<init>)
> you
> can know that you are dealing with a constructor.
> If so, scan the whole method for a call to the
> superclass constructor (INVOKESPECIAL to a method
> called
> <init>). If you don't find it (it seems legal
> according to
>
http://java.sun.com/docs/books/vmspec/2nd-edition/html/Concepts.doc.html#16411
> ) then you can put your instrumenting call at the
> start,
> otherwise you put the call after the INVOKESPECIAL
> call.
>
> I haven't tried it, so I'd be interested in whether
> it works.
> I'm going to be needing it realy soon for my own
> project.
>
> --
> Erik Corry I'd be a Libertarian, if they
> weren't all a
> [EMAIL PROTECTED] bunch of tax-dodging professional
> whiners. - B. Breathed.
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>
__________________________________
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]