When add a unit test for method "cleanPath" of Strings in elasticsearch/common package, the test results turn out to be far from its function description:
Normalize the path by suppressing sequences like ""path/.."and inner simple dots
--that means path like "/root/../home" would be suppressed as path "/home", but actually the test case failed.
--the below example original paths would be suppressed as the Expected normalized path, but actually not:
Original Expetced: Actual:
"/root//home" "/root/home" "/root//home"
"/root/../home" "/home" "/root/../home"
"/root/../home" "home" "/root/../home"
"file:./root/../home/elk" "file:home/elk" "file:./root/../home/elk"
Some common util classes and methods deserve more attention : )