From 89eaee567429b559ca9983fff146ae60477688ad Mon Sep 17 00:00:00 2001 From: tomlu Date: Mon, 15 Jan 2018 17:40:35 -0800 Subject: Remove use of Root#asDerivedRoot where the derived root == exec root. This method violates the invariant that derived roots are never equal to the exec root. Only source roots can be equal to the exec root. Note that this method was only used in tests, so this CL should be completely safe as long as its tests pass. PiperOrigin-RevId: 181998483 --- .../com/google/devtools/build/lib/rules/objc/J2ObjcSourceTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/test/java/com/google/devtools/build/lib/rules/objc/J2ObjcSourceTest.java') diff --git a/src/test/java/com/google/devtools/build/lib/rules/objc/J2ObjcSourceTest.java b/src/test/java/com/google/devtools/build/lib/rules/objc/J2ObjcSourceTest.java index 3e413f5c6b..043476ed4a 100644 --- a/src/test/java/com/google/devtools/build/lib/rules/objc/J2ObjcSourceTest.java +++ b/src/test/java/com/google/devtools/build/lib/rules/objc/J2ObjcSourceTest.java @@ -20,6 +20,7 @@ import com.google.devtools.build.lib.actions.Artifact; import com.google.devtools.build.lib.actions.Root; import com.google.devtools.build.lib.cmdline.Label; import com.google.devtools.build.lib.testutil.Scratch; +import com.google.devtools.build.lib.vfs.Path; import com.google.devtools.build.lib.vfs.PathFragment; import org.junit.Before; import org.junit.Test; @@ -36,7 +37,8 @@ public class J2ObjcSourceTest { @Before public final void setRootDir() throws Exception { Scratch scratch = new Scratch(); - rootDir = Root.asDerivedRoot(scratch.dir("/exec/root")); + Path execRoot = scratch.getFileSystem().getPath("/exec"); + rootDir = Root.asDerivedRoot(execRoot, scratch.dir("/exec/root")); } @Test -- cgit v1.2.3