diff options
author | jhugunin <jhugunin> | 2003-01-07 20:50:18 +0000 |
---|---|---|
committer | jhugunin <jhugunin> | 2003-01-07 20:50:18 +0000 |
commit | 67a0ea0eaef0a0f7ce15522af2372f6cc0f09cbf (patch) | |
tree | 518ed85bc6bcbd3d33926f1cea6fd01567aba568 | |
parent | 7660b9dfa546c2677c5d3cd1895ee3c5c446933d (diff) | |
download | aspectj-67a0ea0eaef0a0f7ce15522af2372f6cc0f09cbf.tar.gz aspectj-67a0ea0eaef0a0f7ce15522af2372f6cc0f09cbf.zip |
fixed bug with ajcclinit in non-persingleton aspects
-rw-r--r-- | weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java | 25 |
1 files changed, 13 insertions, 12 deletions
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, -// "<clinit>", -// 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; } |