1
0
mirror of https://github.com/1C-Company/v8-code-style.git synced 2025-01-22 05:39:16 +02:00

Исправление лишних скобок (#1095)

* Исправление лишних скобок

* Исправление npe
This commit is contained in:
Artem Iliukhin 2022-08-03 05:44:35 -06:00 committed by GitHub
parent 3ed51e5166
commit 18388df63c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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.DynamicListExtInfo;
import com._1c.g5.v8.dt.form.model.Form; 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.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.FormField;
import com._1c.g5.v8.dt.form.model.FormGroup; import com._1c.g5.v8.dt.form.model.FormGroup;
import com._1c.g5.v8.dt.form.model.FormItem; import com._1c.g5.v8.dt.form.model.FormItem;
@ -123,10 +124,10 @@ public class FormListFieldRefNotAddedCheck
{ {
return true; return true;
} }
else if (formItem instanceof FormGroup && refItemExists(((FormGroup)formItem).getItems()))
if (formItem instanceof FormGroup && refItemExists(((FormGroup)formItem).getItems()))
{ {
return true; return true;
} }
} }
} }
@ -157,10 +158,15 @@ public class FormListFieldRefNotAddedCheck
&& table.getDataPath().getObjects().get(0).getObject() instanceof FormAttribute) && table.getDataPath().getObjects().get(0).getObject() instanceof FormAttribute)
{ {
FormAttribute formAttribute = (FormAttribute)table.getDataPath().getObjects().get(0).getObject(); FormAttribute formAttribute = (FormAttribute)table.getDataPath().getObjects().get(0).getObject();
DbViewDef dbViewDef = ((DynamicListExtInfo)formAttribute.getExtInfo()).getMainTable(); FormAttributeExtInfo extInfo = formAttribute.getExtInfo();
if (dbViewDef != null && !dbViewDef.eIsProxy() && dbViewDef.getFields().stream().anyMatch(FIELD_NAME_CHECK)) 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; return false;