diff options
author | aclement <aclement> | 2009-11-19 17:19:29 +0000 |
---|---|---|
committer | aclement <aclement> | 2009-11-19 17:19:29 +0000 |
commit | b503147e769fb7692aa54eb57f7f7b363329b482 (patch) | |
tree | 2d4a2b5ade7894af3f174b1f47d1299c8cf71659 | |
parent | fa1fe0b77adb59fec1129ef164621ed88ea9638b (diff) | |
download | aspectj-b503147e769fb7692aa54eb57f7f7b363329b482.tar.gz aspectj-b503147e769fb7692aa54eb57f7f7b363329b482.zip |
294647: guard and possible fix
-rw-r--r-- | org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java b/org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java index b752b89fc..8f793f8d0 100644 --- a/org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java +++ b/org.aspectj.matcher/src/org/aspectj/weaver/ResolvedType.java @@ -2237,21 +2237,19 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl } public List getExposedPointcuts() { - List ret = new ArrayList(); + List<ResolvedMember> ret = new ArrayList<ResolvedMember>(); if (getSuperclass() != null) { ret.addAll(getSuperclass().getExposedPointcuts()); } - - for (Iterator<ResolvedType> i = Arrays.asList(getDeclaredInterfaces()).iterator(); i.hasNext();) { - ResolvedType t = i.next(); - addPointcutsResolvingConflicts(ret, Arrays.asList(t.getDeclaredPointcuts()), false); + + for (ResolvedType type: getDeclaredInterfaces()) { + addPointcutsResolvingConflicts(ret, Arrays.asList(type.getDeclaredPointcuts()), false); } + addPointcutsResolvingConflicts(ret, Arrays.asList(getDeclaredPointcuts()), true); - for (Iterator i = ret.iterator(); i.hasNext();) { - ResolvedPointcutDefinition inherited = (ResolvedPointcutDefinition) i.next(); - // System.err.println("looking at: " + inherited + " in " + this); - // System.err.println(" " + inherited.isAbstract() + - // " in " + this.isAbstract()); + + for (ResolvedMember member: ret) { + ResolvedPointcutDefinition inherited = (ResolvedPointcutDefinition) member; if (inherited != null && inherited.isAbstract()) { if (!this.isAbstract()) { getWorld().showMessage(IMessage.ERROR, @@ -2260,22 +2258,18 @@ public abstract class ResolvedType extends UnresolvedType implements AnnotatedEl } } } - return ret; } - private void addPointcutsResolvingConflicts(List acc, List added, boolean isOverriding) { + private void addPointcutsResolvingConflicts(List<ResolvedMember> acc, List<ResolvedMember> added, boolean isOverriding) { for (Iterator i = added.iterator(); i.hasNext();) { ResolvedPointcutDefinition toAdd = (ResolvedPointcutDefinition) i.next(); for (Iterator j = acc.iterator(); j.hasNext();) { ResolvedPointcutDefinition existing = (ResolvedPointcutDefinition) j.next(); - if (existing == toAdd) { + if (toAdd==null || existing == toAdd) { continue; } UnresolvedType pointcutDeclaringTypeUT = existing.getDeclaringType(); - if (pointcutDeclaringTypeUT == null) { - System.err.println("DEBUG>>> Pointcut declaring type is unexpectedly null. Pointcut is " + existing.toString()); - } if (pointcutDeclaringTypeUT!=null) { ResolvedType pointcutDeclaringType = pointcutDeclaringTypeUT.resolve(getWorld()); if (!isVisible(existing.getModifiers(), pointcutDeclaringType, this)) { |