From 2a628ee26626c01816abfbd4770ef6fa6b279472 Mon Sep 17 00:00:00 2001 From: ehilsdal Date: Wed, 15 Jan 2003 18:42:50 +0000 Subject: adding another abstract/code guard using NULL rather than empty list for abstract/native bodies --- weaver/src/org/aspectj/weaver/bcel/LazyMethodGen.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'weaver') diff --git a/weaver/src/org/aspectj/weaver/bcel/LazyMethodGen.java b/weaver/src/org/aspectj/weaver/bcel/LazyMethodGen.java index b7c46d50a..5703b5197 100644 --- a/weaver/src/org/aspectj/weaver/bcel/LazyMethodGen.java +++ b/weaver/src/org/aspectj/weaver/bcel/LazyMethodGen.java @@ -103,6 +103,9 @@ public final class LazyMethodGen { if (!(m.isAbstract() || m.isNative()) && m.getCode() == null) { throw new RuntimeException("bad non-abstract method with no code: " + m + " on " + enclosingClass); } + if ((m.isAbstract() || m.isNative()) && m.getCode() != null) { + throw new RuntimeException("bad abstract method with code: " + m + " on " + enclosingClass); + } MethodGen gen = new MethodGen(m, enclosingClass.getName(), enclosingClass.getConstantPoolGen()); this.memberView = new BcelMethod(enclosingClass.getType(), m); this.accessFlags = gen.getAccessFlags(); @@ -657,6 +660,8 @@ public final class LazyMethodGen { packBody(gen); gen.setMaxLocals(); gen.setMaxStack(); + } else { + gen.setInstructionList(null); } return gen; } -- cgit v1.2.3