]> source.dussan.org Git - jgit.git/commitdiff
[spotbugs] Fix incorrect lazy initialization in SystemReader 29/173429/6
authorMatthias Sohn <matthias.sohn@sap.com>
Sat, 5 Dec 2020 00:34:33 +0000 (01:34 +0100)
committerMatthias Sohn <matthias.sohn@sap.com>
Tue, 22 Dec 2020 09:53:01 +0000 (10:53 +0100)
This fixes two warnings of type LI_LAZY_INIT_STATIC.

Change-Id: I26a7a48aed9d0a0547e908a56b7014a7620fadd8
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
org.eclipse.jgit/src/org/eclipse/jgit/util/SystemReader.java

index 447f417e7e611a8200ad1d76927b4c6bd8db3cd1..54fd539f671bccf17e7ca844f42e17a128048c5c 100644 (file)
@@ -56,9 +56,9 @@ public abstract class SystemReader {
 
        private static final SystemReader DEFAULT;
 
-       private static Boolean isMacOS;
+       private static volatile Boolean isMacOS;
 
-       private static Boolean isWindows;
+       private static volatile Boolean isWindows;
 
        static {
                SystemReader r = new Default();