]> source.dussan.org Git - aspectj.git/commitdiff
231396: refactoring AspectJ: moved getExtractableName() into here from Member
authoraclement <aclement>
Fri, 6 Jun 2008 04:23:30 +0000 (04:23 +0000)
committeraclement <aclement>
Fri, 6 Jun 2008 04:23:30 +0000 (04:23 +0000)
weaver/src/org/aspectj/weaver/NameMangler.java

index 4f9d336dcb06a770f83f3072866c38514c9318a7..a694208504027e16772d406337bd830fdec3ff31 100644 (file)
@@ -363,9 +363,18 @@ public class NameMangler {
 
        public static String aroundCallbackMethodName(Member shadowSig, LazyClassGen enclosingType) {
                StringBuffer ret = new StringBuffer();
-               ret.append(shadowSig.getExtractableName()).append("_aroundBody").append(enclosingType.getNewGeneratedNameTag());
+               ret.append(getExtractableName(shadowSig)).append("_aroundBody").append(enclosingType.getNewGeneratedNameTag());
                return ret.toString();
        }
+       
+        public static String getExtractableName(Member shadowSignature) {
+               String name = shadowSignature.getName();
+               MemberKind kind = shadowSignature.getKind();
+       if (kind==Member.CONSTRUCTOR) return "init$";
+       else if (kind==Member.STATIC_INITIALIZATION) return "clinit$";
+       else return name;
+    }
+
 
        public static String proceedMethodName(String adviceMethodName) {
                return adviceMethodName + "proceed";