SEC-543: Added null guard clauses to reduce nesting and increase readability.
This commit is contained in:
parent
c9de2f6c9f
commit
9fe181046b
|
@ -145,15 +145,22 @@ public class SessionRegistryImpl implements SessionRegistry, ApplicationListener
|
||||||
|
|
||||||
SessionInformation info = getSessionInformation(sessionId);
|
SessionInformation info = getSessionInformation(sessionId);
|
||||||
|
|
||||||
if (info != null) {
|
if (info == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (logger.isDebugEnabled()) {
|
if (logger.isDebugEnabled()) {
|
||||||
logger.debug("Removing session " + sessionId + " from set of registered sessions");
|
logger.debug("Removing session " + sessionId + " from set of registered sessions");
|
||||||
}
|
}
|
||||||
|
|
||||||
sessionIds.remove(sessionId);
|
sessionIds.remove(sessionId);
|
||||||
|
|
||||||
Set sessionsUsedByPrincipal = (Set) principals.get(info.getPrincipal());
|
Set sessionsUsedByPrincipal = (Set) principals.get(info.getPrincipal());
|
||||||
|
|
||||||
if (sessionsUsedByPrincipal != null) {
|
if (sessionsUsedByPrincipal == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
synchronized (sessionsUsedByPrincipal) {
|
synchronized (sessionsUsedByPrincipal) {
|
||||||
if (logger.isDebugEnabled()) {
|
if (logger.isDebugEnabled()) {
|
||||||
logger.debug("Removing session " + sessionId + " from principal's set of registered sessions");
|
logger.debug("Removing session " + sessionId + " from principal's set of registered sessions");
|
||||||
|
@ -170,6 +177,4 @@ public class SessionRegistryImpl implements SessionRegistry, ApplicationListener
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue