Skip to content

Commit

Permalink
Fix even more fallout of bazelbuild@f7eee1e .
Browse files Browse the repository at this point in the history
RELNOTES: None.
PiperOrigin-RevId: 261161639
  • Loading branch information
lberki authored and copybara-github committed Aug 1, 2019
1 parent 574153b commit 90a55a9
Showing 1 changed file with 21 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -478,14 +478,22 @@ public long getModifiedTime() {
@Override
public String toString() {
return MoreObjects.toStringHelper(this)
.add("digest", BaseEncoding.base16().lowerCase().encode(digest))
.add(
"digest",
digest == null ? "(null)" : BaseEncoding.base16().lowerCase().encode(digest))
.add("size", size)
.add("proxy", proxy)
.toString();
}

@Override
public boolean couldBeModifiedSince(FileArtifactValue o) {
if (digest != null && o.getDigest() != null) {
// TODO(lberki): This sometimes compares between RemoteFileArtifactValue and
// RegularFileArtifactValue. Pretty unintuitive, that.
return !Arrays.equals(digest, o.getDigest()) || getSize() != o.getSize();
}

if (!(o instanceof RegularFileArtifactValue)) {
return true;
}
Expand All @@ -495,11 +503,7 @@ public boolean couldBeModifiedSince(FileArtifactValue o) {
return true;
}

if (digest != null && lastKnown.digest != null) {
return !Arrays.equals(digest, lastKnown.digest);
} else {
return !Objects.equals(proxy, lastKnown.proxy);
}
return !Objects.equals(proxy, lastKnown.proxy);
}

@Override
Expand Down Expand Up @@ -564,6 +568,17 @@ public FileContentsProxy getContentsProxy() {
throw new UnsupportedOperationException();
}

@Override
public boolean couldBeModifiedSince(FileArtifactValue o) {
if (digest != null && o.getDigest() != null) {
// TODO(lberki): This sometimes compares between RemoteFileArtifactValue and
// RegularFileArtifactValue. Pretty unintuitive, that.
return !Arrays.equals(digest, o.getDigest()) || getSize() != o.getSize();
}

return true;
}

@Override
public long getSize() {
return size;
Expand Down

0 comments on commit 90a55a9

Please sign in to comment.