Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix ConcurrentModificationException at v2-migration #5665

Merged
merged 2 commits into from
Nov 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"type": "bugfix",
"category": "v2-migration OpenRewrite recipe",
"contributor": "sk-br",
"description": "This fixes a ConcurrentModificationException - just by replacing a HashMap with ConcurrentHashMap"
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
import static software.amazon.awssdk.v2migration.internal.utils.SdkTypeUtils.isV1ModelClass;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.IdentityHashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.Stack;
import java.util.concurrent.ConcurrentHashMap;
import org.openrewrite.ExecutionContext;
import org.openrewrite.Recipe;
import org.openrewrite.TreeVisitor;
Expand Down Expand Up @@ -88,7 +88,7 @@ private static class ChangeTypeVisitor extends JavaVisitor<ExecutionContext> {
private final Set<String> topLevelClassnames = new HashSet<>();
private final List<String> wildcardImports = new ArrayList<>();

private Map<String, Pair<JavaType.Class, JavaType>> oldTypeToNewType = new HashMap<>();
private Map<String, Pair<JavaType.Class, JavaType>> oldTypeToNewType = new ConcurrentHashMap<>();

@Override
public J visitClassDeclaration(J.ClassDeclaration classDecl, ExecutionContext ctx) {
Expand Down
Loading