In BCEL how to know if method is calling super method or any non super meth
807580Dec 23 2009 — edited Jan 8 2010Class 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.