Skip to content

Commit

Permalink
Fix #729: explicit destroyViewScopeMap call in Hacks is not anymore
Browse files Browse the repository at this point in the history
necessary since MyFaces 4.x
  • Loading branch information
BalusC committed Jan 14, 2023
1 parent b7236ec commit ece072b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/org/omnifaces/util/Hacks.java
Expand Up @@ -315,7 +315,11 @@ public static void removeViewState(FacesContext context, ResponseStateManager ma

if (count < 1) {
viewScopeIdCounts.remove(viewScopeId);
invokeMethod(getApplicationAttribute(context, MYFACES_VIEW_SCOPE_PROVIDER), "destroyViewScopeMap", context, viewScopeId);
Object viewScopeProvider = getApplicationAttribute(context, MYFACES_VIEW_SCOPE_PROVIDER);

if (viewScopeProvider != null) { // This was removed in MyFaces 4.x and leveraged to CDI, see #729.
invokeMethod(viewScopeProvider, "destroyViewScopeMap", context, viewScopeId);
}
}
else {
viewScopeIdCounts.put(viewScopeId, count);
Expand Down

0 comments on commit ece072b

Please sign in to comment.