]> source.dussan.org Git - aspectj.git/commitdiff
290227: fix and test
authoraclement <aclement>
Wed, 23 Sep 2009 16:18:29 +0000 (16:18 +0000)
committeraclement <aclement>
Wed, 23 Sep 2009 16:18:29 +0000 (16:18 +0000)
org.aspectj.matcher/src/org/aspectj/weaver/patterns/ReferencePointcut.java

index f225f80b45459b09f4d660e45faca2137ebbd396..de58787b56c46ce132f005b419c241390e5faddd 100644 (file)
@@ -151,8 +151,9 @@ public class ReferencePointcut extends Pointcut {
                if (pointcutDef == null && onType == null) {
                        while (true) {
                                UnresolvedType declaringType = searchType.getDeclaringType();
-                               if (declaringType == null)
+                               if (declaringType == null) {
                                        break;
+                               }
                                searchType = declaringType.resolve(scope.getWorld());
                                pointcutDef = searchType.findPointcut(name);
                                if (pointcutDef != null) {
@@ -291,8 +292,9 @@ public class ReferencePointcut extends Pointcut {
 
                        }
 
-                       if (declaringType == null)
+                       if (declaringType == null) {
                                declaringType = searchStart;
+                       }
                        pointcutDec = declaringType.findPointcut(name);
                        boolean foundMatchingPointcut = (pointcutDec != null && pointcutDec.isPrivate());
                        if (!foundMatchingPointcut) {
@@ -323,8 +325,9 @@ public class ReferencePointcut extends Pointcut {
                        IntMap newBindings = new IntMap();
                        for (int i = 0, len = arguments.size(); i < len; i++) {
                                TypePattern p = arguments.get(i);
-                               if (p == TypePattern.NO)
+                               if (p == TypePattern.NO) {
                                        continue;
+                               }
                                // we are allowed to bind to pointcuts which use subtypes as this is type safe
                                // this will be checked in ReferencePointcut.resolveBindings(). Can't check it here
                                // as we don't know about any new parents added via decp.
@@ -381,10 +384,12 @@ public class ReferencePointcut extends Pointcut {
        }
 
        public boolean equals(Object other) {
-               if (!(other instanceof ReferencePointcut))
+               if (!(other instanceof ReferencePointcut)) {
                        return false;
-               if (this == other)
+               }
+               if (this == other) {
                        return true;
+               }
                ReferencePointcut o = (ReferencePointcut) other;
                return o.name.equals(name) && o.arguments.equals(arguments)
                                && ((o.onType == null) ? (onType == null) : o.onType.equals(onType));