ss | 22 Dec 2009 19:30
Picon
Favicon

In BCEL how to know if method is calling super method or any non super method


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
(Continue reading)


Gmane