You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by st...@apache.org on 2023/02/06 18:28:47 UTC
[hadoop] branch trunk updated: HADOOP-18612. Avoid mixing canonical and non-canonical when performing comparisons (#5339)
This is an automated email from the ASF dual-hosted git repository.
stevel pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/trunk by this push:
new 5f5157ac536 HADOOP-18612. Avoid mixing canonical and non-canonical when performing comparisons (#5339)
5f5157ac536 is described below
commit 5f5157ac536388f559361b8df012a7960d19050f
Author: Steve Vaughan <em...@stevevaughan.me>
AuthorDate: Mon Feb 6 13:28:29 2023 -0500
HADOOP-18612. Avoid mixing canonical and non-canonical when performing comparisons (#5339)
Contributed by Steve Vaughan Jr
---
.../src/test/java/org/apache/hadoop/fs/TestFileUtil.java | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestFileUtil.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestFileUtil.java
index c884e223365..94d90b2eb97 100644
--- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestFileUtil.java
+++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestFileUtil.java
@@ -1321,16 +1321,16 @@ public class TestFileUtil {
if (wildcardPath.equals(classPath)) {
// add wildcard matches
for (File wildcardMatch: wildcardMatches) {
- expectedClassPaths.add(wildcardMatch.toURI().toURL()
+ expectedClassPaths.add(wildcardMatch.getCanonicalFile().toURI().toURL()
.toExternalForm());
}
} else {
File fileCp = null;
if(!new Path(classPath).isAbsolute()) {
- fileCp = new File(tmp, classPath);
+ fileCp = new File(tmp, classPath).getCanonicalFile();
}
else {
- fileCp = new File(classPath);
+ fileCp = new File(classPath).getCanonicalFile();
}
if (nonExistentSubdir.equals(classPath)) {
// expect to maintain trailing path separator if present in input, even
@@ -1385,7 +1385,8 @@ public class TestFileUtil {
for (Path jar: jars) {
URL url = jar.toUri().toURL();
assertTrue("the jar should match either of the jars",
- url.equals(jar1.toURI().toURL()) || url.equals(jar2.toURI().toURL()));
+ url.equals(jar1.getCanonicalFile().toURI().toURL()) ||
+ url.equals(jar2.getCanonicalFile().toURI().toURL()));
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org