diff options
author | 2018-07-23 17:14:17 -0700 | |
---|---|---|
committer | 2018-07-23 17:16:19 -0700 | |
commit | 63c171169299bab5128304e79b3b1b9b36048ce3 (patch) | |
tree | d65b27492e25e089b86f26cece7b3d2ad0a18227 /src/main/java/com | |
parent | 13a03b7cea381fabcf1d6fdc7e183ec127ccca85 (diff) |
ArtifactFactory.getSourceArtifact returns SourceArtifact.
PiperOrigin-RevId: 205751282
Diffstat (limited to 'src/main/java/com')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/actions/ArtifactFactory.java | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/actions/ArtifactFactory.java b/src/main/java/com/google/devtools/build/lib/actions/ArtifactFactory.java index dad4779b81..aff7b83f02 100644 --- a/src/main/java/com/google/devtools/build/lib/actions/ArtifactFactory.java +++ b/src/main/java/com/google/devtools/build/lib/actions/ArtifactFactory.java @@ -17,6 +17,7 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; import com.google.common.util.concurrent.Striped; +import com.google.devtools.build.lib.actions.Artifact.SourceArtifact; import com.google.devtools.build.lib.actions.Artifact.SpecialArtifactType; import com.google.devtools.build.lib.cmdline.PackageIdentifier; import com.google.devtools.build.lib.cmdline.RepositoryName; @@ -163,26 +164,27 @@ public class ArtifactFactory implements ArtifactResolver { } @Override - public Artifact getSourceArtifact(PathFragment execPath, Root root, ArtifactOwner owner) { + public SourceArtifact getSourceArtifact(PathFragment execPath, Root root, ArtifactOwner owner) { Preconditions.checkArgument( execPath.isAbsolute() == root.isAbsolute(), "%s %s %s", execPath, root, owner); Preconditions.checkNotNull(owner, "%s %s", execPath, root); Preconditions.checkNotNull( sourceArtifactRoots, "Not initialized for %s %s %s", execPath, root, owner); - return getArtifact( - Preconditions.checkNotNull( - sourceArtifactRoots.get(root), - "%s has no ArtifactRoot (%s) in %s", - root, + return (SourceArtifact) + getArtifact( + Preconditions.checkNotNull( + sourceArtifactRoots.get(root), + "%s has no ArtifactRoot (%s) in %s", + root, + execPath, + sourceArtifactRoots), execPath, - sourceArtifactRoots), - execPath, - owner, - null); + owner, + null); } @Override - public Artifact getSourceArtifact(PathFragment execPath, Root root) { + public SourceArtifact getSourceArtifact(PathFragment execPath, Root root) { return getSourceArtifact(execPath, root, ArtifactOwner.NullArtifactOwner.INSTANCE); } |