diff options
author | Andrey Turbanov <turbanoff@gmail.com> | 2022-02-26 14:17:56 +0300 |
---|---|---|
committer | Andrey Turbanov <turbanoff@gmail.com> | 2022-02-26 14:17:56 +0300 |
commit | 2301b3677678e86673ebd0cbe7bb9740ebfba84a (patch) | |
tree | f5ce0e965cfd718811a8f4e4d54b622a566233ba /org.aspectj.matcher | |
parent | 102e0617a4bbcf0bd232b4f64995161db8681099 (diff) | |
download | aspectj-2301b3677678e86673ebd0cbe7bb9740ebfba84a.tar.gz aspectj-2301b3677678e86673ebd0cbe7bb9740ebfba84a.zip |
Cleanup redundant type casts, due to too weak variable type declaration
Diffstat (limited to 'org.aspectj.matcher')
3 files changed, 8 insertions, 20 deletions
diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/CrosscuttingMembers.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/CrosscuttingMembers.java index 98480f661..6bfd8a897 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/CrosscuttingMembers.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/CrosscuttingMembers.java @@ -343,25 +343,15 @@ public class CrosscuttingMembers { Set<Object> theseTypeMungers = new HashSet<>(); Set<Object> otherTypeMungers = new HashSet<>(); if (!careAboutShadowMungers) { - for (Object o : typeMungers) { - if (o instanceof ConcreteTypeMunger) { - ConcreteTypeMunger typeMunger = (ConcreteTypeMunger) o; - if (!typeMunger.existsToSupportShadowMunging()) { - theseTypeMungers.add(typeMunger); - } - } else { - theseTypeMungers.add(o); + for (ConcreteTypeMunger typeMunger : typeMungers) { + if (!typeMunger.existsToSupportShadowMunging()) { + theseTypeMungers.add(typeMunger); } } - for (Object o : other.typeMungers) { - if (o instanceof ConcreteTypeMunger) { - ConcreteTypeMunger typeMunger = (ConcreteTypeMunger) o; - if (!typeMunger.existsToSupportShadowMunging()) { - otherTypeMungers.add(typeMunger); - } - } else { - otherTypeMungers.add(o); + for (ConcreteTypeMunger typeMunger : other.typeMungers) { + if (!typeMunger.existsToSupportShadowMunging()) { + otherTypeMungers.add(typeMunger); } } } else { diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/AnnotationPointcut.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/AnnotationPointcut.java index 5f7cd1553..6742e9091 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/AnnotationPointcut.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/patterns/AnnotationPointcut.java @@ -140,8 +140,7 @@ public class AnnotationPointcut extends NameBindingPointcut { if (kind == Shadow.FieldGet || kind == Shadow.FieldSet) { // FIXME asc should include supers with getInterTypeMungersIncludingSupers ? List<ConcreteTypeMunger> mungers = rMember.getDeclaringType().resolve(shadow.getIWorld()).getInterTypeMungers(); - for (Object munger : mungers) { - ConcreteTypeMunger typeMunger = (ConcreteTypeMunger) munger; + for (ConcreteTypeMunger typeMunger : mungers) { if (typeMunger.getMunger() instanceof NewFieldTypeMunger) { ResolvedMember fakerm = typeMunger.getSignature(); if (fakerm.equals(member)) { diff --git a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/tools/StandardPointcutParser.java b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/tools/StandardPointcutParser.java index 9565230dd..5c4c5423a 100644 --- a/org.aspectj.matcher/src/main/java/org/aspectj/weaver/tools/StandardPointcutParser.java +++ b/org.aspectj.matcher/src/main/java/org/aspectj/weaver/tools/StandardPointcutParser.java @@ -148,8 +148,7 @@ public class StandardPointcutParser { */ private StandardPointcutParser(Set<PointcutPrimitive> supportedPointcutKinds, World world) { supportedPrimitives = supportedPointcutKinds; - for (Object supportedPointcutKind : supportedPointcutKinds) { - PointcutPrimitive element = (PointcutPrimitive) supportedPointcutKind; + for (PointcutPrimitive element : supportedPointcutKinds) { if ((element == PointcutPrimitive.IF) || (element == PointcutPrimitive.CFLOW) || (element == PointcutPrimitive.CFLOW_BELOW)) { throw new UnsupportedOperationException("Cannot handle if, cflow, and cflowbelow primitives"); |