]> source.dussan.org Git - aspectj.git/commitdiff
fixed handling of reflective signatures for static intialization join points
authorjhugunin <jhugunin>
Wed, 8 Jan 2003 01:14:07 +0000 (01:14 +0000)
committerjhugunin <jhugunin>
Wed, 8 Jan 2003 01:14:07 +0000 (01:14 +0000)
weaver/src/org/aspectj/weaver/Member.java
weaver/src/org/aspectj/weaver/bcel/BcelWorld.java

index 284454fdfb371238dc88e82de3607643381631a9..d5b0481292b20a044526cb258b236ae25bdf3d62 100644 (file)
@@ -516,6 +516,8 @@ public class Member implements Comparable {
 
        // ---- reflective thisJoinPoint stuff
     public String getSignatureMakerName() {
+       if (getName().equals("<clinit>")) return "makeInitializerSig";
+       
        Kind kind = getKind();
        if (kind == METHOD) {
                return "makeMethodSig";
@@ -539,6 +541,8 @@ public class Member implements Comparable {
 
        public String getSignatureType() {
        Kind kind = getKind();
+       if (getName().equals("<clinit>")) return "org.aspectj.lang.reflect.InitializerSignature";
+       
        if (kind == METHOD) {
                return "org.aspectj.lang.reflect.MethodSignature";
        } else if (kind == CONSTRUCTOR) {
@@ -557,6 +561,8 @@ public class Member implements Comparable {
     }
 
        public String getSignatureString(World world) {
+               if (getName().equals("<clinit>")) return getStaticInitializationSignatureString(world);
+               
        Kind kind = getKind();
        if (kind == METHOD) {
                return getMethodSignatureString(world);
index 1e4b603ec801529dbaf888e9ed4c27fdc01c8411..4013111511fe5f5cb36b646ffb402a83317e85e0 100644 (file)
@@ -237,8 +237,18 @@ public class BcelWorld extends World {
                int mods = mg.getAccessFlags();
                if (mg.getEnclosingClass().isInterface()) {
                    mods |= Modifier.INTERFACE;
-               }       
-               return new ResolvedMember(mg.getName().equals("<init>") ? Member.CONSTRUCTOR : Member.METHOD,
+               }
+               
+               org.aspectj.weaver.Member.Kind kind;
+               if (mg.getName().equals("<init>")) {
+                       kind = Member.CONSTRUCTOR;
+               } else if (mg.getName().equals("<clinit>")) {
+                       kind = Member.STATIC_INITIALIZATION;
+               } else {
+                       kind = Member.METHOD;
+               }
+               
+               return new ResolvedMember(kind,
                        TypeX.forName(mg.getClassName()), 
                        mods,
                        fromBcel(mg.getReturnType()),