ASM #16829 - TextWS: Problem with AlarmAlertFunctions static class initialization

Change-Id: I8e2cbe627942570a9544d21cd41b09701d65fccf

Former-commit-id: 756359ea4b [formerly 7fb946e4b8] [formerly 756359ea4b [formerly 7fb946e4b8] [formerly 5164b85f2f [formerly e2ab243f69cc96248284f78bbcd3c83f57f23b6d]]]
Former-commit-id: 5164b85f2f
Former-commit-id: a21b83ad29 [formerly aa56375e39]
Former-commit-id: 8554f4c811
This commit is contained in:
David Friedman 2014-12-03 15:55:20 +00:00
parent cbb485f757
commit 779ec6c13c

View file

@ -81,6 +81,7 @@ import com.vividsolutions.jts.geom.GeometryFactory;
* the implementation of proximity alarm
* 07/24/2014 3423 randerso Ensure ringBell is called on UI thread
* 09/09/2014 3580 mapeters Removed IQueryTransport usage (no longer exists).
* 12/03/2014 ASM #16829 D. Friedman Lazy initialization of alarmAlertBell
*
* </pre>
*
@ -110,8 +111,7 @@ public class AlarmAlertFunctions {
private static final String SITE_FILE = "DefaultSiteAlarms.xml";
private static final AlarmAlertBell alarmAlertBell = new AlarmAlertBell(
new Shell());
private static AlarmAlertBell alarmAlertBell;
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(AlarmAlertFunctions.class);
@ -174,7 +174,7 @@ public class AlarmAlertFunctions {
}
protected static void ringBell(boolean sound) {
alarmAlertBell.open(sound);
getAlarmalertbell().open(sound);
}
/**
@ -867,6 +867,10 @@ public class AlarmAlertFunctions {
* @return the alarmalertbell
*/
public static AlarmAlertBell getAlarmalertbell() {
if (alarmAlertBell == null) {
// No synchronize because this must be called on the UI thread anyway.
alarmAlertBell = new AlarmAlertBell(new Shell());
}
return alarmAlertBell;
}
}