[fix] 修复Cfg DefBean.PreCompile中CollectHierarchyFields时由于顺序原因有可能发生祖父及更高层级的类的ParentDefType字段未设置导致的未能收集到所有字段的恶劣bug
parent
16e4fe2452
commit
c14437aa59
|
|
@ -158,9 +158,9 @@ namespace Luban.Job.Cfg.Defs
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void PreCompile()
|
private void SetUpParent()
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(Parent))
|
if (ParentDefType == null && !string.IsNullOrEmpty(Parent))
|
||||||
{
|
{
|
||||||
if ((ParentDefType = (DefBean)AssemblyBase.GetDefType(Namespace, Parent)) == null)
|
if ((ParentDefType = (DefBean)AssemblyBase.GetDefType(Namespace, Parent)) == null)
|
||||||
{
|
{
|
||||||
|
|
@ -171,7 +171,13 @@ namespace Luban.Job.Cfg.Defs
|
||||||
ParentDefType.Children = new List<DefBeanBase>();
|
ParentDefType.Children = new List<DefBeanBase>();
|
||||||
}
|
}
|
||||||
ParentDefType.Children.Add(this);
|
ParentDefType.Children.Add(this);
|
||||||
|
((DefBean)ParentDefType).SetUpParent();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void PreCompile()
|
||||||
|
{
|
||||||
|
SetUpParent();
|
||||||
|
|
||||||
CollectHierarchyFields(HierarchyFields);
|
CollectHierarchyFields(HierarchyFields);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue