From fbdf37a831b632ff7d2ebc592613f5dfcf972c77 Mon Sep 17 00:00:00 2001 From: aclement Date: Tue, 17 Nov 2009 18:37:58 +0000 Subject: [PATCH] avoid using helpers on Member hierarchy --- .../src/org/aspectj/weaver/JoinPointSignature.java | 4 ---- .../src/org/aspectj/weaver/JoinPointSignatureIterator.java | 2 +- org.aspectj.matcher/src/org/aspectj/weaver/Member.java | 1 + org.aspectj.matcher/src/org/aspectj/weaver/MemberImpl.java | 2 +- .../src/org/aspectj/weaver/ResolvedMember.java | 2 -- .../src/org/aspectj/weaver/ResolvedMemberImpl.java | 6 +----- 6 files changed, 4 insertions(+), 13 deletions(-) diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/JoinPointSignature.java b/org.aspectj.matcher/src/org/aspectj/weaver/JoinPointSignature.java index 128a0d739..2649cf1fa 100644 --- a/org.aspectj.matcher/src/org/aspectj/weaver/JoinPointSignature.java +++ b/org.aspectj.matcher/src/org/aspectj/weaver/JoinPointSignature.java @@ -165,10 +165,6 @@ public class JoinPointSignature implements ResolvedMember { public boolean isPublic() { return realMember.isPublic(); } - - public boolean isProtected() { - return realMember.isProtected(); - } public boolean isDefault() { return realMember.isDefault(); diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/JoinPointSignatureIterator.java b/org.aspectj.matcher/src/org/aspectj/weaver/JoinPointSignatureIterator.java index 1597989ed..50332c1c0 100644 --- a/org.aspectj.matcher/src/org/aspectj/weaver/JoinPointSignatureIterator.java +++ b/org.aspectj.matcher/src/org/aspectj/weaver/JoinPointSignatureIterator.java @@ -163,7 +163,7 @@ public class JoinPointSignatureIterator implements Iterator if (signaturesOfMember.getKind() == Member.FIELD) { return false; } - if (signaturesOfMember.isStatic()) { + if (Modifier.isStatic(signaturesOfMember.getModifiers())) { return false; } return true; diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/Member.java b/org.aspectj.matcher/src/org/aspectj/weaver/Member.java index 7425ab2ce..de84dd416 100644 --- a/org.aspectj.matcher/src/org/aspectj/weaver/Member.java +++ b/org.aspectj.matcher/src/org/aspectj/weaver/Member.java @@ -21,6 +21,7 @@ import java.util.Collection; public interface Member extends Comparable { public static final Member[] NONE = new Member[0]; + public static final MemberKind METHOD = new MemberKind("METHOD", 1); public static final MemberKind FIELD = new MemberKind("FIELD", 2); public static final MemberKind CONSTRUCTOR = new MemberKind("CONSTRUCTOR", 3); diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/MemberImpl.java b/org.aspectj.matcher/src/org/aspectj/weaver/MemberImpl.java index e10174a26..3dfc3c3a0 100644 --- a/org.aspectj.matcher/src/org/aspectj/weaver/MemberImpl.java +++ b/org.aspectj.matcher/src/org/aspectj/weaver/MemberImpl.java @@ -437,7 +437,7 @@ public class MemberImpl implements Member { // this is wrong if the member doesn't exist, but that doesn't // matter ret.add(myType); - } else if (isStatic() || kind == FIELD) { + } else if (Modifier.isStatic(modifiers) || kind == FIELD) { walkUpStatic(ret, myType); } else { walkUp(ret, myType); diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/ResolvedMember.java b/org.aspectj.matcher/src/org/aspectj/weaver/ResolvedMember.java index 37c9edbff..f49ef4845 100644 --- a/org.aspectj.matcher/src/org/aspectj/weaver/ResolvedMember.java +++ b/org.aspectj.matcher/src/org/aspectj/weaver/ResolvedMember.java @@ -94,8 +94,6 @@ public interface ResolvedMember extends Member, AnnotatedElement, TypeVariableDe public boolean isPublic(); - public boolean isProtected(); - public boolean isDefault(); public boolean isVisible(ResolvedType fromType); diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/ResolvedMemberImpl.java b/org.aspectj.matcher/src/org/aspectj/weaver/ResolvedMemberImpl.java index 712e6f30b..330e27920 100644 --- a/org.aspectj.matcher/src/org/aspectj/weaver/ResolvedMemberImpl.java +++ b/org.aspectj.matcher/src/org/aspectj/weaver/ResolvedMemberImpl.java @@ -152,7 +152,7 @@ public class ResolvedMemberImpl extends MemberImpl implements IHasPosition, Anno if (aMember.getKind() == Member.FIELD) { return false; } - if (aMember.isStatic()) { + if (Modifier.isStatic(aMember.getModifiers())) { return false; } return true; @@ -621,10 +621,6 @@ public class ResolvedMemberImpl extends MemberImpl implements IHasPosition, Anno return Modifier.isPublic(modifiers); } - public boolean isProtected() { - return Modifier.isProtected(modifiers); - } - public boolean isDefault() { int mods = getModifiers(); return !(Modifier.isPublic(mods) || Modifier.isProtected(mods) || Modifier.isPrivate(mods)); -- 2.39.5