Skip to content

Commit

Permalink
Found and fixed two more occurrences on synchronized(session)
Browse files Browse the repository at this point in the history
  • Loading branch information
BalusC committed Feb 18, 2024
1 parent 86d0864 commit 039c661
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.sun.faces.lifecycle;

import static com.sun.faces.context.SessionMap.getMutex;
import static com.sun.faces.renderkit.RenderKitUtils.PredefinedPostbackParameter.CLIENT_WINDOW_PARAM;

import java.util.Map;
Expand Down Expand Up @@ -55,7 +56,7 @@ public void decode(FacesContext context) {
}

private String calculateClientWindow(FacesContext context) {
synchronized (context.getExternalContext().getSession(true)) {
synchronized (getMutex(context.getExternalContext().getSession(true))) {
final String clientWindowCounterKey = "com.sun.faces.lifecycle.ClientWindowCounterKey";
ExternalContext extContext = context.getExternalContext();
Map<String, Object> sessionAttrs = extContext.getSessionMap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ public Object getState(FacesContext ctx, String viewId) {
}

// noinspection SynchronizationOnLocalVariableOrMethodParameter
synchronized (sessionObj) {
synchronized (getMutex(sessionObj)) {
Map logicalMap = (Map) externalCtx.getSessionMap().get(LOGICAL_VIEW_MAP);
if (logicalMap != null) {
Map actualMap = (Map) logicalMap.get(idInLogicalMap);
Expand Down

0 comments on commit 039c661

Please sign in to comment.