summaryrefslogtreecommitdiffstats
path: root/org.aspectj.ajdt.core
diff options
context:
space:
mode:
authoracolyer <acolyer>2005-08-24 15:47:22 +0000
committeracolyer <acolyer>2005-08-24 15:47:22 +0000
commit8a772af970720dddbcae353a6e04bb19ba2962bf (patch)
tree3aaa5e4666c3b11a447065ce9f9ae0da8df99caf /org.aspectj.ajdt.core
parentf84210636e992556394b6d1c885264d47b352434 (diff)
downloadaspectj-8a772af970720dddbcae353a6e04bb19ba2962bf.tar.gz
aspectj-8a772af970720dddbcae353a6e04bb19ba2962bf.zip
fix for pr82752: ProgramElement.getSourceSignature returns "public" for "private" members
Diffstat (limited to 'org.aspectj.ajdt.core')
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java12
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmHierarchyBuilder.java16
2 files changed, 25 insertions, 3 deletions
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 9203a43ab..fa0735819 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
@@ -81,6 +81,7 @@ public class AspectDeclaration extends TypeDeclaration {
public Map superAccessForInline = new HashMap();
public boolean isPrivileged;
+ private int declaredModifiers;
public EclipseSourceType concreteName;
@@ -104,6 +105,7 @@ public class AspectDeclaration extends TypeDeclaration {
}
public void resolve() {
+ declaredModifiers = modifiers; // remember our modifiers, we're going to be public in generateCode
if (binding == null) {
ignoreFurtherInvestigation = true;
return;
@@ -1115,5 +1117,15 @@ public class AspectDeclaration extends TypeDeclaration {
return output;
//XXX we should append the per-clause
}
+
+ /**
+ * All aspects are made public after type checking etc. and before generating code
+ * (so that the advice can be called!).
+ * This method returns the modifiers as specified in the original source code declaration
+ * so that the structure model sees the right thing.
+ */
+ public int getDeclaredModifiers() {
+ return declaredModifiers;
+ }
}
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmHierarchyBuilder.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmHierarchyBuilder.java
index fd8d8a7a4..165b21ba4 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmHierarchyBuilder.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmHierarchyBuilder.java
@@ -223,11 +223,16 @@ public class AsmHierarchyBuilder extends ASTVisitor {
}
}
+ int typeModifiers = typeDeclaration.modifiers;
+ if (typeDeclaration instanceof AspectDeclaration) {
+ typeModifiers = ((AspectDeclaration)typeDeclaration).getDeclaredModifiers();
+ }
+
IProgramElement peNode = new ProgramElement(
name,
kind,
makeLocation(typeDeclaration),
- typeDeclaration.modifiers,
+ typeModifiers,
"",
new ArrayList());
peNode.setSourceSignature(genSourceSignature(typeDeclaration));
@@ -261,12 +266,17 @@ public class AsmHierarchyBuilder extends ASTVisitor {
}
}
}
+
+ int typeModifiers = memberTypeDeclaration.modifiers;
+ if (memberTypeDeclaration instanceof AspectDeclaration) {
+ typeModifiers = ((AspectDeclaration)memberTypeDeclaration).getDeclaredModifiers();
+ }
IProgramElement peNode = new ProgramElement(
name,
kind,
makeLocation(memberTypeDeclaration),
- memberTypeDeclaration.modifiers,
+ typeModifiers,
"",
new ArrayList());
peNode.setSourceSignature(genSourceSignature(memberTypeDeclaration));
@@ -311,7 +321,7 @@ public class AsmHierarchyBuilder extends ASTVisitor {
}
}
}
-
+
IProgramElement peNode = new ProgramElement(
fullName,
kind,