From fcc37e1bb28e8721e0a3e0dd17b1204e32cd9262 Mon Sep 17 00:00:00 2001 From: aclement Date: Thu, 19 May 2011 23:23:46 +0000 Subject: [PATCH] extra diagnostics on bytecode problems --- .../src/org/aspectj/apache/bcel/generic/MethodGen.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bcel-builder/src/org/aspectj/apache/bcel/generic/MethodGen.java b/bcel-builder/src/org/aspectj/apache/bcel/generic/MethodGen.java index 94c42938f..59cf7397e 100644 --- a/bcel-builder/src/org/aspectj/apache/bcel/generic/MethodGen.java +++ b/bcel-builder/src/org/aspectj/apache/bcel/generic/MethodGen.java @@ -84,7 +84,7 @@ import org.aspectj.apache.bcel.classfile.annotation.RuntimeParamAnnos; * While generating code it may be necessary to insert NOP operations. You can use the `removeNOPs' method to get rid off them. The * resulting method object can be obtained via the `getMethod()' method. * - * @version $Id: MethodGen.java,v 1.16 2009/10/05 17:35:36 aclement Exp $ + * @version $Id: MethodGen.java,v 1.17 2011/05/19 23:23:46 aclement Exp $ * @author M. Dahm * @author Patrick C. Beard [setMaxStack()] * @see InstructionList @@ -693,7 +693,12 @@ public class MethodGen extends FieldGenOrMethodGen { byte[] byte_code = null; if (il != null) { - byte_code = il.getByteCode(); + try { + byte_code = il.getByteCode(); + } catch (Exception e) { + throw new IllegalStateException("Unexpected problem whilst preparing bytecode for " + this.getClassName() + "." + + this.getName() + this.getSignature(), e); + } } LineNumberTable lnt = null; -- 2.39.5