aboutsummaryrefslogtreecommitdiffstats
path: root/weaver/src
diff options
context:
space:
mode:
authorAndrey Turbanov <turbanoff@gmail.com>2022-02-26 14:17:56 +0300
committerAndrey Turbanov <turbanoff@gmail.com>2022-02-26 14:17:56 +0300
commit2301b3677678e86673ebd0cbe7bb9740ebfba84a (patch)
treef5ce0e965cfd718811a8f4e4d54b622a566233ba /weaver/src
parent102e0617a4bbcf0bd232b4f64995161db8681099 (diff)
downloadaspectj-2301b3677678e86673ebd0cbe7bb9740ebfba84a.tar.gz
aspectj-2301b3677678e86673ebd0cbe7bb9740ebfba84a.zip
Cleanup redundant type casts, due to too weak variable type declaration
Diffstat (limited to 'weaver/src')
-rw-r--r--weaver/src/main/java/org/aspectj/weaver/bcel/BcelShadow.java3
-rw-r--r--weaver/src/main/java/org/aspectj/weaver/bcel/BcelWeaver.java3
-rw-r--r--weaver/src/main/java/org/aspectj/weaver/bcel/LazyClassGen.java5
-rw-r--r--weaver/src/main/java/org/aspectj/weaver/loadtime/definition/SimpleAOPParser.java3
-rw-r--r--weaver/src/main/java/org/aspectj/weaver/reflect/Java15ReflectionBasedReferenceTypeDelegate.java3
-rw-r--r--weaver/src/main/java/org/aspectj/weaver/tools/WeavingAdaptor.java3
6 files changed, 7 insertions, 13 deletions
diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelShadow.java b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelShadow.java
index 9640fe118..d814903c9 100644
--- a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelShadow.java
+++ b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelShadow.java
@@ -1510,8 +1510,7 @@ public class BcelShadow extends Shadow {
if (foundMember == null) {
// check the ITD'd dooberries
List<ConcreteTypeMunger> mungers = relevantType.resolve(world).getInterTypeMungers();
- for (Object munger : mungers) {
- ConcreteTypeMunger typeMunger = (ConcreteTypeMunger) munger;
+ for (ConcreteTypeMunger typeMunger : mungers) {
if (typeMunger.getMunger() instanceof NewMethodTypeMunger
|| typeMunger.getMunger() instanceof NewConstructorTypeMunger) {
ResolvedMember fakerm = typeMunger.getSignature();
diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelWeaver.java b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelWeaver.java
index 53f71df56..ccea81f49 100644
--- a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelWeaver.java
+++ b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelWeaver.java
@@ -1257,8 +1257,7 @@ public class BcelWeaver {
List<ShadowMunger> l = world.getCrosscuttingMembersSet().getShadowMungers();
Set<AdviceLocation> alreadyWarnedLocations = new HashSet<>();
- for (Object o : l) {
- ShadowMunger element = (ShadowMunger) o;
+ for (ShadowMunger element : l) {
// This will stop us incorrectly reporting deow checkers:
if (element instanceof BcelAdvice) {
BcelAdvice ba = (BcelAdvice) element;
diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/LazyClassGen.java b/weaver/src/main/java/org/aspectj/weaver/bcel/LazyClassGen.java
index 9155b4ba0..3feadca38 100644
--- a/weaver/src/main/java/org/aspectj/weaver/bcel/LazyClassGen.java
+++ b/weaver/src/main/java/org/aspectj/weaver/bcel/LazyClassGen.java
@@ -165,9 +165,8 @@ public final class LazyClassGen {
}
void addInlinedSourceFileInfo(String fullpath, int highestLineNumber) {
- Object o = inlinedFiles.get(fullpath);
- if (o != null) {
- InlinedSourceFileInfo info = (InlinedSourceFileInfo) o;
+ InlinedSourceFileInfo info = inlinedFiles.get(fullpath);
+ if (info != null) {
if (info.highestLineNumber < highestLineNumber) {
info.highestLineNumber = highestLineNumber;
}
diff --git a/weaver/src/main/java/org/aspectj/weaver/loadtime/definition/SimpleAOPParser.java b/weaver/src/main/java/org/aspectj/weaver/loadtime/definition/SimpleAOPParser.java
index 223d2c432..5aaec2e70 100644
--- a/weaver/src/main/java/org/aspectj/weaver/loadtime/definition/SimpleAOPParser.java
+++ b/weaver/src/main/java/org/aspectj/weaver/loadtime/definition/SimpleAOPParser.java
@@ -254,8 +254,7 @@ public class SimpleAOPParser {
throws Exception {
sap.startElement(xml.getName(), xml.getAttributes());
Iterable<LightXMLParser> childrens = xml.getChildrens();
- for (Object children : childrens) {
- LightXMLParser child = (LightXMLParser) children;
+ for (LightXMLParser child : childrens) {
traverse(sap, child);
}
sap.endElement(xml.getName());
diff --git a/weaver/src/main/java/org/aspectj/weaver/reflect/Java15ReflectionBasedReferenceTypeDelegate.java b/weaver/src/main/java/org/aspectj/weaver/reflect/Java15ReflectionBasedReferenceTypeDelegate.java
index 485aa0a76..c574e9196 100644
--- a/weaver/src/main/java/org/aspectj/weaver/reflect/Java15ReflectionBasedReferenceTypeDelegate.java
+++ b/weaver/src/main/java/org/aspectj/weaver/reflect/Java15ReflectionBasedReferenceTypeDelegate.java
@@ -269,8 +269,7 @@ public class Java15ReflectionBasedReferenceTypeDelegate extends ReflectionBasedR
parser = new InternalUseOnlyPointcutParser(classLoaderReference.getClassLoader());
}
Set<PointcutDesignatorHandler> additionalPointcutHandlers = world.getRegisteredPointcutHandlers();
- for (Object additionalPointcutHandler : additionalPointcutHandlers) {
- PointcutDesignatorHandler handler = (PointcutDesignatorHandler) additionalPointcutHandler;
+ for (PointcutDesignatorHandler handler : additionalPointcutHandlers) {
parser.registerPointcutDesignatorHandler(handler);
}
diff --git a/weaver/src/main/java/org/aspectj/weaver/tools/WeavingAdaptor.java b/weaver/src/main/java/org/aspectj/weaver/tools/WeavingAdaptor.java
index f64fc87d5..3ce3eef6e 100644
--- a/weaver/src/main/java/org/aspectj/weaver/tools/WeavingAdaptor.java
+++ b/weaver/src/main/java/org/aspectj/weaver/tools/WeavingAdaptor.java
@@ -568,8 +568,7 @@ public class WeavingAdaptor implements IMessageContext {
private void registerAspectLibraries(List<String> aspectPath) {
// System.err.println("? WeavingAdaptor.registerAspectLibraries(" + aspectPath + ")");
- for (Object o : aspectPath) {
- String libName = (String) o;
+ for (String libName : aspectPath) {
addAspectLibrary(libName);
}