From 2301b3677678e86673ebd0cbe7bb9740ebfba84a Mon Sep 17 00:00:00 2001 From: Andrey Turbanov Date: Sat, 26 Feb 2022 14:17:56 +0300 Subject: Cleanup redundant type casts, due to too weak variable type declaration --- taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/Ajc2.java | 8 ++++---- .../src/main/java/org/aspectj/tools/ant/taskdefs/AjcTask.java | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'taskdefs') diff --git a/taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/Ajc2.java b/taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/Ajc2.java index 87f2f4423..9215efb23 100644 --- a/taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/Ajc2.java +++ b/taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/Ajc2.java @@ -414,8 +414,8 @@ public class Ajc2 extends Javac { List newIncludes = new ArrayList<>(); List newArguments = new ArrayList<>(); if (argfiles != null) { - for (Object o : argfiles) { - File argfile = ((Argfile) o).getFile(); + for (Argfile o : argfiles) { + File argfile = o.getFile(); expandArgfile(argfile, newIncludes, newArguments); } } @@ -442,8 +442,8 @@ public class Ajc2 extends Javac { } // Add the new included files - for (Object newInclude : newIncludes) { - newFiles.add((File) newInclude); + for (File newInclude : newIncludes) { + newFiles.add(newInclude); } // This is the same behavior found in Javac diff --git a/taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/AjcTask.java b/taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/AjcTask.java index aa9bd33a4..e49580dbe 100644 --- a/taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/AjcTask.java +++ b/taskdefs/src/main/java/org/aspectj/tools/ant/taskdefs/AjcTask.java @@ -1570,8 +1570,7 @@ public class AjcTask extends MatchingTask { } } if (0 < adapterFiles.size()) { - for (Object adapterFile : adapterFiles) { - File file = (File) adapterFile; + for (File file : adapterFiles) { if (file.canRead() && FileUtil.hasSourceSuffix(file)) { list.add(file.getAbsolutePath()); } -- cgit v1.2.3