I think I am nearing the solution. Yes I can check if
teh INVOKESPECIAL is of some super class. Just have
one more problem now. What if I instantiate the super
class in the constructor by a new statement? How can I
distinguish super() from new(). Both the INVOKESPECIAL
are exactly the same. The only hope now is the DUP
instruction. My assumption is DUP is inserted whenever
new() is used in the code? Am I right? If the answer
is yes, then I can distinguish super() from new().

- Nikhil

--- Erik Corry <[EMAIL PROTECTED]> wrote:
> On Wed, Feb 18, 2004 at 02:14:20AM -0800, Nikhil C.
> Khedkar wrote:
> > 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.
> 
> If you do "getClassName" in the INVOKESPECIAL
> instruction does
> that tell you the class that we are calling?  Or
> should we
> be using a different function.   The documentation
> is a little
> sparse...
> 
>
http://jakarta.apache.org/bcel/apidocs/org/apache/bcel/generic/FieldOrMethod.html#getClassType(org.apache.bcel.generic.ConstantPoolGen)
> 
> (linked from
>
http://jakarta.apache.org/bcel/apidocs/org/apache/bcel/generic/INVOKESPECIAL.html
> )
> 
> -- 
> 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]

Reply via email to