};
public byte[] transformClass(byte[] in) throws Exception {
ClassReader cr = new ClassReader(in);
ClassNode node = new ClassNode();
cr.accept(node, 0);
// String preCheck = verify( in );
// if ( preCheck.trim().length() > 0 ) {
// log( "Class " + node.name + " failed precheck:\n---\n" + preCheck + "---\n" );
// throw new Exception( "Class " + node.name + " failed precheck\n---\n" + preCheck +"\n---\n" );
// }
logMessages.add("Transforming " + node.name);
transformNode(node);
int opts = 0;
if( node.version > 50 ) {
opts = ClassWriter.COMPUTE_FRAMES;
}
ClassWriter cw = new ClassWriter( opts );
node.accept(new ClassVisitor( Opcodes.ASM4, cw) {});
byte[] result = cw.toByteArray();
// String postCheck = verify( result );
// if ( postCheck.trim().length() > 0 ) {
// log( "Class " + node.name + " failed postcheck:\n " + postCheck );
// throw new Exception( "Class " + node.name + " failed postcheck:\n" + postCheck );