Skip to content

Commit 24d238b

Browse files
Fixed Code Correctness: Double-Checked Locking in various constructors (#781)
Issue: 105113
1 parent 617b5fb commit 24d238b

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

common/src/main/java/com/genexus/ApplicationContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
public class ApplicationContext
99
{
10-
private static ApplicationContext instance;
10+
private volatile static ApplicationContext instance;
1111

1212
private String currentLocation = "";
1313

common/src/main/java/com/genexus/BaseProvider.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ public abstract class BaseProvider implements IGXSmartCacheProvider
2727
{
2828
private static final ILogger logger = LogManager.getLogger(BaseProvider.class);
2929

30-
ConcurrentHashMap<String, Vector<String>> queryTables;
30+
volatile ConcurrentHashMap<String, Vector<String>> queryTables;
3131
protected Date startupDate;
32-
Object syncLock = new Object();
32+
static Object syncLock = new Object();
3333
protected static final String FORCED_INVALIDATE = "SD";
3434

3535

common/src/main/java/com/genexus/diagnostics/GXDebugManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ public class GXDebugManager
1818
static final int PGM_INFO_NO_PARENT = 0;
1919
private static final long MICRO_FREQ = 1000;
2020

21-
private static GXDebugManager instance;
21+
private volatile static GXDebugManager instance;
2222
private static final Object sessionLock = new Object();
23-
private static boolean initialized = false;
23+
private volatile static boolean initialized = false;
2424
public static GXDebugManager getInstance()
2525
{
2626
if(!initialized)

common/src/main/java/com/genexus/util/PropertiesManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
public final class PropertiesManager
1313
{
14-
private static PropertiesManager instance;
14+
private volatile static PropertiesManager instance;
1515

1616
private Hashtable propertyFiles;
1717

java/src/main/java/com/genexus/internet/websocket/GXWebSocketService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
public class GXWebSocketService {
2525
public static final ILogger logger = LogManager.getLogger(GXWebSocketService.class);
26-
private static GXWebSocketService instance;
26+
private volatile static GXWebSocketService instance;
2727

2828
private String[] handlerCache = new String[HandlerType.values().length];
2929
private GXWebSocketSessionCollection wsClients = new GXWebSocketSessionCollection();

java/src/main/java/com/genexus/platform/NativeFunctions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
public class NativeFunctions
66
{
7-
private static INativeFunctions instance;
7+
private volatile static INativeFunctions instance;
88

99
private static Boolean isMicrosoft;
1010

java/src/main/java/com/genexus/webpanels/BlobsCleaner.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
public class BlobsCleaner
1212
{
13-
private static BlobsCleaner instance = null;
13+
private volatile static BlobsCleaner instance = null;
1414

1515
//Blobs archived by websession id
1616
private Hashtable<String, ArrayList<String>> blobsTable;

0 commit comments

Comments
 (0)