aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kriegisch <Alexander@Kriegisch.name>2021-06-26 09:23:41 +0700
committerAlexander Kriegisch <Alexander@Kriegisch.name>2021-06-26 16:23:26 +0700
commitdfcf1d77a65344934f0e642907819f16b5a3af0a (patch)
tree625638c20baaa71c73442816f3c69df01ba987e8
parent18b5bb07747084fb0857148139260c085bfb196f (diff)
downloadaspectj-dfcf1d77a65344934f0e642907819f16b5a3af0a.tar.gz
aspectj-dfcf1d77a65344934f0e642907819f16b5a3af0a.zip
AjBuildConfig: simplify null classpath removal from path list
Use removeIf(Objects::isNull) instead of old-fashioned iterator loop. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
-rw-r--r--org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java9
1 files changed, 2 insertions, 7 deletions
diff --git a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java
index 5279ad940..91ca329c9 100644
--- a/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java
+++ b/org.aspectj.ajdt.core/src/main/java/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java
@@ -23,9 +23,9 @@ import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import java.util.Objects;
import java.util.Set;
import java.util.StringTokenizer;
import java.util.stream.Collectors;
@@ -957,12 +957,7 @@ public class AjBuildConfig implements CompilerConfigurationChangeFlags {
// The classpath is done after modules to give precedence to modules that share the
// same paths as classpath elements (the upcoming normalize will remove later dups)
allPaths.addAll(processStringPath(classpath, encoding));
- for (Iterator<FileSystem.Classpath> iter = allPaths.iterator();iter.hasNext();) {
- Classpath next = iter.next();
- if (next == null) {
- iter.remove();
- }
- }
+ allPaths.removeIf(Objects::isNull);
allPaths = FileSystem.ClasspathNormalizer.normalize(allPaths);
this.checkedClasspaths = new FileSystem.Classpath[allPaths.size()];
allPaths.toArray(this.checkedClasspaths);