summaryrefslogtreecommitdiffstats
path: root/org.aspectj.ajdt.core
diff options
context:
space:
mode:
Diffstat (limited to 'org.aspectj.ajdt.core')
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmHierarchyBuilder.java30
1 files changed, 20 insertions, 10 deletions
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 4494a6619..edcba82c9 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
@@ -537,15 +537,21 @@ public class AsmHierarchyBuilder extends ASTVisitor {
}
}
- public boolean visit(FieldDeclaration fieldDeclaration, MethodScope scope) {
- IProgramElement peNode = new ProgramElement(
- new String(fieldDeclaration.name),
- IProgramElement.Kind.FIELD,
- makeLocation(fieldDeclaration),
- fieldDeclaration.modifiers,
- "",
- new ArrayList());
- peNode.setCorrespondingType(fieldDeclaration.type.toString());
+ public boolean visit(FieldDeclaration fieldDeclaration, MethodScope scope) {
+ IProgramElement peNode = null;
+ if (fieldDeclaration.type == null) { // The field represents an enum value
+ peNode = new ProgramElement(
+ new String(fieldDeclaration.name),IProgramElement.Kind.ENUM_VALUE,
+ makeLocation(fieldDeclaration), fieldDeclaration.modifiers,
+ "", new ArrayList());
+ peNode.setCorrespondingType(fieldDeclaration.binding.type.debugName());
+ } else {
+ peNode = new ProgramElement(
+ new String(fieldDeclaration.name),IProgramElement.Kind.FIELD,
+ makeLocation(fieldDeclaration), fieldDeclaration.modifiers,
+ "", new ArrayList());
+ peNode.setCorrespondingType(fieldDeclaration.type.toString());
+ }
peNode.setSourceSignature(genSourceSignature(fieldDeclaration));
peNode.setFormalComment(generateJavadocComment(fieldDeclaration));
@@ -599,7 +605,11 @@ public class AsmHierarchyBuilder extends ASTVisitor {
protected String genSourceSignature(FieldDeclaration fieldDeclaration) {
StringBuffer output = new StringBuffer();
FieldDeclaration.printModifiers(fieldDeclaration.modifiers, output);
- fieldDeclaration.type.print(0, output).append(' ').append(fieldDeclaration.name);
+ if (fieldDeclaration.type == null) { // This is an enum value
+ output.append(fieldDeclaration.binding.type.debugName()).append(" ").append(fieldDeclaration.name);
+ } else {
+ fieldDeclaration.type.print(0, output).append(' ').append(fieldDeclaration.name);
+ }
if (fieldDeclaration.initialization != null
&& !(fieldDeclaration.initialization instanceof QualifiedAllocationExpression)) {