jakarta-bcel-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ss <sarmis...@hotmail.com>
Subject In BCEL how to know if method is calling super method or any non super method
Date Tue, 22 Dec 2009 18:30:27 GMT

Hi

Class constructor can call super or this in it. Both are INVOKESPECIAL. Is
there any way i can know if instrcution is calling super class method or any
other method. 

Class B extends A
class B(int i)
{
super(i);
}

or
class B(int i)
{
this(i,null);
}
class B(int i,String desc)
{
  super(i);
}

I tried getting class name, but it is same for both super and this.

int h = cp.addMethodref( oldClass.getClassName(), m.getName(), signature);
IVOKESPECIAL newinst1 = new INVOKESPECIAL(h);
System.out.println("************************ "+newinst1.getClassName(cp));
		
Both cases above reutns class B for first constructor with integer
parameter. How do i know that method  is calling super or non-super in BCEL?

Thanks in advance.
-- 
View this message in context: http://old.nabble.com/In-BCEL-how-to-know-if-method-is-calling-super-method-or-any-non-super-method-tp26891746p26891746.html
Sent from the BCEL - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: bcel-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bcel-user-help@jakarta.apache.org


Mime
View raw message