Arun Manni created WW-5646:
------------------------------
Summary: Modernize path normalization in Include component
Key: WW-5646
URL: https://issues.apache.org/jira/browse/WW-5646
Project: Struts 2
Issue Type: Improvement
Components: Core
Affects Versions: 7.2.1
Reporter: Arun Manni
Include.getContextRelativePath() uses java.util.Stack for path
normalization. Stack is a legacy class (extends synchronized Vector)
and is unnecessary for a local variable. The method also does not
handle the edge case where dot-dot segments exceed the available
path depth, which can cause an EmptyStackException.
This patch replaces Stack with ArrayDeque, adds an isEmpty() guard
before pop(), and modernizes the iteration to use an enhanced
for-loop. Test coverage added for edge case paths.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)