diff options
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/actions/ActionInputMap.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/actions/ActionInputMap.java | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/actions/ActionInputMap.java b/src/main/java/com/google/devtools/build/lib/actions/ActionInputMap.java index c938b07419..09014fe25a 100644 --- a/src/main/java/com/google/devtools/build/lib/actions/ActionInputMap.java +++ b/src/main/java/com/google/devtools/build/lib/actions/ActionInputMap.java @@ -14,15 +14,14 @@ package com.google.devtools.build.lib.actions; import com.google.common.base.Preconditions; -import com.google.devtools.build.lib.actions.cache.Metadata; import java.util.Arrays; import javax.annotation.Nullable; /** * Helper for {@link MetadataProvider} implementations. * - * <p>Allows {@link Metadata} lookups by exec path or {@link ActionInput}. <i>Also</i> allows {@link - * ActionInput} to be looked up by exec path. + * <p>Allows {@link FileArtifactValue} lookups by exec path or {@link ActionInput}. <i>Also</i> + * allows {@link ActionInput} to be looked up by exec path. * * <p>This class is thread-compatible. */ @@ -30,7 +29,7 @@ public final class ActionInputMap implements MetadataProvider { /** * {@link ActionInput} keys stored in even indices * - * <p>{@link Metadata} values stored in odd indices + * <p>{@link FileArtifactValue} values stored in odd indices */ private Object[] data; @@ -55,19 +54,19 @@ public final class ActionInputMap implements MetadataProvider { @Nullable @Override - public Metadata getMetadata(ActionInput input) { + public FileArtifactValue getMetadata(ActionInput input) { return getMetadata(input.getExecPathString()); } @Nullable - public Metadata getMetadata(String execPathString) { + public FileArtifactValue getMetadata(String execPathString) { int hashCode = execPathString.hashCode(); int probe = getProbe(hashCode); ActionInput nextKey; while ((nextKey = (ActionInput) data[probe]) != null) { if (hashCode == nextKey.getExecPathString().hashCode() && nextKey.getExecPathString().equals(execPathString)) { - return (Metadata) data[probe + 1]; + return (FileArtifactValue) data[probe + 1]; } probe = incProbe(probe); } @@ -96,7 +95,7 @@ public final class ActionInputMap implements MetadataProvider { } /** @return true if an entry was added, false if the map already contains {@code input} */ - public boolean put(ActionInput input, Metadata metadata) { + public boolean put(ActionInput input, FileArtifactValue metadata) { Preconditions.checkNotNull(input); if (size * 4 >= data.length) { resize(); @@ -119,7 +118,7 @@ public final class ActionInputMap implements MetadataProvider { for (int i = 0; i < oldData.length; i += 2) { ActionInput key = (ActionInput) oldData[i]; if (key != null) { - Metadata value = (Metadata) oldData[i + 1]; + FileArtifactValue value = (FileArtifactValue) oldData[i + 1]; putImpl(key, value); } } @@ -131,7 +130,7 @@ public final class ActionInputMap implements MetadataProvider { * * <p>REQUIRES: there are free positions in {@link data}. */ - private boolean putImpl(ActionInput key, Metadata value) { + private boolean putImpl(ActionInput key, FileArtifactValue value) { int hashCode = key.getExecPathString().hashCode(); int probe = getProbe(hashCode); while (true) { |