From fc936ec2b0bdedd3ac0a0fcf802792427205465f Mon Sep 17 00:00:00 2001 From: cgoldfeder Date: Tue, 10 May 2016 11:32:59 -0700 Subject: [PATCH] Fix get_schema_tree to handle DotAppDomainInfo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This was the first time we ever had a type that was parented on a particular type of EppResource, as opposed to on Key generically, and get_schema_tree was not printing it correctly. (While I'm here, add some missing javadoc). The new output is below. The only difference is that the line with DotAppDomainInfo was ommitted before. AppDeveloperAccount (bgr) AppToDomainAssociation (bgr) CommitLogBucket (not backed up) ↳ CommitLogManifest (not backed up) ↳ CommitLogMutation (not backed up) CommitLogCheckpointRoot (not backed up) ↳ CommitLogCheckpoint (not backed up) DomainApplicationIndex (bgr) EntityGroupRoot (bgr) ↳ ClaimsListShard.ClaimsListSingleton (not backed up) ↳ ClaimsListShard.ClaimsListRevision (virtual) ↳ ClaimsListShard (not backed up) ↳ Cursor ↳ LogsExportCursor ↳ PremiumList ↳ PremiumList.PremiumListRevision (virtual) ↳ PremiumList.PremiumListEntry ↳ Registrar ↳ RegistrarBillingEntry ↳ RegistrarContact ↳ RegistrarCredit ↳ RegistrarCreditBalance ↳ Registry ↳ RegistryCursor ↳ ReservedList ↳ ServerSecret (not backed up) ↳ SignedMarkRevocationList (not backed up) ↳ TmchCrl (not backed up) EppResource (abstract) (bgr) - ContactResource - DomainBase - DomainApplication (subclass) - DomainResource (subclass) ↳ DotAppDomainInfo - HostResource ↳ HistoryEntry ↳ BillingEvent.Cancellation ↳ BillingEvent.Modification ↳ BillingEvent.OneTime ↳ BillingEvent.Recurring ↳ PollMessage (abstract) - PollMessage.Autorenew (subclass) - PollMessage.OneTime (subclass) EppResourceIndexBucket (virtual) ↳ EppResourceIndex (bgr) ForeignKeyIndex.ForeignKeyContactIndex (bgr) ForeignKeyIndex.ForeignKeyDomainIndex (bgr) ForeignKeyIndex.ForeignKeyHostIndex (bgr) GaeUserIdConverter (not backed up) Lock (not backed up) RdeRevision ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=121968765 --- java/google/registry/tools/GetSchemaTreeCommand.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/java/google/registry/tools/GetSchemaTreeCommand.java b/java/google/registry/tools/GetSchemaTreeCommand.java index 75b52a58a..56c0c9d8a 100644 --- a/java/google/registry/tools/GetSchemaTreeCommand.java +++ b/java/google/registry/tools/GetSchemaTreeCommand.java @@ -150,15 +150,18 @@ final class GetSchemaTreeCommand implements GtechCommand { .append(getPrintableName(clazz)) .append(clazz.isAnnotationPresent(EntitySubclass.class) ? " (subclass)" : "")); printSubclasses(clazz, indent + 2); + printTree(clazz, indent + 2); } } + /** Returns the simple name of the class prefixed with its wrapper's simple name, if any. */ static String getPrintableName(Class clazz) { return clazz.isMemberClass() ? getPrintableName(clazz.getDeclaringClass()) + "." + clazz.getSimpleName() : clazz.getSimpleName(); } + /** An ordering that sorts on {@link #getPrintableName}. */ static class PrintableNameOrdering extends Ordering> implements Serializable { @Override public int compare(Class left, Class right) {