Skip to content

Commit 4495b3f

Browse files
committed
use eager initialization instead of synchronized
1 parent 30cfdce commit 4495b3f

File tree

1 file changed

+2
-5
lines changed
  • common-tools/clas-detector/src/main/java/org/jlab/detector/swaps

1 file changed

+2
-5
lines changed

common-tools/clas-detector/src/main/java/org/jlab/detector/swaps/SwapManager.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public final class SwapManager {
5656
private ConstantsManager currConman = null;
5757
private SchemaFactory schema = null;
5858

59-
private static SwapManager instance = null;
59+
private static SwapManager instance = new SwapManager();
6060

6161
public Set<String> getDetectors() {
6262
return this.detsToBanks.keySet();
@@ -70,10 +70,7 @@ public List<String> getBanks(String detectorName) {
7070

7171
private SwapManager() {}
7272

73-
public static synchronized SwapManager getInstance() {
74-
if (instance == null) {
75-
instance = new SwapManager();
76-
}
73+
public static SwapManager getInstance() {
7774
return instance;
7875
}
7976

0 commit comments

Comments
 (0)