aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/vfs/inmemoryfs/InMemoryFileSystem.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/vfs/inmemoryfs/InMemoryFileSystem.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/vfs/inmemoryfs/InMemoryFileSystem.java22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/vfs/inmemoryfs/InMemoryFileSystem.java b/src/main/java/com/google/devtools/build/lib/vfs/inmemoryfs/InMemoryFileSystem.java
index a83d6ab047..504cf21c5b 100644
--- a/src/main/java/com/google/devtools/build/lib/vfs/inmemoryfs/InMemoryFileSystem.java
+++ b/src/main/java/com/google/devtools/build/lib/vfs/inmemoryfs/InMemoryFileSystem.java
@@ -13,7 +13,6 @@
// limitations under the License.
package com.google.devtools.build.lib.vfs.inmemoryfs;
-import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import com.google.devtools.build.lib.clock.Clock;
@@ -59,23 +58,33 @@ public class InMemoryFileSystem extends FileSystem {
// Maximum number of traversals before ELOOP is thrown.
private static final int MAX_TRAVERSALS = 256;
- // TODO(b/109764197): Remove the no-arg constructor from Jadep and then remove it here.
- @VisibleForTesting
+ /**
+ * Creates a new InMemoryFileSystem with scope checking disabled (all paths are considered to be
+ * within scope) and a default clock.
+ */
public InMemoryFileSystem() {
- this(new JavaClock(), DigestHashFunction.MD5);
+ this(new JavaClock());
}
/**
* Creates a new InMemoryFileSystem with scope checking disabled (all paths are considered to be
* within scope) and a default clock.
*
- * @param hashFunction
+ * @param hashFunction the function to use for calculating digests.
*/
public InMemoryFileSystem(DigestHashFunction hashFunction) {
this(new JavaClock(), hashFunction);
}
/**
+ * Creates a new InMemoryFileSystem with scope checking disabled (all
+ * paths are considered to be within scope).
+ */
+ public InMemoryFileSystem(Clock clock) {
+ this(clock, (PathFragment) null);
+ }
+
+ /**
* Creates a new InMemoryFileSystem with scope checking disabled (all paths are considered to be
* within scope).
*/
@@ -90,8 +99,7 @@ public class InMemoryFileSystem extends FileSystem {
* Creates a new InMemoryFileSystem with scope checking bound to scopeRoot, i.e. any path that's
* not below scopeRoot is considered to be out of scope.
*/
- public InMemoryFileSystem(Clock clock, PathFragment scopeRoot, DigestHashFunction hashFunction) {
- super(hashFunction);
+ public InMemoryFileSystem(Clock clock, PathFragment scopeRoot) {
this.scopeRoot = scopeRoot;
this.clock = clock;
this.rootInode = newRootInode(clock);