Migrate ActionOwner to @AutoValue.

--
MOS_MIGRATED_REVID=138680612
diff --git a/src/main/java/com/google/devtools/build/lib/actions/ActionOwner.java b/src/main/java/com/google/devtools/build/lib/actions/ActionOwner.java
index 82e6797..a7a4aa7 100644
--- a/src/main/java/com/google/devtools/build/lib/actions/ActionOwner.java
+++ b/src/main/java/com/google/devtools/build/lib/actions/ActionOwner.java
@@ -13,11 +13,11 @@
 // limitations under the License.
 package com.google.devtools.build.lib.actions;
 
+import com.google.auto.value.AutoValue;
 import com.google.devtools.build.lib.cmdline.Label;
 import com.google.devtools.build.lib.concurrent.ThreadSafety.Immutable;
 import com.google.devtools.build.lib.events.Location;
 import com.google.devtools.build.lib.util.Preconditions;
-
 import javax.annotation.Nullable;
 
 /**
@@ -27,76 +27,59 @@
  * but to avoid storing heavyweight analysis objects in actions, and to avoid coupling between the
  * analysis and actions packages, the RuleConfiguredTarget provides an instance of this class.
  */
+@AutoValue
 @Immutable
-public final class ActionOwner {
+public abstract class ActionOwner {
   /** An action owner for special cases. Usage is strongly discouraged. */
   public static final ActionOwner SYSTEM_ACTION_OWNER =
-      new ActionOwner(null, null, "system", "empty target kind", "system", null);
+      ActionOwner.create(null, null, "system", "empty target kind", "system", null);
 
-  @Nullable private final Label label;
-  @Nullable private final Location location;
-  @Nullable private final String mnemonic;
-  @Nullable private final String targetKind;
-  private final String configurationChecksum;
-  @Nullable private final String additionalProgressInfo;
-
-  public ActionOwner(
+  public static ActionOwner create(
       @Nullable Label label,
       @Nullable Location location,
       @Nullable String mnemonic,
       @Nullable String targetKind,
       String configurationChecksum,
       @Nullable String additionalProgressInfo) {
-    this.label = label;
-    this.location = location;
-    this.mnemonic = mnemonic;
-    this.targetKind = targetKind;
-    this.configurationChecksum = Preconditions.checkNotNull(configurationChecksum);
-    this.additionalProgressInfo = additionalProgressInfo;
+    return new AutoValue_ActionOwner(
+        location,
+        label,
+        mnemonic,
+        Preconditions.checkNotNull(configurationChecksum),
+        targetKind,
+        additionalProgressInfo);
   }
 
   /** Returns the location of this ActionOwner, if any; null otherwise. */
   @Nullable
-  public Location getLocation() {
-    return location;
-  }
+  public abstract Location getLocation();
 
-  /**
-   * Returns the label for this ActionOwner, if any; null otherwise.
-   */
+  /** Returns the label for this ActionOwner, if any; null otherwise. */
   @Nullable
-  public Label getLabel() {
-    return label;
-  }
+  public abstract Label getLabel();
 
   /** Returns the configuration's mnemonic. */
   @Nullable
-  public String getConfigurationMnemonic() {
-    return mnemonic;
-  }
+  public abstract String getConfigurationMnemonic();
 
   /**
    * Returns the short cache key for the configuration of the action owner.
    *
-   * <p>Special action owners that are not targets can return any string here. If the
-   * underlying configuration is null, this should return "null".
+   * <p>Special action owners that are not targets can return any string here. If the underlying
+   * configuration is null, this should return "null".
    */
-  public String getConfigurationChecksum() {
-    return configurationChecksum;
-  }
+  public abstract String getConfigurationChecksum();
 
   /** Returns the target kind (rule class name) for this ActionOwner, if any; null otherwise. */
   @Nullable
-  public String getTargetKind() {
-    return targetKind;
-  }
+  public abstract String getTargetKind();
 
   /**
    * Returns additional information that should be displayed in progress messages, or {@code null}
    * if nothing should be added.
    */
   @Nullable
-  String getAdditionalProgressInfo() {
-    return additionalProgressInfo;
-  }
+  abstract String getAdditionalProgressInfo();
+
+  ActionOwner() {}
 }
diff --git a/src/main/java/com/google/devtools/build/lib/actions/BUILD b/src/main/java/com/google/devtools/build/lib/actions/BUILD
index ca91797..a81c650 100644
--- a/src/main/java/com/google/devtools/build/lib/actions/BUILD
+++ b/src/main/java/com/google/devtools/build/lib/actions/BUILD
@@ -27,6 +27,7 @@
         "//src/main/java/com/google/devtools/build/skyframe",
         "//src/main/java/com/google/devtools/common/options",
         "//src/main/protobuf:extra_actions_base_java_proto",
+        "//third_party:auto_value",
         "//third_party:guava",
         "//third_party:jsr305",
         "//third_party/protobuf",
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java b/src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java
index ecb2e89..8f186d4 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java
@@ -399,7 +399,7 @@
 
   @VisibleForTesting
   public static ActionOwner createActionOwner(Rule rule, BuildConfiguration configuration) {
-    return new ActionOwner(
+    return ActionOwner.create(
         rule.getLabel(),
         rule.getLocation(),
         configuration.getMnemonic(),