Implements equals() and hashCode() on BaseSoyTemplateImpl so that method mock() can work. Will fix things from my LSC like []
GITHUB_BREAKING_CHANGES=n/a
@@ -21,6 +21,7 @@ import static com.google.common.collect.ImmutableList.toImmutableList;
import com.google.auto.value.AutoValue;
import com.google.common.base.Functions;
import com.google.common.base.Joiner;
+import com.google.common.base.Objects;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
@@ -63,6 +64,19 @@ public abstract class BaseSoyTemplateImpl implements SoyTemplate {
return data;
}
+ @Override
+ @SuppressWarnings("EqualsGetClass") // All subclasses are final.
+ public boolean equals(Object o) {
+ return o != null
+ && getClass().equals(o.getClass())
+ && data.equals(((BaseSoyTemplateImpl) o).data);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hashCode(getClass(), data);
+ }
+
/**
* The abstract superclass for generated per-template parameter builders. Each public template
* will have a corresponding generated subtype of this class. Do not extend outside of Soy
