aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/skyframe/PrepareDepsOfPatternValue.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/skyframe/PrepareDepsOfPatternValue.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/skyframe/PrepareDepsOfPatternValue.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/PrepareDepsOfPatternValue.java b/src/main/java/com/google/devtools/build/lib/skyframe/PrepareDepsOfPatternValue.java
index fe7a0da76b..9ffac75455 100644
--- a/src/main/java/com/google/devtools/build/lib/skyframe/PrepareDepsOfPatternValue.java
+++ b/src/main/java/com/google/devtools/build/lib/skyframe/PrepareDepsOfPatternValue.java
@@ -32,7 +32,7 @@ import java.util.List;
* invoked only for its side effect (i.e. ensuring the graph contains targets matching the
* pattern and its transitive dependencies), this value carries no information.
*
- * <p>Because the returned value is always the same object, this value and the
+ * <p>Because the returned value is always equal to objects that share its type, this value and the
* {@link PrepareDepsOfPatternFunction} which computes it are incompatible with change pruning. It
* should only be requested by consumers who do not require reevaluation when
* {@link PrepareDepsOfPatternFunction} is reevaluated. Safe consumers include, e.g., top-level
@@ -40,11 +40,23 @@ import java.util.List;
* side-effects.
*/
public class PrepareDepsOfPatternValue implements SkyValue {
+ // Note that this value does not guarantee singleton-like reference equality because we use Java
+ // deserialization. Java deserialization can create other instances.
public static final PrepareDepsOfPatternValue INSTANCE = new PrepareDepsOfPatternValue();
private PrepareDepsOfPatternValue() {
}
+ @Override
+ public boolean equals(Object o) {
+ return o instanceof PrepareDepsOfPatternValue;
+ }
+
+ @Override
+ public int hashCode() {
+ return 42;
+ }
+
/**
* Returns an iterable of {@link PrepareDepsOfPatternSkyKeyOrException}, with {@link
* TargetPatternKey} arguments. Negative target patterns of type other than {@link