diff options
author | aclement <aclement> | 2008-06-06 04:23:30 +0000 |
---|---|---|
committer | aclement <aclement> | 2008-06-06 04:23:30 +0000 |
commit | 0ea352fe3489ccce570f9dddb6106c18639d43d1 (patch) | |
tree | 5e8629cadaac746eadbf233d60f6d064926de15e | |
parent | 5336f5545215e404e6a332f11fc8e35607fb0caa (diff) | |
download | aspectj-0ea352fe3489ccce570f9dddb6106c18639d43d1.tar.gz aspectj-0ea352fe3489ccce570f9dddb6106c18639d43d1.zip |
231396: refactoring AspectJ: moved getExtractableName() into here from Member
-rw-r--r-- | weaver/src/org/aspectj/weaver/NameMangler.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/weaver/src/org/aspectj/weaver/NameMangler.java b/weaver/src/org/aspectj/weaver/NameMangler.java index 4f9d336dc..a69420850 100644 --- a/weaver/src/org/aspectj/weaver/NameMangler.java +++ b/weaver/src/org/aspectj/weaver/NameMangler.java @@ -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"; |