Skip to content

Commit

Permalink
Avoid ConcurrentModificationException (#5828)
Browse files Browse the repository at this point in the history
  • Loading branch information
mernst authored May 2, 2023
1 parent a868d08 commit afdd30a
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ private void setClassesModified(@Nullable Collection<@BinaryName String> classNa
* across the class hierarchy by {@link #wpiPrepareCompilationUnitForWriting}.
*/
public void setSupertypesAndSubtypesModified() {
for (String path : modifiedFiles) {
// Copy into a list to avoid a ConcurrentModificationException.
for (String path : new ArrayList<>(modifiedFiles)) {
CompilationUnitAnnos cuAnnos = sourceToAnnos.get(path);
for (ClassOrInterfaceAnnos classAnnos : cuAnnos.types) {
String className = classAnnos.className;
Expand Down

0 comments on commit afdd30a

Please # to comment.