]> source.dussan.org Git - aspectj.git/commitdiff
276399: test and fix: annotation matching, default package and source folder
authoraclement <aclement>
Fri, 15 May 2009 06:19:44 +0000 (06:19 +0000)
committeraclement <aclement>
Fri, 15 May 2009 06:19:44 +0000 (06:19 +0000)
asm/src/org/aspectj/asm/internal/AspectJElementHierarchy.java

index a075caef24fbb3f44deec18a029db2ef69f32948..5b4fed1f55bc9be9958bc81466d884116041a178 100644 (file)
@@ -210,6 +210,7 @@ public class AspectJElementHierarchy implements IHierarchy {
                        return Collections.EMPTY_LIST;
                }
                if (((IProgramElement) children.get(0)).getKind() == IProgramElement.Kind.SOURCE_FOLDER) {
+                       String searchPackageName = (packagename == null ? "" : packagename); // default package means match on ""
                        // dealing with source folders
                        List matchingPackageNodes = new ArrayList();
                        for (Iterator iterator = children.iterator(); iterator.hasNext();) {
@@ -218,7 +219,7 @@ public class AspectJElementHierarchy implements IHierarchy {
                                for (Iterator iterator2 = possiblePackageNodes.iterator(); iterator2.hasNext();) {
                                        IProgramElement possiblePackageNode = (IProgramElement) iterator2.next();
                                        if (possiblePackageNode.getKind() == IProgramElement.Kind.PACKAGE) {
-                                               if (possiblePackageNode.getName().equals(packagename)) {
+                                               if (possiblePackageNode.getName().equals(searchPackageName)) {
                                                        matchingPackageNodes.add(possiblePackageNode);
                                                }
                                        }