diff --git a/impl/src/main/java/com/sun/faces/facelets/tag/jsf/IterationIdManager.java b/impl/src/main/java/com/sun/faces/facelets/tag/jsf/IterationIdManager.java index 601cb07be4..fd22c2578a 100644 --- a/impl/src/main/java/com/sun/faces/facelets/tag/jsf/IterationIdManager.java +++ b/impl/src/main/java/com/sun/faces/facelets/tag/jsf/IterationIdManager.java @@ -82,8 +82,13 @@ static boolean isIterating(FaceletContext context){ private static Deque> _getStackOfTrackedIds(FaceletContext ctx) { Deque> stack = (Deque>)ctx.getAttribute(_STACK_OF_TRACKED_IDS); if (stack == null) { - stack = new LinkedList<>(); - ctx.setAttribute(_STACK_OF_TRACKED_IDS, stack); + synchronized(IterationIdManager.class) { + stack = (Deque>)ctx.getAttribute(_STACK_OF_TRACKED_IDS); + if(stack == null) { + stack = new LinkedList<>(); + ctx.setAttribute(_STACK_OF_TRACKED_IDS, stack); + } + } } return stack; }