HADOOP-13976. Path globbing does not match newlines. Contributed by Eric Badger.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/706d630e
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/706d630e
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/706d630e

Branch: refs/heads/YARN-2915
Commit: 706d630eb9db9658083d57d1d99b6a0f11cc5657
Parents: 695f110
Author: Kihwal Lee <kih...@apache.org>
Authored: Tue Jan 17 15:10:24 2017 -0600
Committer: Kihwal Lee <kih...@apache.org>
Committed: Tue Jan 17 15:10:24 2017 -0600

----------------------------------------------------------------------
 .../src/main/java/org/apache/hadoop/fs/GlobPattern.java      | 2 +-
 .../src/test/java/org/apache/hadoop/fs/TestGlobPattern.java  | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/706d630e/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/GlobPattern.java
----------------------------------------------------------------------
diff --git 
a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/GlobPattern.java
 
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/GlobPattern.java
index 16505a6..c5cf3d2 100644
--- 
a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/GlobPattern.java
+++ 
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/GlobPattern.java
@@ -153,7 +153,7 @@ public class GlobPattern {
     if (curlyOpen > 0) {
       error("Unclosed group", glob, len);
     }
-    compiled = Pattern.compile(regex.toString());
+    compiled = Pattern.compile(regex.toString(), Pattern.DOTALL);
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/hadoop/blob/706d630e/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestGlobPattern.java
----------------------------------------------------------------------
diff --git 
a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestGlobPattern.java
 
b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestGlobPattern.java
index 356c442..99cb645 100644
--- 
a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestGlobPattern.java
+++ 
b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/TestGlobPattern.java
@@ -50,11 +50,11 @@ public class TestGlobPattern {
   }
 
   @Test public void testValidPatterns() {
-    assertMatch(true, "*", "^$", "foo", "bar");
+    assertMatch(true, "*", "^$", "foo", "bar", "\n");
     assertMatch(true, "?", "?", "^", "[", "]", "$");
-    assertMatch(true, "foo*", "foo", "food", "fool");
-    assertMatch(true, "f*d", "fud", "food");
-    assertMatch(true, "*d", "good", "bad");
+    assertMatch(true, "foo*", "foo", "food", "fool", "foo\n", "foo\nbar");
+    assertMatch(true, "f*d", "fud", "food", "foo\nd");
+    assertMatch(true, "*d", "good", "bad", "\nd");
     assertMatch(true, "\\*\\?\\[\\{\\\\", "*?[{\\");
     assertMatch(true, "[]^-]", "]", "-", "^");
     assertMatch(true, "]", "]");


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-commits-h...@hadoop.apache.org

Reply via email to