BF: [ 2459542 ] Synchronize singletons
https://sourceforge.net/tracker/index.php?func=detail&aid=2459542&group_id=176962&atid=955896 Adempiere has several singleton classes which are not safe and must be synchronized. Suggestion is to synchronize get methods in order to avoid concurrency issues.
This commit is contained in:
parent
626a72ee5d
commit
95fc42571b
|
@ -33,7 +33,7 @@ public class CLogFilter implements Filter
|
|||
* Get Filter
|
||||
* @return singleton
|
||||
*/
|
||||
public static CLogFilter get()
|
||||
public static synchronized CLogFilter get()
|
||||
{
|
||||
if (s_filter == null)
|
||||
s_filter = new CLogFilter();
|
||||
|
|
|
@ -38,7 +38,7 @@ public class CLogFormatter extends Formatter
|
|||
* Get Formatter
|
||||
* @return singleton
|
||||
*/
|
||||
public static CLogFormatter get()
|
||||
public static synchronized CLogFormatter get()
|
||||
{
|
||||
if (s_formatter == null)
|
||||
s_formatter = new CLogFormatter();
|
||||
|
|
|
@ -19,7 +19,7 @@ package org.compiere.util;
|
|||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* Adempiere Cache Manangement
|
||||
* Adempiere Cache Management
|
||||
*
|
||||
* @author Jorg Janke
|
||||
* @version $Id: CacheMgt.java,v 1.2 2006/07/30 00:54:35 jjanke Exp $
|
||||
|
@ -28,9 +28,9 @@ public class CacheMgt
|
|||
{
|
||||
/**
|
||||
* Get Cache Management
|
||||
* @return Cache Mgr
|
||||
* @return Cache Manager
|
||||
*/
|
||||
public static CacheMgt get()
|
||||
public static synchronized CacheMgt get()
|
||||
{
|
||||
if (s_cache == null)
|
||||
s_cache = new CacheMgt();
|
||||
|
|
|
@ -48,9 +48,9 @@ public final class Msg
|
|||
|
||||
/**
|
||||
* Get Message Object
|
||||
* @return Mag
|
||||
* @return Msg
|
||||
*/
|
||||
private static Msg get()
|
||||
private static synchronized Msg get()
|
||||
{
|
||||
if (s_msg == null)
|
||||
s_msg = new Msg();
|
||||
|
|
Loading…
Reference in New Issue