Add ActionInputMap#toString: will be used for debugging.
// limitations under the License.
package com.google.devtools.build.lib.actions;
+import static java.util.stream.Collectors.toList;
+
import com.google.common.annotations.VisibleForTesting;
+import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
import java.util.Arrays;
@@ -180,4 +183,13 @@ public final class ActionInputMap implements MetadataProvider, ActionInputMapSin
}
}
}
+
+ @Override
+ public String toString() {
+ return MoreObjects.toStringHelper(this)
+ .add("size", size())
+ .add("first-ten-keys", Arrays.stream(keys).limit(10).collect(toList()))
+ .add("first-ten-values", Arrays.stream(values).limit(10).collect(toList()))
+ .toString();
+ }
}
