brahmareddybattula commented on a change in pull request #3217:
URL: https://github.com/apache/hadoop/pull/3217#discussion_r682650919
##########
File path:
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/Path.java
##########
@@ -199,8 +199,14 @@ public Path(String pathString) throws
IllegalArgumentException {
int start = 0;
// parse uri scheme, if any
- int colon = pathString.indexOf(':');
- int slash = pathString.indexOf('/');
+ int colon = -1;
+ int slash = -1;
Review comment:
I think, we no need to declare slash as this we dn't change.
##########
File path:
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/Path.java
##########
@@ -199,8 +199,14 @@ public Path(String pathString) throws
IllegalArgumentException {
int start = 0;
// parse uri scheme, if any
- int colon = pathString.indexOf(':');
- int slash = pathString.indexOf('/');
+ int colon = -1;
+ int slash = -1;
+ if (StringUtils.countMatches(pathString, ":") > 2) {
Review comment:
May be we can comment this, why we have doe like this.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]