Rename ActionExecutionValue#createSimpleFileArtifactValue and make it an instance method.
The name of the method is misleading because it doesn't create anything new, just gets it from a map. It also asserts that it exists, so rename it to getExistingFileArtifactValue.
Also, make it an instance method. A static method that requires passing in an instance of the class seems awkward.
RELNOTES: None.
PiperOrigin-RevId: 312712401
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/ActionInputMapHelper.java b/src/main/java/com/google/devtools/build/lib/skyframe/ActionInputMapHelper.java
index 9e15389..9c7a570 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/ActionInputMapHelper.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/ActionInputMapHelper.java
@@ -22,6 +22,8 @@
import com.google.devtools.build.lib.actions.ActionLookupValue;
import com.google.devtools.build.lib.actions.ActionLookupValue.ActionLookupKey;
import com.google.devtools.build.lib.actions.Artifact;
+import com.google.devtools.build.lib.actions.Artifact.DerivedArtifact;
+import com.google.devtools.build.lib.actions.Artifact.SpecialArtifact;
import com.google.devtools.build.lib.actions.FileArtifactValue;
import com.google.devtools.build.lib.actions.FilesetOutputSymlink;
import com.google.devtools.build.lib.analysis.actions.SymlinkAction;
@@ -51,7 +53,7 @@
inputMap.put(artifact, entry.second, /*depOwner=*/ key);
if (artifact.isFileset()) {
ImmutableList<FilesetOutputSymlink> expandedFileset =
- getFilesets(env, (Artifact.SpecialArtifact) artifact);
+ getFilesets(env, (SpecialArtifact) artifact);
if (expandedFileset != null) {
filesetsInsideRunfiles.put(artifact, expandedFileset);
}
@@ -87,11 +89,10 @@
} else if (value instanceof ActionExecutionValue) {
inputMap.put(
key,
- ActionExecutionValue.createSimpleFileArtifactValue(
- (Artifact.DerivedArtifact) key, (ActionExecutionValue) value),
+ ((ActionExecutionValue) value).getExistingFileArtifactValue((DerivedArtifact) key),
key);
if (key.isFileset()) {
- topLevelFilesets.put(key, getFilesets(env, (Artifact.SpecialArtifact) key));
+ topLevelFilesets.put(key, getFilesets(env, (SpecialArtifact) key));
}
} else {
Preconditions.checkState(value instanceof FileArtifactValue);
@@ -100,7 +101,7 @@
}
static ImmutableList<FilesetOutputSymlink> getFilesets(
- Environment env, Artifact.SpecialArtifact actionInput) throws InterruptedException {
+ Environment env, SpecialArtifact actionInput) throws InterruptedException {
Preconditions.checkState(actionInput.isFileset(), actionInput);
ActionLookupData generatingActionKey = actionInput.getGeneratingActionKey();
ActionLookupKey filesetActionLookupKey = generatingActionKey.getActionLookupKey();
@@ -113,8 +114,8 @@
ActionLookupData filesetActionKey;
if (generatingAction instanceof SymlinkAction) {
- Artifact.DerivedArtifact outputManifest =
- (Artifact.DerivedArtifact) generatingAction.getInputs().getSingleton();
+ DerivedArtifact outputManifest =
+ (DerivedArtifact) generatingAction.getInputs().getSingleton();
ActionLookupData manifestGeneratingKey = outputManifest.getGeneratingActionKey();
Preconditions.checkState(
manifestGeneratingKey.getActionLookupKey().equals(filesetActionLookupKey),
@@ -125,8 +126,8 @@
manifestGeneratingKey);
ActionAnalysisMetadata symlinkTreeAction =
filesetActionLookupValue.getAction(manifestGeneratingKey.getActionIndex());
- Artifact.DerivedArtifact inputManifest =
- (Artifact.DerivedArtifact) symlinkTreeAction.getInputs().getSingleton();
+ DerivedArtifact inputManifest =
+ (DerivedArtifact) symlinkTreeAction.getInputs().getSingleton();
ActionLookupData inputManifestGeneratingKey = inputManifest.getGeneratingActionKey();
Preconditions.checkState(
inputManifestGeneratingKey.getActionLookupKey().equals(filesetActionLookupKey),