Refactor ErrorInfo creation to share single constructor
Single constructor allows us to enforce/document high-level constraints
in a single place. Move previous constructors to static methods which do
their custom transformations but ultimately funnel their final calculated
fields through the common constructor.
Also added some tests to demonstrate expected behavior of static methods.
--
MOS_MIGRATED_REVID=104142909
diff --git a/src/main/java/com/google/devtools/build/skyframe/CycleInfo.java b/src/main/java/com/google/devtools/build/skyframe/CycleInfo.java
index 9759122..a410ec5 100644
--- a/src/main/java/com/google/devtools/build/skyframe/CycleInfo.java
+++ b/src/main/java/com/google/devtools/build/skyframe/CycleInfo.java
@@ -39,7 +39,7 @@
this(ImmutableList.<SkyKey>of(), cycle);
}
- CycleInfo(Iterable<SkyKey> pathToCycle, Iterable<SkyKey> cycle) {
+ public CycleInfo(Iterable<SkyKey> pathToCycle, Iterable<SkyKey> cycle) {
this.pathToCycle = ImmutableList.copyOf(pathToCycle);
this.cycle = ImmutableList.copyOf(cycle);
}