aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/java/com/google/devtools/build/skyframe/GraphTester.java
diff options
context:
space:
mode:
authorGravatar Eric Fellheimer <felly@google.com>2015-11-19 02:16:24 +0000
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2015-11-19 10:04:36 +0000
commit26b3d8532cda8e38244b33222935e5c478d25ad0 (patch)
tree85becd59cc73bbcff56365a59fb41bfaf24c1b3c /src/test/java/com/google/devtools/build/skyframe/GraphTester.java
parent3ac42bf4a979c96e73fd79fb8f5416ae7d7621eb (diff)
Allow SkyValues to be marked not "comparable". Such values are not compared for the purpose of change pruning.
-- MOS_MIGRATED_REVID=108203369
Diffstat (limited to 'src/test/java/com/google/devtools/build/skyframe/GraphTester.java')
-rw-r--r--src/test/java/com/google/devtools/build/skyframe/GraphTester.java20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/test/java/com/google/devtools/build/skyframe/GraphTester.java b/src/test/java/com/google/devtools/build/skyframe/GraphTester.java
index 2d44e9ddc5..2a3fc1b4af 100644
--- a/src/test/java/com/google/devtools/build/skyframe/GraphTester.java
+++ b/src/test/java/com/google/devtools/build/skyframe/GraphTester.java
@@ -291,7 +291,7 @@ public class GraphTester {
* Simple value class that stores strings.
*/
public static class StringValue implements SkyValue {
- private final String value;
+ protected final String value;
public StringValue(String value) {
this.value = value;
@@ -329,6 +329,24 @@ public class GraphTester {
}
}
+ /** A StringValue that is also a NotComparableSkyValue. */
+ public static class NotComparableStringValue extends StringValue
+ implements NotComparableSkyValue {
+ public NotComparableStringValue(String value) {
+ super(value);
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ throw new UnsupportedOperationException(value + " is incomparable - what are you doing?");
+ }
+
+ @Override
+ public int hashCode() {
+ throw new UnsupportedOperationException(value + " is incomparable - what are you doing?");
+ }
+ }
+
/**
* A callback interface to provide the value computation.
*/