diff --git a/core/src/main/java/google/registry/flows/ResourceFlowUtils.java b/core/src/main/java/google/registry/flows/ResourceFlowUtils.java index 5f8a5be60..89e8f1d37 100644 --- a/core/src/main/java/google/registry/flows/ResourceFlowUtils.java +++ b/core/src/main/java/google/registry/flows/ResourceFlowUtils.java @@ -169,7 +169,7 @@ public final class ResourceFlowUtils { // The roid should match one of the contacts. Optional> foundContact = domain.getReferencedContacts().stream() - .filter(key -> key.getOfyKey().getName().equals(authRepoId)) + .filter(key -> key.getSqlKey().equals(authRepoId)) .findFirst(); if (!foundContact.isPresent()) { throw new BadAuthInfoForResourceException(); diff --git a/core/src/main/java/google/registry/model/billing/BillingEvent.java b/core/src/main/java/google/registry/model/billing/BillingEvent.java index cf08faaef..a597b54c1 100644 --- a/core/src/main/java/google/registry/model/billing/BillingEvent.java +++ b/core/src/main/java/google/registry/model/billing/BillingEvent.java @@ -32,7 +32,6 @@ import com.googlecode.objectify.annotation.Id; import com.googlecode.objectify.annotation.Ignore; import com.googlecode.objectify.annotation.IgnoreSave; import com.googlecode.objectify.annotation.Index; -import com.googlecode.objectify.annotation.OnLoad; import com.googlecode.objectify.annotation.Parent; import com.googlecode.objectify.condition.IfNull; import google.registry.model.Buildable; @@ -205,12 +204,6 @@ public abstract class BillingEvent extends ImmutableObject domainHistoryRevisionId); } - @OnLoad - void onLoad() { - domainHistoryRevisionId = parent.getId(); - domainRepoId = parent.getParent().getName(); - } - public String getRegistrarId() { return clientId; } @@ -437,15 +430,6 @@ public abstract class BillingEvent extends ImmutableObject return new Builder(clone(this)); } - @Override - void onLoad() { - super.onLoad(); - if (cancellationMatchingBillingEvent != null) { - recurringEventHistoryRevisionId = - cancellationMatchingBillingEvent.getOfyKey().getParent().getId(); - } - } - @Override void postLoad() { super.postLoad(); @@ -493,6 +477,7 @@ public abstract class BillingEvent extends ImmutableObject public Builder setCancellationMatchingBillingEvent( VKey cancellationMatchingBillingEvent) { getInstance().cancellationMatchingBillingEvent = cancellationMatchingBillingEvent; + // getOfyKey() here is safe, recurring billing event VKeys have a valid ofy key. getInstance().recurringEventHistoryRevisionId = cancellationMatchingBillingEvent.getOfyKey().getParent().getId(); return this; @@ -526,6 +511,7 @@ public abstract class BillingEvent extends ImmutableObject == (instance.cancellationMatchingBillingEvent != null), "Cancellation matching billing event must be set if and only if the SYNTHETIC flag " + "is set."); + // getOfyKey() here is safe, billing event VKeys have a valid ofy key. checkState( !instance.getFlags().contains(Flag.SYNTHETIC) || (instance.cancellationMatchingBillingEvent.getOfyKey().getParent().getId() diff --git a/core/src/main/java/google/registry/model/transfer/DomainTransferData.java b/core/src/main/java/google/registry/model/transfer/DomainTransferData.java index 6276d77de..87545c3eb 100644 --- a/core/src/main/java/google/registry/model/transfer/DomainTransferData.java +++ b/core/src/main/java/google/registry/model/transfer/DomainTransferData.java @@ -122,16 +122,6 @@ public class DomainTransferData extends TransferData return super.copyConstantFieldsToBuilder().setTransferPeriod(this.transferPeriod); } - /** - * Fix the VKey "kind" for the PollMessage keys. - * - *

For use by DomainBase/DomainHistory OnLoad methods ONLY. - */ - public void convertVKeys() { - serverApproveAutorenewPollMessage = - PollMessage.Autorenew.convertVKey(serverApproveAutorenewPollMessage); - } - public Period getTransferPeriod() { return transferPeriod; }