From 40ede315c1370723ca721c9bf792a039093e4cc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D0=B0=D0=BF=D1=80=D0=B0=D0=BB=D0=BE=D0=B2=20=D0=90?= =?UTF-8?q?=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=80?= Date: Wed, 29 Sep 2021 15:19:06 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D0=B8=D1=81=D0=BA=20=D0=B2=D1=8B?= =?UTF-8?q?=D0=B7=D0=BE=D0=B2=D0=BE=D0=B2=20=D0=BC=D0=B5=D1=82=D0=BE=D0=B4?= =?UTF-8?q?=D0=BE=D0=B2,=20=D0=B0=20=D0=BD=D0=B5=20=D0=BF=D1=80=D0=BE?= =?UTF-8?q?=D0=B8=D0=B7=D0=B2=D0=BE=D0=BB=D1=8C=D0=BD=D0=BE=D0=B3=D0=BE=20?= =?UTF-8?q?StaticFeatureAccess?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../check/ChangeAndValidateInsteadOfAroundCheck.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/ChangeAndValidateInsteadOfAroundCheck.java b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/ChangeAndValidateInsteadOfAroundCheck.java index ced5fdb5..39ee12c5 100644 --- a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/ChangeAndValidateInsteadOfAroundCheck.java +++ b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/ChangeAndValidateInsteadOfAroundCheck.java @@ -19,6 +19,8 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.xtext.EcoreUtil2; import com._1c.g5.v8.dt.bsl.common.Symbols; +import com._1c.g5.v8.dt.bsl.model.FeatureAccess; +import com._1c.g5.v8.dt.bsl.model.Invocation; import com._1c.g5.v8.dt.bsl.model.Method; import com._1c.g5.v8.dt.bsl.model.Pragma; import com._1c.g5.v8.dt.bsl.model.StaticFeatureAccess; @@ -97,9 +99,15 @@ public class ChangeAndValidateInsteadOfAroundCheck } boolean hasProceedWithCall = false; - for (StaticFeatureAccess sfa : EcoreUtil2.eAllOfType(method, StaticFeatureAccess.class)) + for (Invocation inv : EcoreUtil2.eAllOfType(method, Invocation.class)) { - String featureName = sfa.getName(); + FeatureAccess methodAccess = inv.getMethodAccess(); + if (!(methodAccess instanceof StaticFeatureAccess)) + { + continue; + } + + String featureName = methodAccess.getName(); if (PROCEED_WITH_CALL.equalsIgnoreCase(featureName) || PROCEED_WITH_CALL_RUS.equalsIgnoreCase(featureName)) { hasProceedWithCall = true;