From 2091b6d1ded90bfeb29f8d74bd17f05ec8fc983d Mon Sep 17 00:00:00 2001 From: Andrey Turbanov Date: Wed, 13 Apr 2022 13:51:39 +0300 Subject: Reduce 'Object' class usage --- .../main/java/org/aspectj/weaver/CrosscuttingMembers.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'org.aspectj.matcher/src/main/java/org/aspectj/weaver/CrosscuttingMembers.java') 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 6bfd8a897..17472ee6b 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 @@ -340,8 +340,8 @@ public class CrosscuttingMembers { // if we dont care about shadow mungers then ignore those // typeMungers which are created to help with the implementation // of shadowMungers - Set theseTypeMungers = new HashSet<>(); - Set otherTypeMungers = new HashSet<>(); + Set theseTypeMungers = new HashSet<>(); + Set otherTypeMungers = new HashSet<>(); if (!careAboutShadowMungers) { for (ConcreteTypeMunger typeMunger : typeMungers) { if (!typeMunger.existsToSupportShadowMunging()) { @@ -367,17 +367,17 @@ public class CrosscuttingMembers { } else { boolean shouldOverwriteThis = false; boolean foundInequality = false; - for (Iterator iter = theseTypeMungers.iterator(); iter.hasNext() && !foundInequality;) { - Object thisOne = iter.next(); + for (Iterator iter = theseTypeMungers.iterator(); iter.hasNext() && !foundInequality;) { + ConcreteTypeMunger thisOne = iter.next(); boolean foundInOtherSet = false; - for (Object otherOne : otherTypeMungers) { + for (ConcreteTypeMunger otherOne : otherTypeMungers) { if (thisOne instanceof ConcreteTypeMunger) { - if (((ConcreteTypeMunger) thisOne).shouldOverwrite()) { + if (thisOne.shouldOverwrite()) { shouldOverwriteThis = true; } } if (thisOne instanceof ConcreteTypeMunger && otherOne instanceof ConcreteTypeMunger) { - if (((ConcreteTypeMunger) thisOne).equivalentTo(otherOne)) { + if (thisOne.equivalentTo(otherOne)) { foundInOtherSet = true; } else if (thisOne.equals(otherOne)) { foundInOtherSet = true; -- cgit v1.2.3