Skip to content

Apache Lucene open-source search software

Refactor loop to not addAll set to itsself on initial round (followup of #12311)

Uwe Schindlercf7245e38e77
diff --git a/gradle/generation/extract-jdk-apis/ExtractJdkApis.java b/gradle/generation/extract-jdk-apis/ExtractJdkApis.java
index 973a12bd03c..be8741db366 100644
--- a/gradle/generation/extract-jdk-apis/ExtractJdkApis.java
+++ b/gradle/generation/extract-jdk-apis/ExtractJdkApis.java
@@ -99,8 +99,8 @@ public final class ExtractJdkApis {
}
}
// recursively add all superclasses / interfaces of visible classes to classesToInclude:
- for (Set<String> a = classesToInclude; !a.isEmpty();
- a = a.stream().map(references::get).filter(Objects::nonNull).flatMap(Arrays::stream).collect(Collectors.toSet())) {
+ for (Set<String> a = classesToInclude; !a.isEmpty();) {
+ a = a.stream().map(references::get).filter(Objects::nonNull).flatMap(Arrays::stream).collect(Collectors.toSet());
classesToInclude.addAll(a);
}
// remove all non-visible or not referenced classes: