Make the factory methods public in ValueWithMetadata. This might be needed for alternate graph implementations.
--
MOS_MIGRATED_REVID=87755843
diff --git a/src/main/java/com/google/devtools/build/skyframe/ValueWithMetadata.java b/src/main/java/com/google/devtools/build/skyframe/ValueWithMetadata.java
index 956e404..e153a68 100644
--- a/src/main/java/com/google/devtools/build/skyframe/ValueWithMetadata.java
+++ b/src/main/java/com/google/devtools/build/skyframe/ValueWithMetadata.java
@@ -71,13 +71,14 @@
@Nullable
abstract ErrorInfo getErrorInfo();
- abstract NestedSet<TaggedEvents> getTransitiveEvents();
+ public abstract NestedSet<TaggedEvents> getTransitiveEvents();
- static final class ValueWithEvents extends ValueWithMetadata {
+ /** Implementation of {@link ValueWithMetadata} for the value case. */
+ public static final class ValueWithEvents extends ValueWithMetadata {
private final NestedSet<TaggedEvents> transitiveEvents;
- ValueWithEvents(SkyValue value, NestedSet<TaggedEvents> transitiveEvents) {
+ public ValueWithEvents(SkyValue value, NestedSet<TaggedEvents> transitiveEvents) {
super(Preconditions.checkNotNull(value));
this.transitiveEvents = Preconditions.checkNotNull(transitiveEvents);
}
@@ -87,7 +88,7 @@
ErrorInfo getErrorInfo() { return null; }
@Override
- NestedSet<TaggedEvents> getTransitiveEvents() { return transitiveEvents; }
+ public NestedSet<TaggedEvents> getTransitiveEvents() { return transitiveEvents; }
/**
* We override equals so that if the same value is written to a {@link NodeEntry} twice, it can
@@ -122,12 +123,13 @@
public String toString() { return value.toString(); }
}
- static final class ErrorInfoValue extends ValueWithMetadata {
+ /** Implementation of {@link ValueWithMetadata} for the error case. */
+ public static final class ErrorInfoValue extends ValueWithMetadata {
private final ErrorInfo errorInfo;
private final NestedSet<TaggedEvents> transitiveEvents;
- ErrorInfoValue(ErrorInfo errorInfo, @Nullable SkyValue value,
+ public ErrorInfoValue(ErrorInfo errorInfo, @Nullable SkyValue value,
NestedSet<TaggedEvents> transitiveEvents) {
super(value);
this.errorInfo = Preconditions.checkNotNull(errorInfo);
@@ -139,7 +141,7 @@
ErrorInfo getErrorInfo() { return errorInfo; }
@Override
- NestedSet<TaggedEvents> getTransitiveEvents() { return transitiveEvents; }
+ public NestedSet<TaggedEvents> getTransitiveEvents() { return transitiveEvents; }
@Override
public boolean equals(Object o) {
@@ -184,14 +186,14 @@
}
}
- static SkyValue justValue(SkyValue value) {
+ public static SkyValue justValue(SkyValue value) {
if (value instanceof ValueWithMetadata) {
return ((ValueWithMetadata) value).getValue();
}
return value;
}
- static ValueWithMetadata wrapWithMetadata(SkyValue value) {
+ public static ValueWithMetadata wrapWithMetadata(SkyValue value) {
if (value instanceof ValueWithMetadata) {
return (ValueWithMetadata) value;
}
@@ -206,4 +208,4 @@
return null;
}
-}
\ No newline at end of file
+}