Buggy code:
String privateMethodName = ( ( md . constructor ? "___cn1init__" : methodNode . name ) + "___cn1sync" ) + methodNum ; MethodNode syncMethod = new MethodNode ( methodNode . access , methodNode . name , methodNode . desc , methodNode . signature , ( ( String [ ] ) ( methodNode . exceptions . toArray ( new String [ methodNode . exceptions . size ( ) ] ) ) ) ) ; methodNode . name = privateMethodName ; methodNode . access = ( ( ( ( methodNode . access ) | ( Opcodes . ACC_PRIVATE ) ) & ( ~ ( Opcodes . ACC_PUBLIC ) ) ) & ( ~ ( Opcodes . ACC_PROTECTED ) ) ) & ( ~ ( Opcodes . ACC_SYNCHRONIZED ) ) ; int argIndex = 0 ; if ( ! ( md . staticMethod ) ) { syncMethod . instructions . add ( new org . objectweb . asm . tree . VarInsnNode ( Opcodes . ALOAD , ( argIndex ++ ) ) ) ; } for ( Parser . ByteCodeMethodArg arg : md . arguments ) { char typeChar = arg . type ; if ( ( arg . dim ) > 0 ) { typeChar = 'L' ; } switch ( typeChar ) { case 'L' : syncMethod . instructions . add ( new org . objectweb . asm . tree . VarInsnNode ( Opcodes . ALOAD , ( argIndex ++ ) ) ) ; break ; case 'S' : case 'I' : case 'B' : case 'Z' : case 'C' : syncMethod . instructions . add ( new org . objectweb . asm . tree . VarInsnNode ( Opcodes . ILOAD , ( argIndex ++ ) ) ) ; break ; case 'J' : syncMethod . instructions . add ( new org . objectweb . asm . tree . VarInsnNode ( Opcodes . LLOAD , ( argIndex ++ ) ) ) ; break ; case 'F' : syncMethod . instructions . add ( new org . objectweb . asm . tree . VarInsnNode ( Opcodes . FLOAD , ( argIndex ++ ) ) ) ; break ; case 'D' : syncMethod . instructions . add ( new org . objectweb . asm . tree . VarInsnNode ( Opcodes . DLOAD , ( argIndex ++ ) ) ) ; break ; default : throw new IllegalArgumentException ( ( "Unsupported<seq2seq4repair_space>argument<seq2seq4repair_space>type<seq2seq4repair_space>" + ( arg . type ) ) ) ; } } if ( md . staticMethod ) { syncMethod . instructions . add ( new org . objectweb . asm . tree . MethodInsnNode ( Opcodes . INVOKESTATIC , classNode . name , privateMethodName , methodNode . desc ) ) ; } else { syncMethod . instructions . add ( new org . objectweb . asm . tree . MethodInsnNode ( Opcodes . INVOKESPECIAL , classNode . name , privateMethodName , methodNode . desc ) ) ; } if ( ( md . returnType ) != null ) { char typeChar = md . returnType . type ; if ( ( md . returnType . dim ) > 0 ) { typeChar = 'L' ; } switch ( typeChar ) { case 'L' : syncMethod . instructions . add ( new org . objectweb . asm . tree . InsnNode ( Opcodes . ARETURN ) ) ; break ; case 'S' : case 'I' : case 'B' : case 'Z' : case 'C' : syncMethod . instructions . add ( new org . objectweb . asm . tree . InsnNode ( Opcodes . IRETURN ) ) ; break ; case 'J' : syncMethod . instructions . add ( new org . objectweb . asm . tree . InsnNode ( Opcodes . LRETURN ) ) ; break ; case 'F' : syncMethod . instructions . add ( new org . objectweb . asm . tree . InsnNode ( Opcodes . FRETURN ) ) ; break ; case 'D' : syncMethod . instructions . add ( new org . objectweb . asm . tree . InsnNode ( Opcodes . DRETURN ) ) ; break ; case 'V' : syncMethod . instructions . add ( new org . objectweb . asm . tree . InsnNode ( Opcodes . DRETURN ) ) ; break ; default : throw new IllegalArgumentException ( ( "Unsupported<seq2seq4repair_space>argument<seq2seq4repair_space>type<seq2seq4repair_space>" + ( md . returnType . type ) ) ) ; } } else { syncMethod . instructions . add ( new org . objectweb . asm . tree . InsnNode ( Opcodes . DRETURN ) ) ; } methodsToAdd . add ( syncMethod ) ; } } if ( ! ( methodsToAdd . isEmpty ( ) ) ) { Parser . changed = true ; System . out . println ( ( ( ( "Transforming<seq2seq4repair_space>" + ( methodsToAdd . size ( ) ) ) + "<seq2seq4repair_space>synchronized<seq2seq4repair_space>methods<seq2seq4repair_space>in<seq2seq4repair_space>" ) + ( classNode . name ) ) ) ; classNode . methods . addAll ( methodsToAdd ) ; <START_BUG> ClassWriter w = new ClassWriter ( 0 ) ; <END_BUG> classNode . accept ( w ) ; return w . toByteArray ( ) ; } else { ClassWriter w = new ClassWriter ( 0 ) ; classNode . accept ( w ) ; return w . toByteArray ( ) ; } } public static void parse ( File sourceFile ) throws Exception { } private static class MethodDescriptor { List < Parser . ByteCodeMethodArg > arguments = new ArrayList < Parser . ByteCodeMethodArg > ( ) ; Parser . ByteCodeMethodArg returnType ; boolean constructor ; boolean staticMethod ; private MethodDescriptor ( String methodName , String desc ) { } } private static class ByteCodeMethodArg { boolean isPrimitive ; int dim ; char type ; private ByteCodeMethodArg ( char type , int dim ) { } private ByteCodeMethodArg ( String type , int dim ) { } } public static void copy ( InputStream i , OutputStream o , int bufferSize ) throws IOException { } public static void cleanup ( Object o ) { } }

Fix:
ClassWriter w = new ClassWriter ( ( ( ClassWriter . COMPUTE_FRAMES ) | ( ClassWriter . COMPUTE_MAXS ) ) ) ;