From 1114ccfb3abf19393aeecff25996cf97faeb53ab Mon Sep 17 00:00:00 2001 From: Rob Bygrave Date: Mon, 22 Nov 2021 15:12:18 +1300 Subject: [PATCH] #2441 Flatten and re-order if block in AssocOneHelpRefInherit when determining BeanDescriptor --- .../server/deploy/AssocOneHelpRefInherit.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/ebean-core/src/main/java/io/ebeaninternal/server/deploy/AssocOneHelpRefInherit.java b/ebean-core/src/main/java/io/ebeaninternal/server/deploy/AssocOneHelpRefInherit.java index 6ca843258..b797c5a0c 100644 --- a/ebean-core/src/main/java/io/ebeaninternal/server/deploy/AssocOneHelpRefInherit.java +++ b/ebean-core/src/main/java/io/ebeaninternal/server/deploy/AssocOneHelpRefInherit.java @@ -32,16 +32,14 @@ final class AssocOneHelpRefInherit extends AssocOneHelp { // read discriminator to determine the type InheritInfo rowInheritInfo = inherit.readType(ctx); BeanDescriptor desc; - if (rowInheritInfo == null) { - if(!inherit.hasChildren()) { - desc = inherit.desc(); - } else { - // ignore the id property - property.targetIdBinder.loadIgnore(ctx); - return null; - } - } else { + if (rowInheritInfo != null) { desc = rowInheritInfo.desc(); + } else if (!inherit.hasChildren()) { + desc = inherit.desc(); + } else { + // ignore the id property + property.targetIdBinder.loadIgnore(ctx); + return null; } Object id = property.targetIdBinder.read(ctx); if (id == null) {