From 18388df63cbcd5bf206fa4718b4ea204513662dd Mon Sep 17 00:00:00 2001 From: Artem Iliukhin <20300020+iArtemv@users.noreply.github.com> Date: Wed, 3 Aug 2022 05:44:35 -0600 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BB=D0=B8=D1=88=D0=BD=D0=B8=D1=85?= =?UTF-8?q?=20=D1=81=D0=BA=D0=BE=D0=B1=D0=BE=D0=BA=20(#1095)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Исправление лишних скобок * Исправление npe --- .../check/FormListFieldRefNotAddedCheck.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/bundles/com.e1c.v8codestyle.form/src/com/e1c/v8codestyle/form/check/FormListFieldRefNotAddedCheck.java b/bundles/com.e1c.v8codestyle.form/src/com/e1c/v8codestyle/form/check/FormListFieldRefNotAddedCheck.java index ebff8817..1e6cd9e4 100644 --- a/bundles/com.e1c.v8codestyle.form/src/com/e1c/v8codestyle/form/check/FormListFieldRefNotAddedCheck.java +++ b/bundles/com.e1c.v8codestyle.form/src/com/e1c/v8codestyle/form/check/FormListFieldRefNotAddedCheck.java @@ -29,6 +29,7 @@ import com._1c.g5.v8.dt.form.model.ColumnGroupExtInfo; import com._1c.g5.v8.dt.form.model.DynamicListExtInfo; import com._1c.g5.v8.dt.form.model.Form; import com._1c.g5.v8.dt.form.model.FormAttribute; +import com._1c.g5.v8.dt.form.model.FormAttributeExtInfo; import com._1c.g5.v8.dt.form.model.FormField; import com._1c.g5.v8.dt.form.model.FormGroup; import com._1c.g5.v8.dt.form.model.FormItem; @@ -123,10 +124,10 @@ public class FormListFieldRefNotAddedCheck { return true; } - else if (formItem instanceof FormGroup && refItemExists(((FormGroup)formItem).getItems())) + + if (formItem instanceof FormGroup && refItemExists(((FormGroup)formItem).getItems())) { return true; - } } } @@ -157,10 +158,15 @@ public class FormListFieldRefNotAddedCheck && table.getDataPath().getObjects().get(0).getObject() instanceof FormAttribute) { FormAttribute formAttribute = (FormAttribute)table.getDataPath().getObjects().get(0).getObject(); - DbViewDef dbViewDef = ((DynamicListExtInfo)formAttribute.getExtInfo()).getMainTable(); - if (dbViewDef != null && !dbViewDef.eIsProxy() && dbViewDef.getFields().stream().anyMatch(FIELD_NAME_CHECK)) + FormAttributeExtInfo extInfo = formAttribute.getExtInfo(); + if (extInfo instanceof DynamicListExtInfo) { - return true; + DbViewDef dbViewDef = ((DynamicListExtInfo)extInfo).getMainTable(); + if (dbViewDef != null && !dbViewDef.eIsProxy() + && dbViewDef.getFields().stream().anyMatch(FIELD_NAME_CHECK)) + { + return true; + } } } return false;