diff options
author | mkersten <mkersten> | 2003-08-16 08:51:11 +0000 |
---|---|---|
committer | mkersten <mkersten> | 2003-08-16 08:51:11 +0000 |
commit | 3a495aad88865d64d3e8ee005241e7edbe5a7a82 (patch) | |
tree | cdf50cf9c24640170898a00ec11e95b8c539253c /org.aspectj.ajdt.core | |
parent | eb12f56518d08c54fc17047749a5d2d66b3c4181 (diff) | |
download | aspectj-3a495aad88865d64d3e8ee005241e7edbe5a7a82.tar.gz aspectj-3a495aad88865d64d3e8ee005241e7edbe5a7a82.zip |
Fixed AJDT bug with truncation of labels (there was a weird substring call in AdviceActionDelegate). Fixed ASM/AJDT modifiers bug. Fixed ASM static initializers bug (we may want to change the way they show up, i.e. Added imports to ASM containment hierarchy. Fixed numerous AJBrwoser, JBuilder and NetBeans bugs.
Diffstat (limited to 'org.aspectj.ajdt.core')
-rw-r--r-- | org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmHierarchyBuilder.java | 46 |
1 files changed, 45 insertions, 1 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 d044ab0fb..d6268ec82 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 @@ -83,6 +83,14 @@ public class AsmHierarchyBuilder extends AbstractSyntaxTreeVisitorAdapter { new ArrayList()); } + cuNode.addChild(new ProgramElement( + "import declarations", + IProgramElement.Kind.IMPORT_REFERENCE, + null, + 0, + "", + new ArrayList())); + final IProgramElement addToNode = genAddToNode(unit, structureModel); // -- remove duplicates before adding (XXX use them instead?) @@ -172,7 +180,8 @@ public class AsmHierarchyBuilder extends AbstractSyntaxTreeVisitorAdapter { name, kind, makeLocation(typeDeclaration), - typeDeclaration.modifiers, "", + typeDeclaration.modifiers, + "", new ArrayList()); ((IProgramElement)stack.peek()).addChild(peNode); @@ -309,6 +318,39 @@ public class AsmHierarchyBuilder extends AbstractSyntaxTreeVisitorAdapter { stack.pop(); } + public boolean visit(ImportReference importRef, CompilationUnitScope scope) { + int dotIndex = importRef.toString().lastIndexOf('.'); + String currPackageImport = ""; + if (dotIndex != -1) { + currPackageImport = importRef.toString().substring(0, dotIndex); + } + if (!((ProgramElement)stack.peek()).getPackageName().equals(currPackageImport)) { + + IProgramElement peNode = new ProgramElement( + new String(importRef.toString()), + IProgramElement.Kind.IMPORT_REFERENCE, + makeLocation(importRef), + 0, + "", + new ArrayList()); + + ProgramElement imports = (ProgramElement)((ProgramElement)stack.peek()).getChildren().get(0); + imports.addChild(0, peNode); + stack.push(peNode); + } + return true; + } + public void endVisit(ImportReference importRef, CompilationUnitScope scope) { + int dotIndex = importRef.toString().lastIndexOf('.'); + String currPackageImport = ""; + if (dotIndex != -1) { + currPackageImport = importRef.toString().substring(0, dotIndex); + } + if (!((ProgramElement)stack.peek()).getPackageName().equals(currPackageImport)) { + stack.pop(); + } + } + public boolean visit(FieldDeclaration fieldDeclaration, MethodScope scope) { IProgramElement peNode = new ProgramElement( new String(fieldDeclaration.name), @@ -496,4 +538,6 @@ public class AsmHierarchyBuilder extends AbstractSyntaxTreeVisitorAdapter { currCompilationResult.lineSeparatorPositions, td.declarationSourceEnd); } + + } |