LPS-50484 PortalImpl.getUniqueElementId() may end up in endless loop, because it isn't thread safe

Hi Shuyang,

I'm aware of that you may be still on paternity leave. Congratulations! :)

Basically I've wanted to create a general solution for the problem and thought that creating the shared hashmap for WebKeys.UNIQUE_ELEMENT_IDS in RuntimePageImpl just before parallel rendering start, would hurt the principle of single responsibility.

In RestrictPortletServletRequest I created a new method setAttributeIfAbsent() which has similar semantics as ConcurrentMap.putIfAbsent() has.

This way setAttributeIfAbsent() initializes the request attribute atomically and if there have been a value added for the very same attribute name, it returns the original one.

Please let me know if you have any concerns about this solution.

Thanks for reviewing!

Cheers,
László