Skip to content

Instantly share code, notes, and snippets.

View mykeul's full-sized avatar

Mickaël Remars mykeul

  • Altares D&B
  • Région de Paris, France
View GitHub Profile
// TODO try to remove javassist dependency with this class
public class Re2jHack
{
private static final AtomicBoolean PATCHED = new AtomicBoolean();
private static void addMethodUnicodeIsLetter(final ClassPool cp) throws CannotCompileException, NotFoundException
{
final CtClass cc = cp.get("com.google.re2j.Unicode");
cc.addMethod(
CtMethod.make("static boolean isLetter(int r) { return is(com.google.re2j.UnicodeTables.L, r); }", cc));