Remove unused 'followSymlinks' parameter to FileSystem#getxattr. It is always true in practice.
--
MOS_MIGRATED_REVID=103221081
diff --git a/src/main/java/com/google/devtools/build/lib/vfs/FileSystem.java b/src/main/java/com/google/devtools/build/lib/vfs/FileSystem.java
index 7004345..fc5a9e8 100644
--- a/src/main/java/com/google/devtools/build/lib/vfs/FileSystem.java
+++ b/src/main/java/com/google/devtools/build/lib/vfs/FileSystem.java
@@ -206,7 +206,7 @@
/**
* Returns value of the given extended attribute name or null if attribute
- * does not exist or file system does not support extended attributes.
+ * does not exist or file system does not support extended attributes. Follows symlinks.
* <p>Default implementation assumes that file system does not support
* extended attributes and always returns null. Specific file system
* implementations should override this method if they do provide support
@@ -219,7 +219,7 @@
* system does not support extended attributes at all.
* @throws IOException if the call failed for any other reason.
*/
- protected byte[] getxattr(Path path, String name, boolean followSymlinks) throws IOException {
+ protected byte[] getxattr(Path path, String name) throws IOException {
return null;
}
diff --git a/src/main/java/com/google/devtools/build/lib/vfs/Path.java b/src/main/java/com/google/devtools/build/lib/vfs/Path.java
index 32953b8..38a29ac 100644
--- a/src/main/java/com/google/devtools/build/lib/vfs/Path.java
+++ b/src/main/java/com/google/devtools/build/lib/vfs/Path.java
@@ -898,7 +898,7 @@
* file system does not support extended attributes. Follows symlinks.
*/
public byte[] getxattr(String name) throws IOException {
- return fileSystem.getxattr(this, name, true);
+ return fileSystem.getxattr(this, name);
}
/**
diff --git a/src/main/java/com/google/devtools/build/lib/vfs/UnionFileSystem.java b/src/main/java/com/google/devtools/build/lib/vfs/UnionFileSystem.java
index d2d9c00..96fc6cf 100644
--- a/src/main/java/com/google/devtools/build/lib/vfs/UnionFileSystem.java
+++ b/src/main/java/com/google/devtools/build/lib/vfs/UnionFileSystem.java
@@ -368,9 +368,9 @@
}
@Override
- protected byte[] getxattr(Path path, String name, boolean followSymlinks) throws IOException {
+ protected byte[] getxattr(Path path, String name) throws IOException {
FileSystem delegate = getDelegate(path);
- return delegate.getxattr(adjustPath(path, delegate), name, followSymlinks);
+ return delegate.getxattr(adjustPath(path, delegate), name);
}
@Override
diff --git a/src/main/java/com/google/devtools/build/lib/vfs/UnixFileSystem.java b/src/main/java/com/google/devtools/build/lib/vfs/UnixFileSystem.java
index 9a80e75..2a86b22 100644
--- a/src/main/java/com/google/devtools/build/lib/vfs/UnixFileSystem.java
+++ b/src/main/java/com/google/devtools/build/lib/vfs/UnixFileSystem.java
@@ -391,12 +391,11 @@
}
@Override
- protected byte[] getxattr(Path path, String name, boolean followSymlinks) throws IOException {
+ protected byte[] getxattr(Path path, String name) throws IOException {
String pathName = path.toString();
long startTime = Profiler.nanoTimeMaybe();
try {
- return followSymlinks
- ? FilesystemUtils.getxattr(pathName, name) : FilesystemUtils.lgetxattr(pathName, name);
+ return FilesystemUtils.getxattr(pathName, name);
} catch (UnsupportedOperationException e) {
// getxattr() syscall is not supported by the underlying filesystem (it returned ENOTSUP).
// Per method contract, treat this as ENODATA.
diff --git a/src/test/java/com/google/devtools/build/lib/vfs/UnionFileSystemTest.java b/src/test/java/com/google/devtools/build/lib/vfs/UnionFileSystemTest.java
index 396a9f8..e9b54ac 100644
--- a/src/test/java/com/google/devtools/build/lib/vfs/UnionFileSystemTest.java
+++ b/src/test/java/com/google/devtools/build/lib/vfs/UnionFileSystemTest.java
@@ -322,7 +322,7 @@
}
@Override
- protected byte[] getxattr(Path path, String name, boolean followSymlinks) {
+ protected byte[] getxattr(Path path, String name) {
assertSame(this, path.getFileSystem());
return (name.equals(XATTR_KEY)) ? XATTR_VAL.getBytes(UTF_8) : null;
}