Rollback of commit e0d7a540e3c615c628f63fcaaaba0c47fca2cb25.
*** Reason for rollback ***
Suspected root cause for Windows bootstrap on Bazel CI breakage:
java.lang.NullPointerException
at com.google.devtools.build.lib.vfs.Path$1.run(Path.java:123)
http://ci.bazel.io/view/Bazel%20bootstrap%20and%20maintenance/job/Bazel/922/JAVA_VERSION=1.8,PLATFORM_NAME=windows-x86_64/console
*** Original change description ***
VFS: implement a Windows-specific Path subclass
The new subclass WindowsFileSystem.WindowsPath is
aware of Windows drives.
This change:
- introduces a new factory for Path objects so
FileSystems can return a custom implementation
that instantiates filesystem-specific Paths
- implements the WindowsPath subclass of Path that
is aware of Windows drives
- introduces the bazel.windows_unix_root JVM
argument that defines the MSYS root, which
defines the absolute Windows path that is the...
***
--
MOS_MIGRATED_REVID=136583352
diff --git a/src/test/java/com/google/devtools/build/lib/vfs/PathFragmentTest.java b/src/test/java/com/google/devtools/build/lib/vfs/PathFragmentTest.java
index c4ac7c1..2a41b10 100644
--- a/src/test/java/com/google/devtools/build/lib/vfs/PathFragmentTest.java
+++ b/src/test/java/com/google/devtools/build/lib/vfs/PathFragmentTest.java
@@ -26,13 +26,15 @@
import com.google.common.testing.EqualsTester;
import com.google.devtools.build.lib.testutil.TestUtils;
import com.google.devtools.build.lib.vfs.inmemoryfs.InMemoryFileSystem;
-import java.io.File;
-import java.util.Collections;
-import java.util.List;
+
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
+import java.io.File;
+import java.util.Collections;
+import java.util.List;
+
/**
* This class tests the functionality of the PathFragment.
*/
@@ -67,16 +69,15 @@
InMemoryFileSystem filesystem = new InMemoryFileSystem();
new EqualsTester()
- .addEqualityGroup(
- new PathFragment("../relative/path"),
- new PathFragment("..").getRelative("relative").getRelative("path"),
- new PathFragment('\0', false, new String[] {"..", "relative", "path"}),
- new PathFragment(new File("../relative/path")))
+ .addEqualityGroup(new PathFragment("../relative/path"),
+ new PathFragment("../relative/path"),
+ new PathFragment(new File("../relative/path")))
.addEqualityGroup(new PathFragment("something/else"))
.addEqualityGroup(new PathFragment("/something/else"))
- .addEqualityGroup(new PathFragment("/"), new PathFragment("//////"))
- .addEqualityGroup(new PathFragment(""), PathFragment.EMPTY_FRAGMENT)
- .addEqualityGroup(filesystem.getRootDirectory()) // A Path object.
+ .addEqualityGroup(new PathFragment("/"),
+ new PathFragment("//////"))
+ .addEqualityGroup(new PathFragment(""))
+ .addEqualityGroup(filesystem.getRootDirectory()) // A Path object.
.testEquals();
}