You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by gi...@apache.org on 2018/05/23 17:08:24 UTC

ant git commit: Change followlinks to followsymlinks for consistency with fileset

Repository: ant
Updated Branches:
  refs/heads/master 57edcface -> cd1ce377d


Change followlinks to followsymlinks for consistency with fileset

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

Branch: refs/heads/master
Commit: cd1ce377dc769671b46ca6e68adb604b0453b4a3
Parents: 57edcfa
Author: Gintas Grigelionis <gi...@apache.org>
Authored: Wed May 23 19:09:18 2018 +0200
Committer: Gintas Grigelionis <gi...@apache.org>
Committed: Wed May 23 19:09:18 2018 +0200

----------------------------------------------------------------------
 manual/Types/selectors.html                               |  6 +++---
 .../apache/tools/ant/types/selectors/OwnedBySelector.java | 10 +++++-----
 .../tools/ant/types/selectors/PosixGroupSelector.java     | 10 +++++-----
 .../ant/types/selectors/PosixPermissionsSelector.java     | 10 +++++-----
 .../junit/org/apache/tools/ant/DirectoryScannerTest.java  |  6 +++---
 .../tools/ant/types/selectors/OwnedBySelectorTest.java    |  2 +-
 .../tools/ant/types/selectors/PosixGroupSelectorTest.java |  2 +-
 .../ant/types/selectors/PosixPermissionsSelectorTest.java |  2 +-
 8 files changed, 24 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ant/blob/cd1ce377/manual/Types/selectors.html
----------------------------------------------------------------------
diff --git a/manual/Types/selectors.html b/manual/Types/selectors.html
index 9265298..e3d11b8 100644
--- a/manual/Types/selectors.html
+++ b/manual/Types/selectors.html
@@ -926,7 +926,7 @@
         <td>Yes</td>
       </tr>
         <tr>
-          <td>followlinks</td>
+          <td>followsymlinks</td>
           <td>Must the selector follow symbolic links?</td>
           <td>No; defaults to <q>false</q> (was <q>true</q> before Ant 1.10.4)</td>
         </tr>
@@ -953,7 +953,7 @@
         <td>Yes</td>
       </tr>
       <tr>
-        <td>followlinks</td>
+        <td>followsymlinks</td>
         <td>Must the selector follow symbolic links?</td>
         <td>No; defaults to <q>false</q></td>
       </tr>
@@ -980,7 +980,7 @@
         <td>Yes</td>
       </tr>
       <tr>
-        <td>followlinks</td>
+        <td>followsymlinks</td>
         <td>Must the selector follow symbolic links?</td>
         <td>No; defaults to <q>false</q></td>
       </tr>

http://git-wip-us.apache.org/repos/asf/ant/blob/cd1ce377/src/main/org/apache/tools/ant/types/selectors/OwnedBySelector.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/types/selectors/OwnedBySelector.java b/src/main/org/apache/tools/ant/types/selectors/OwnedBySelector.java
index cb21de4..f9c593b 100644
--- a/src/main/org/apache/tools/ant/types/selectors/OwnedBySelector.java
+++ b/src/main/org/apache/tools/ant/types/selectors/OwnedBySelector.java
@@ -42,7 +42,7 @@ public class OwnedBySelector implements FileSelector {
 
     private String owner;
 
-    private boolean followLinks = false;
+    private boolean followSymlinks = false;
 
     /**
      * Sets the user name to look for.
@@ -54,10 +54,10 @@ public class OwnedBySelector implements FileSelector {
 
     /**
      * Sets the "follow links" flag.
-     * @param followLinks the user name
+     * @param followSymlinks the user name
      */
-    public void setFollowLinks(String followLinks) {
-        this.followLinks = PropertyHelper.toBoolean(followLinks);
+    public void setFollowSymlinks(String followSymlinks) {
+        this.followSymlinks = PropertyHelper.toBoolean(followSymlinks);
     }
 
     @Override
@@ -67,7 +67,7 @@ public class OwnedBySelector implements FileSelector {
         }
         if (file != null) {
             try {
-                UserPrincipal user = followLinks ? Files.getOwner(file.toPath())
+                UserPrincipal user = followSymlinks ? Files.getOwner(file.toPath())
                         : Files.getOwner(file.toPath(), LinkOption.NOFOLLOW_LINKS);
                 return user != null && owner.equals(user.getName());
             } catch (UnsupportedOperationException | IOException ex) {

http://git-wip-us.apache.org/repos/asf/ant/blob/cd1ce377/src/main/org/apache/tools/ant/types/selectors/PosixGroupSelector.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/types/selectors/PosixGroupSelector.java b/src/main/org/apache/tools/ant/types/selectors/PosixGroupSelector.java
index a72d0fd..4dfa7ec 100644
--- a/src/main/org/apache/tools/ant/types/selectors/PosixGroupSelector.java
+++ b/src/main/org/apache/tools/ant/types/selectors/PosixGroupSelector.java
@@ -42,7 +42,7 @@ public class PosixGroupSelector implements FileSelector {
 
     private String group;
 
-    private boolean followLinks = false;
+    private boolean followSymlinks = false;
 
     /**
      * Sets the group name to look for.
@@ -54,10 +54,10 @@ public class PosixGroupSelector implements FileSelector {
 
     /**
      * Sets the "follow links" flag.
-     * @param followLinks the user name
+     * @param followSymlinks the user name
      */
-    public void setFollowLinks(String followLinks) {
-        this.followLinks = PropertyHelper.toBoolean(followLinks);
+    public void setFollowSymlinks(String followSyminks) {
+        this.followSymlinks = PropertyHelper.toBoolean(followSymlinks);
     }
 
     @Override
@@ -66,7 +66,7 @@ public class PosixGroupSelector implements FileSelector {
             throw new BuildException("the group attribute is required");
         }
         try {
-            GroupPrincipal actualGroup = followLinks ? Files.readAttributes(file.toPath(),
+            GroupPrincipal actualGroup = followSymlinks ? Files.readAttributes(file.toPath(),
                     PosixFileAttributes.class).group() : Files.readAttributes(file.toPath(),
                     PosixFileAttributes.class, LinkOption.NOFOLLOW_LINKS).group();
             return actualGroup != null && actualGroup.getName().equals(group);

http://git-wip-us.apache.org/repos/asf/ant/blob/cd1ce377/src/main/org/apache/tools/ant/types/selectors/PosixPermissionsSelector.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/types/selectors/PosixPermissionsSelector.java b/src/main/org/apache/tools/ant/types/selectors/PosixPermissionsSelector.java
index fd6cef7..bc872ed 100644
--- a/src/main/org/apache/tools/ant/types/selectors/PosixPermissionsSelector.java
+++ b/src/main/org/apache/tools/ant/types/selectors/PosixPermissionsSelector.java
@@ -41,7 +41,7 @@ public class PosixPermissionsSelector implements FileSelector {
 
     private String permissions;
 
-    private boolean followLinks = false;
+    private boolean followSymlinks = false;
 
     /**
      * Sets the permissions to look for.
@@ -64,10 +64,10 @@ public class PosixPermissionsSelector implements FileSelector {
 
     /**
      * Sets the "follow links" flag.
-     * @param followLinks the user name
+     * @param followSymlinks the user name
      */
-    public void setFollowLinks(String followLinks) {
-        this.followLinks = PropertyHelper.toBoolean(followLinks);
+    public void setFollowSymlinks(String followSymlinks) {
+        this.followSymlinks = PropertyHelper.toBoolean(followSymlinks);
     }
 
     @Override
@@ -76,7 +76,7 @@ public class PosixPermissionsSelector implements FileSelector {
             throw new BuildException("the permissions attribute is required");
         }
         try {
-            return PosixFilePermissions.toString(followLinks
+            return PosixFilePermissions.toString(followSymlinks
                     ? Files.getPosixFilePermissions(file.toPath())
                     : Files.getPosixFilePermissions(file.toPath(), LinkOption.NOFOLLOW_LINKS))
                     .equals(permissions);

http://git-wip-us.apache.org/repos/asf/ant/blob/cd1ce377/src/tests/junit/org/apache/tools/ant/DirectoryScannerTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/DirectoryScannerTest.java b/src/tests/junit/org/apache/tools/ant/DirectoryScannerTest.java
index f7874ef..6dab26c 100644
--- a/src/tests/junit/org/apache/tools/ant/DirectoryScannerTest.java
+++ b/src/tests/junit/org/apache/tools/ant/DirectoryScannerTest.java
@@ -217,14 +217,14 @@ public class DirectoryScannerTest {
     }
 
     /**
-     * Test case for setFollowLinks() and associated functionality.
+     * Test case for setFollowSymlinks() and associated functionality.
      * Only supports test on Linux at the moment because Java has
      * no real notion of symlinks built in, so an os-specfic call
      * to Runtime.exec() must be made to create a link to test against.
      * @throws InterruptedException if something goes wrong
      */
     @Test
-    public void testSetFollowLinks() throws IOException, InterruptedException {
+    public void testSetFollowSymlinks() throws IOException, InterruptedException {
         if (supportsSymlinks) {
             File dir = new File(buildRule.getProject().getBaseDir(),
                     "../../../main/org/apache/tools");
@@ -240,7 +240,7 @@ public class DirectoryScannerTest {
                 Process process = Runtime.getRuntime().exec(command);
                 assertEquals("0 return code expected for external process", 0, process.waitFor());
 
-                // followLinks should be true by default, but if this ever
+                // followSymlinks should be true by default, but if this ever
                 // changes we will need this line.
                 ds.setFollowSymlinks(true);
 

http://git-wip-us.apache.org/repos/asf/ant/blob/cd1ce377/src/tests/junit/org/apache/tools/ant/types/selectors/OwnedBySelectorTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/types/selectors/OwnedBySelectorTest.java b/src/tests/junit/org/apache/tools/ant/types/selectors/OwnedBySelectorTest.java
index e8619e4..77b31dd 100644
--- a/src/tests/junit/org/apache/tools/ant/types/selectors/OwnedBySelectorTest.java
+++ b/src/tests/junit/org/apache/tools/ant/types/selectors/OwnedBySelectorTest.java
@@ -80,7 +80,7 @@ public class OwnedBySelectorTest {
 
         s.setOwner(SELF);
         assertTrue(s.isSelected(null, null, symbolicLink.toFile()));
-        s.setFollowLinks("yes");
+        s.setFollowSymlinks("yes");
         assertFalse(s.isSelected(null, null, symbolicLink.toFile()));
     }
 }

http://git-wip-us.apache.org/repos/asf/ant/blob/cd1ce377/src/tests/junit/org/apache/tools/ant/types/selectors/PosixGroupSelectorTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/types/selectors/PosixGroupSelectorTest.java b/src/tests/junit/org/apache/tools/ant/types/selectors/PosixGroupSelectorTest.java
index 2cb0a21..f9a9d62 100644
--- a/src/tests/junit/org/apache/tools/ant/types/selectors/PosixGroupSelectorTest.java
+++ b/src/tests/junit/org/apache/tools/ant/types/selectors/PosixGroupSelectorTest.java
@@ -87,7 +87,7 @@ public class PosixGroupSelectorTest {
 
         s.setGroup(linkGroup.getName());
         assertTrue(s.isSelected(null, null, symbolicLink.toFile()));
-        s.setFollowLinks("yes");
+        s.setFollowSymlinks("yes");
         assertFalse(s.isSelected(null, null, symbolicLink.toFile()));
     }
 }

http://git-wip-us.apache.org/repos/asf/ant/blob/cd1ce377/src/tests/junit/org/apache/tools/ant/types/selectors/PosixPermissionsSelectorTest.java
----------------------------------------------------------------------
diff --git a/src/tests/junit/org/apache/tools/ant/types/selectors/PosixPermissionsSelectorTest.java b/src/tests/junit/org/apache/tools/ant/types/selectors/PosixPermissionsSelectorTest.java
index 1dde9c4..9aff3b5 100644
--- a/src/tests/junit/org/apache/tools/ant/types/selectors/PosixPermissionsSelectorTest.java
+++ b/src/tests/junit/org/apache/tools/ant/types/selectors/PosixPermissionsSelectorTest.java
@@ -125,7 +125,7 @@ public class PosixPermissionsSelectorTest {
 
             s.setPermissions(argument);
             assertFalse(s.isSelected(null, null, symbolicLink.toFile()));
-            s.setFollowLinks("yes");
+            s.setFollowSymlinks("yes");
             assertTrue(s.isSelected(null, null, symbolicLink.toFile()));
         }
     }