aboutsummaryrefslogtreecommitdiffstats
path: root/asm
diff options
context:
space:
mode:
authoraclement <aclement>2009-03-24 16:43:38 +0000
committeraclement <aclement>2009-03-24 16:43:38 +0000
commit7a7d6f0f1e81e6639bdaa4f278b4778b984ad175 (patch)
tree2e70682b1d9810847d32366218c487dd4fe13a55 /asm
parentb269e7bf87f9cc1951ecbcbec0d40f2682964854 (diff)
downloadaspectj-7a7d6f0f1e81e6639bdaa4f278b4778b984ad175.tar.gz
aspectj-7a7d6f0f1e81e6639bdaa4f278b4778b984ad175.zip
269840: [model] package search fails in binary aspect in same package
Diffstat (limited to 'asm')
-rw-r--r--asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java25
1 files changed, 12 insertions, 13 deletions
diff --git a/asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java b/asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java
index 8dcdd5bc7..d7892b56d 100644
--- a/asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java
+++ b/asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java
@@ -235,32 +235,31 @@ public class AspectJElementHierarchy implements IHierarchy {
result.add(root);
return result;
}
+ List result = new ArrayList();
for (Iterator iterator = children.iterator(); iterator.hasNext();) {
IProgramElement possiblePackage = (IProgramElement) iterator.next();
- if (possiblePackage.getKind() == IProgramElement.Kind.PACKAGE) {
- if (possiblePackage.getName().equals(packagename)) {
- List result = new ArrayList();
- result.add(possiblePackage);
- return result;
- }
+ if (possiblePackage.getKind() == IProgramElement.Kind.PACKAGE && possiblePackage.getName().equals(packagename)) {
+ result.add(possiblePackage);
}
if (possiblePackage.getKind() == IProgramElement.Kind.SOURCE_FOLDER) { // might be 'binaries'
if (possiblePackage.getName().equals("binaries")) {
for (Iterator iter2 = possiblePackage.getChildren().iterator(); iter2.hasNext();) {
IProgramElement possiblePackage2 = (IProgramElement) iter2.next();
- if (possiblePackage2.getKind() == IProgramElement.Kind.PACKAGE) {
- if (possiblePackage2.getName().equals(packagename)) {
- List result = new ArrayList();
- result.add(possiblePackage2);
- return result;
- }
+ if (possiblePackage2.getKind() == IProgramElement.Kind.PACKAGE
+ && possiblePackage2.getName().equals(packagename)) {
+ result.add(possiblePackage2);
+ break; // ok to break here, can't be another entry under binaries
}
}
}
}
}
+ if (result.isEmpty()) {
+ return Collections.EMPTY_LIST;
+ } else {
+ return result;
+ }
}
- return Collections.EMPTY_LIST;
}
private IProgramElement findClassInNodes(Collection nodes, String name, String typeName) {