Browse Source

fix for pr82752: ProgramElement.getSourceSignature returns "public" for "private" members

tags/V1_5_0M3
acolyer 19 years ago
parent
commit
8a772af970

+ 12
- 0
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AspectDeclaration.java View File

@@ -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;
}
}


+ 13
- 3
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmHierarchyBuilder.java View File

@@ -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,

Loading…
Cancel
Save