diff options
author | 2015-11-19 02:16:24 +0000 | |
---|---|---|
committer | 2015-11-19 10:04:36 +0000 | |
commit | 26b3d8532cda8e38244b33222935e5c478d25ad0 (patch) | |
tree | 85becd59cc73bbcff56365a59fb41bfaf24c1b3c /src/test/java/com/google/devtools/build/skyframe/GraphTester.java | |
parent | 3ac42bf4a979c96e73fd79fb8f5416ae7d7621eb (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.java | 20 |
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. */ |