JBoss Community

Proposed enhancement to the Bytecode API

created by Stuart Douglas in Javassist Development - View the full discussion

I had an idea for an enhancement to the Bytecode class to make generating conditionals/goto easier. I think that it would be useful to add Bytecode.addIf* methods that return a JumpMarker that can be used to indicate where the conditional branch ends. For example:

 

JumpMarker marker = b.addIfne();
b.addIconst(0);
b.addIreturn();
marker.endJump();
b.addIconst(1);
b.addIreturn();

 

If I do up a patch for this is it likely to be accepted?

Reply to this message by going to Community

Start a new discussion in Javassist Development at Community