aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/vfs/FileSystemUtils.java
diff options
context:
space:
mode:
authorGravatar Janak Ramakrishnan <janakr@google.com>2015-07-08 17:05:43 +0000
committerGravatar Han-Wen Nienhuys <hanwen@google.com>2015-07-10 17:15:18 +0000
commit525019b7bd8810ef8401ecb80247fa4226eba8c2 (patch)
treeb2002fade0c442cd1ac0eb0f0197926d8c0b5bab /src/main/java/com/google/devtools/build/lib/vfs/FileSystemUtils.java
parenta5e5532dd3418a0c8018e7524efecdfc4402eee4 (diff)
Tolerate "..." as the base filename for the fdo profile.
This is fragile, and there might be other places in the codebase this issue occurs. -- MOS_MIGRATED_REVID=97784977
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/vfs/FileSystemUtils.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/vfs/FileSystemUtils.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/vfs/FileSystemUtils.java b/src/main/java/com/google/devtools/build/lib/vfs/FileSystemUtils.java
index 796d8286e2..6ce67aeac2 100644
--- a/src/main/java/com/google/devtools/build/lib/vfs/FileSystemUtils.java
+++ b/src/main/java/com/google/devtools/build/lib/vfs/FileSystemUtils.java
@@ -157,7 +157,10 @@ public class FileSystemUtils {
* filename string. If the basename contains no '.', the filename is returned
* unchanged.
*
- * e.g. "foo/bar.x" -> "foo/bar"
+ * <p>e.g. "foo/bar.x" -> "foo/bar"
+ *
+ * <p>Note that if the filename is composed entirely of ".", this method will return the string
+ * with one fewer ".", which may have surprising effects.
*/
@ThreadSafe
public static String removeExtension(String filename) {
@@ -176,6 +179,9 @@ public class FileSystemUtils {
* unchanged.
*
* <p>e.g. "foo/bar.x" -> "foo/bar"
+ *
+ * <p>Note that if the base filename is composed entirely of ".", this method will return the
+ * filename with one fewer "." in the base filename, which may have surprising effects.
*/
@ThreadSafe
public static PathFragment removeExtension(PathFragment path) {
@@ -188,6 +194,9 @@ public class FileSystemUtils {
* unchanged.
*
* <p>e.g. "foo/bar.x" -> "foo/bar"
+ *
+ * <p>Note that if the base filename is composed entirely of ".", this method will return the
+ * filename with one fewer "." in the base filename, which may have surprising effects.
*/
@ThreadSafe
public static Path removeExtension(Path path) {