diff options
Diffstat (limited to 'src/main/javassist/expr')
-rw-r--r-- | src/main/javassist/expr/Expr.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/javassist/expr/Expr.java b/src/main/javassist/expr/Expr.java index 882f8cb4..50d25d52 100644 --- a/src/main/javassist/expr/Expr.java +++ b/src/main/javassist/expr/Expr.java @@ -69,9 +69,13 @@ public abstract class Expr implements Opcode { MethodInfo mi = thisMethod; CtBehavior[] cb = thisClass.getDeclaredBehaviors(); for (int i = cb.length - 1; i >= 0; --i) - if (cb[i].getMethodInfo() == mi) + if (cb[i].getMethodInfo2() == mi) return cb[i]; + CtConstructor init = thisClass.getClassInitializer(); + if (init.getMethodInfo2() == mi) + return init; + throw new RuntimeException("fatal: not found"); } |