[FindBugs] Ensure proper lazy-initialization even if this costs some performance
This commit is contained in:
parent
cecb8d6d04
commit
c19a14a4a2
|
@ -227,10 +227,10 @@ public abstract class AbstractSessionManager extends ContainerLifeCycle implemen
|
|||
_context=ContextHandler.getCurrentContext();
|
||||
_loader=Thread.currentThread().getContextClassLoader();
|
||||
|
||||
if (_sessionIdManager==null)
|
||||
final Server server=getSessionHandler().getServer();
|
||||
synchronized (server)
|
||||
{
|
||||
final Server server=getSessionHandler().getServer();
|
||||
synchronized (server)
|
||||
if (_sessionIdManager==null)
|
||||
{
|
||||
_sessionIdManager=server.getSessionIdManager();
|
||||
if (_sessionIdManager==null)
|
||||
|
|
|
@ -307,9 +307,9 @@ public class HashSessionManager extends AbstractSessionManager
|
|||
|
||||
_scavengePeriodMs=period;
|
||||
|
||||
if (_timer!=null && (period!=old_period || _task==null))
|
||||
synchronized (this)
|
||||
{
|
||||
synchronized (this)
|
||||
if (_timer!=null && (period!=old_period || _task==null))
|
||||
{
|
||||
if (_task!=null)
|
||||
{
|
||||
|
|
|
@ -778,10 +778,10 @@ public class JDBCSessionIdManager extends AbstractSessionIdManager
|
|||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("Scavenging every "+_scavengeIntervalMs+" ms");
|
||||
|
||||
//if (_timer!=null && (period!=old_period || _task==null))
|
||||
if (_scheduler != null && (period!=old_period || _task==null))
|
||||
synchronized (this)
|
||||
{
|
||||
synchronized (this)
|
||||
//if (_timer!=null && (period!=old_period || _task==null))
|
||||
if (_scheduler != null && (period!=old_period || _task==null))
|
||||
{
|
||||
if (_task!=null)
|
||||
_task.cancel();
|
||||
|
|
Loading…
Reference in New Issue