aboutsummaryrefslogtreecommitdiffstats
path: root/org.aspectj.ajdt.core/src
diff options
context:
space:
mode:
authoraclement <aclement>2004-02-09 15:07:37 +0000
committeraclement <aclement>2004-02-09 15:07:37 +0000
commit775d1175b7da80535cc48d22cb424239d76594bf (patch)
tree85ffa3bc3b3d9a88240e81a889285ed25801414e /org.aspectj.ajdt.core/src
parent481165a816d3209bed1b07b996a3b8f043140fd4 (diff)
downloadaspectj-775d1175b7da80535cc48d22cb424239d76594bf.tar.gz
aspectj-775d1175b7da80535cc48d22cb424239d76594bf.zip
Fix for Bugzilla Bug 50641
Better binary compatibility for advice method names - I've run the tests a thousand times and they all pass, I'm still nervous about this first big commit though *gulp*
Diffstat (limited to 'org.aspectj.ajdt.core/src')
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AdviceDeclaration.java11
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java1
2 files changed, 10 insertions, 2 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AdviceDeclaration.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AdviceDeclaration.java
index 6b6b801f5..9d10f6381 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AdviceDeclaration.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AdviceDeclaration.java
@@ -263,11 +263,18 @@ public class AdviceDeclaration extends MethodDeclaration {
return ret;
}
-
public void postParse(TypeDeclaration typeDec) {
+ int adviceSequenceNumberInType = ((AspectDeclaration)typeDec).adviceCounter++;
+
+ StringBuffer stringifiedPointcut = new StringBuffer(30);
+ pointcutDesignator.print(0,stringifiedPointcut);
this.selector =
- NameMangler.adviceName(EclipseFactory.fromBinding(typeDec.binding), kind, sourceStart).toCharArray();
+ NameMangler.adviceName(
+ EclipseFactory.fromBinding(typeDec.binding),
+ kind,
+ adviceSequenceNumberInType,
+ stringifiedPointcut.toString().hashCode()).toCharArray();
if (arguments != null) {
baseArgumentCount = arguments.length;
}
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java
index a3cff8ae6..27db10c3e 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java
@@ -53,6 +53,7 @@ public class AspectDeclaration extends TypeDeclaration {
public EclipseFactory factory; //??? should use this consistently
+ public int adviceCounter = 1; // Used as a part of the generated name for advice methods
// for better error messages in 1.0 to 1.1 transition
public TypePattern dominatesPattern;