From: jhugunin Date: Tue, 7 Jan 2003 20:50:18 +0000 (+0000) Subject: fixed bug with ajcclinit in non-persingleton aspects X-Git-Tag: V_1_1_b5~144 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=67a0ea0eaef0a0f7ce15522af2372f6cc0f09cbf;p=aspectj.git fixed bug with ajcclinit in non-persingleton aspects --- diff --git a/weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java b/weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java index e4135cbcb..2a3440898 100644 --- a/weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java +++ b/weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java @@ -323,18 +323,19 @@ public final class LazyClassGen { for (Iterator i = methodGens.iterator(); i.hasNext();) { LazyMethodGen gen = (LazyMethodGen) i.next(); if (gen.getName().equals(NameMangler.AJC_CLINIT_NAME)) return gen; - } - throw new RuntimeException("unimplemented"); -// LazyMethodGen clinit = new LazyMethodGen( -// Modifier.STATIC, -// Type.VOID, -// "", -// new Type[0], -// CollectionUtil.NO_STRINGS, -// this); -// clinit.getBody().insert(getFactory().RETURN); -// methodGens.add(clinit); -// return clinit; + } + LazyMethodGen ajcClinit = new LazyMethodGen( + Modifier.STATIC, + Type.VOID, + NameMangler.AJC_CLINIT_NAME, + new Type[0], + CollectionUtil.NO_STRINGS, + this); + ajcClinit.getBody().insert(getFactory().RETURN); + methodGens.add(ajcClinit); + + getStaticInitializer().getBody().insert(Utility.createInvoke(getFactory(), ajcClinit)); + return ajcClinit; }