Smart and automatic ASM patches for Java