[
https://issues.apache.org/jira/browse/HADOOP-16226?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Akira Ajisaka updated HADOOP-16226:
-----------------------------------
Description:
new Path(String str) calls Path.normalizePath to normalize the str, however, it
does not remove all the slashes of the str.
{code:title=Path.java}
/**
* Normalize a path string to use non-duplicated forward slashes as
* the path separator and remove any trailing path separators.
*
* @param scheme the URI scheme. Used to deduce whether we
* should replace backslashes or not
* @param path the scheme-specific part
* @return the normalized path string
*/
private static String normalizePath(String scheme, String path) {
{code}
Javadoc says "remove any trailing path separators", but it removes only one
trailing slash.
Credit: This issue was found by [~ayushtkn] in HDFS-14369.
was:
new Path(String str) calls Path.normalizePath to normalize the str, however, it
does not remove all the slashes of the str.
{code:title=Path.java}
/**
* Normalize a path string to use non-duplicated forward slashes as
* the path separator and remove any trailing path separators.
*
* @param scheme the URI scheme. Used to deduce whether we
* should replace backslashes or not
* @param path the scheme-specific part
* @return the normalized path string
*/
private static String normalizePath(String scheme, String path) {
{code}
Javadoc tells "remove any trailing path separators", but it removes only one
trailing slash.
Credit: This issue was found by [~ayushtkn] in HDFS-14369.
> new Path(String str) does not remove all the trailing slashes of str
> --------------------------------------------------------------------
>
> Key: HADOOP-16226
> URL: https://issues.apache.org/jira/browse/HADOOP-16226
> Project: Hadoop Common
> Issue Type: Bug
> Components: fs
> Reporter: Akira Ajisaka
> Priority: Minor
>
> new Path(String str) calls Path.normalizePath to normalize the str, however,
> it does not remove all the slashes of the str.
> {code:title=Path.java}
> /**
> * Normalize a path string to use non-duplicated forward slashes as
> * the path separator and remove any trailing path separators.
> *
> * @param scheme the URI scheme. Used to deduce whether we
> * should replace backslashes or not
> * @param path the scheme-specific part
> * @return the normalized path string
> */
> private static String normalizePath(String scheme, String path) {
> {code}
> Javadoc says "remove any trailing path separators", but it removes only one
> trailing slash.
> Credit: This issue was found by [~ayushtkn] in HDFS-14369.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]