diff options
author | jhugunin <jhugunin> | 2003-05-27 18:30:16 +0000 |
---|---|---|
committer | jhugunin <jhugunin> | 2003-05-27 18:30:16 +0000 |
commit | 6f69422b5b935c1fbaf73dc8768e41c85991d1ae (patch) | |
tree | 1d6f3e74a2347d14dd96b71bc0d0acb15fe11243 /weaver | |
parent | b8f6c48800b7dfb6b2da0fb61a9f6b721b20fe64 (diff) | |
download | aspectj-6f69422b5b935c1fbaf73dc8768e41c85991d1ae.tar.gz aspectj-6f69422b5b935c1fbaf73dc8768e41c85991d1ae.zip |
slightly better error messages for Bugzilla Bug 38168
insertion of lots of advice code can make branch offset for if too large
Diffstat (limited to 'weaver')
-rw-r--r-- | weaver/src/org/aspectj/weaver/bcel/LazyMethodGen.java | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/weaver/src/org/aspectj/weaver/bcel/LazyMethodGen.java b/weaver/src/org/aspectj/weaver/bcel/LazyMethodGen.java index 9c7f3dc42..f5d87a3e7 100644 --- a/weaver/src/org/aspectj/weaver/bcel/LazyMethodGen.java +++ b/weaver/src/org/aspectj/weaver/bcel/LazyMethodGen.java @@ -33,6 +33,7 @@ import org.apache.bcel.classfile.Method; import org.apache.bcel.generic.BranchHandle; import org.apache.bcel.generic.BranchInstruction; import org.apache.bcel.generic.CPInstruction; +import org.apache.bcel.generic.ClassGenException; import org.apache.bcel.generic.CodeExceptionGen; import org.apache.bcel.generic.Instruction; import org.apache.bcel.generic.InstructionHandle; @@ -45,6 +46,7 @@ import org.apache.bcel.generic.MethodGen; import org.apache.bcel.generic.ObjectType; import org.apache.bcel.generic.Select; import org.apache.bcel.generic.Type; +import org.aspectj.bridge.IMessage; import org.aspectj.weaver.AjAttribute; import org.aspectj.weaver.BCException; import org.aspectj.weaver.ISourceContext; @@ -278,8 +280,17 @@ public final class LazyMethodGen { } public Method getMethod() { - MethodGen gen = pack(); - return gen.getMethod(); + try { + MethodGen gen = pack(); + return gen.getMethod(); + } catch (ClassGenException e) { + enclosingClass.getBcelObjectType().getResolvedTypeX().getWorld().showMessage( + IMessage.ERROR, "problem generating method " + + this.getClassName() + "." + this.getName() + ": " + e.getMessage(), + this.getMemberView() == null ? null : this.getMemberView().getSourceLocation(), null); + throw e; + } + } // ============================= |