aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhugunin <jhugunin>2003-01-07 20:50:18 +0000
committerjhugunin <jhugunin>2003-01-07 20:50:18 +0000
commit67a0ea0eaef0a0f7ce15522af2372f6cc0f09cbf (patch)
tree518ed85bc6bcbd3d33926f1cea6fd01567aba568
parent7660b9dfa546c2677c5d3cd1895ee3c5c446933d (diff)
downloadaspectj-67a0ea0eaef0a0f7ce15522af2372f6cc0f09cbf.tar.gz
aspectj-67a0ea0eaef0a0f7ce15522af2372f6cc0f09cbf.zip
fixed bug with ajcclinit in non-persingleton aspects
-rw-r--r--weaver/src/org/aspectj/weaver/bcel/LazyClassGen.java25
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;
}