Skip to content

Commit 9cf3ced

Browse files
committed
unsynchronize
1 parent a4e28bf commit 9cf3ced

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

inject/src/main/java/io/avaje/inject/spi/DBeanMap.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,21 @@
66

77
import java.lang.reflect.ParameterizedType;
88
import java.lang.reflect.Type;
9-
import java.util.*;
10-
import java.util.concurrent.ConcurrentHashMap;
9+
import java.util.HashSet;
10+
import java.util.LinkedHashMap;
11+
import java.util.List;
12+
import java.util.Map;
13+
import java.util.Optional;
14+
import java.util.Set;
1115

1216
/**
1317
* Map of types (class types, interfaces and annotations) to a DContextEntry where the
1418
* entry holds a list of bean instances for that type.
1519
*/
1620
final class DBeanMap {
1721
private static final Optional<Object> EMPTY = Optional.empty();
18-
private final Map<String, DContextEntry> beans = new ConcurrentHashMap<>();
19-
private final Set<String> qualifiers = Collections.synchronizedSet(new HashSet<>());
22+
private final Map<String, DContextEntry> beans = new LinkedHashMap<>();
23+
private final Set<String> qualifiers = new HashSet<>();
2024

2125
private NextBean nextBean;
2226
private Class<? extends AvajeModule> currentModule;

inject/src/main/java/io/avaje/inject/spi/DContextEntry.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22

33
import jakarta.inject.Provider;
44

5-
import java.util.*;
5+
import java.util.ArrayList;
6+
import java.util.LinkedHashMap;
7+
import java.util.List;
8+
import java.util.Map;
69

710
/**
811
* Entry for a given key (bean class, interface class or annotation class).
@@ -11,7 +14,7 @@
1114
*/
1215
final class DContextEntry {
1316

14-
private final List<DContextEntryBean> entries = Collections.synchronizedList(new ArrayList<>(5));
17+
private final List<DContextEntryBean> entries = new ArrayList<>(5);
1518

1619
@Override
1720
public String toString() {

0 commit comments

Comments
 (0)