diff options
author | aclement <aclement> | 2008-09-24 20:09:17 +0000 |
---|---|---|
committer | aclement <aclement> | 2008-09-24 20:09:17 +0000 |
commit | 27ee20bd6d29a42619afd9a3b0627b1ac9eeba43 (patch) | |
tree | f93b659bc8c27e9eb533d9b1b3ec11112baa6482 /org.aspectj.ajdt.core | |
parent | 96961535f6353b1e96de55eb3223476883533dc3 (diff) | |
download | aspectj-27ee20bd6d29a42619afd9a3b0627b1ac9eeba43.tar.gz aspectj-27ee20bd6d29a42619afd9a3b0627b1ac9eeba43.zip |
247742:c27
Diffstat (limited to 'org.aspectj.ajdt.core')
-rw-r--r-- | org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmHierarchyBuilder.java | 83 |
1 files changed, 42 insertions, 41 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 06d3191fd..3b1248002 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 @@ -214,50 +214,52 @@ public class AsmHierarchyBuilder extends ASTVisitor { ImportReference unitPackage = unit.currentPackage; - if (null == unitPackage) { - // Is there a sourceFolder to stick in? - if (sourceFolder == null) { - addToNode = structureModel.getRoot(); - } else { - addToNode = findOrCreateChildSourceFolder(sourceFolder, structureModel); - } + // if (null == unitPackage) { + // // Is there a sourceFolder to stick in? + // if (sourceFolder == null) { + // addToNode = structureModel.getRoot(); + // } else { + // addToNode = findOrCreateChildSourceFolder(sourceFolder, structureModel); + // } + // } else { + + IProgramElement rootForSource = structureModel.getRoot(); + if (sourceFolder != null) { + rootForSource = findOrCreateChildSourceFolder(sourceFolder, structureModel); + } + String pkgName; + if (unitPackage == null) { + pkgName = ""; } else { - - IProgramElement rootForSource = structureModel.getRoot(); - if (sourceFolder != null) { - rootForSource = findOrCreateChildSourceFolder(sourceFolder, structureModel); - } - String pkgName; - { - StringBuffer nameBuffer = new StringBuffer(); - final char[][] importName = unitPackage.getImportName(); - final int last = importName.length - 1; - for (int i = 0; i < importName.length; i++) { - nameBuffer.append(new String(importName[i])); - if (i < last) { - nameBuffer.append('.'); - } + StringBuffer nameBuffer = new StringBuffer(); + final char[][] importName = unitPackage.getImportName(); + final int last = importName.length - 1; + for (int i = 0; i < importName.length; i++) { + nameBuffer.append(new String(importName[i])); + if (i < last) { + nameBuffer.append('.'); } - pkgName = nameBuffer.toString(); } + pkgName = nameBuffer.toString(); + } - IProgramElement pkgNode = null; - if (structureModel != null && structureModel.getRoot() != null && rootForSource.getChildren() != null) { - for (Iterator it = rootForSource.getChildren().iterator(); it.hasNext();) { - IProgramElement currNode = (IProgramElement) it.next(); - if (pkgName.equals(currNode.getName())) { - pkgNode = currNode; - break; - } + IProgramElement pkgNode = null; + if (structureModel != null && structureModel.getRoot() != null && rootForSource.getChildren() != null) { + for (Iterator it = rootForSource.getChildren().iterator(); it.hasNext();) { + IProgramElement currNode = (IProgramElement) it.next(); + if (pkgName.equals(currNode.getName())) { + pkgNode = currNode; + break; } } - if (pkgNode == null) { - // note packages themselves have no source location - pkgNode = new ProgramElement(pkgName, IProgramElement.Kind.PACKAGE, new ArrayList()); - rootForSource.addChild(pkgNode); - } - addToNode = pkgNode; } + if (pkgNode == null) { + // note packages themselves have no source location + pkgNode = new ProgramElement(pkgName, IProgramElement.Kind.PACKAGE, new ArrayList()); + rootForSource.addChild(pkgNode); + } + addToNode = pkgNode; + // } } return addToNode; } @@ -281,13 +283,12 @@ public class AsmHierarchyBuilder extends ASTVisitor { if (Arrays.equals(annotation.type.getTypeBindingPublic(scope).signature(), "Lorg/aspectj/lang/annotation/Aspect;" .toCharArray())) { kind = IProgramElement.Kind.ASPECT; - } else if(annotation.resolvedType != null) { + } else if (annotation.resolvedType != null) { // Fix for the case where in a privileged aspect a parent declaration : - // declare parents: (@A C+) implements (B); + // declare parents: (@A C+) implements (B); // is causing the resolvedType to be null when it shouldn't // for the aspect and privileged annotation of that aspect. - - + // Creating the char[][] needed for ImportReference String[] temp = (new String(annotation.resolvedType.constantPoolName())).split("/"); if (temp.length > 1) { |