From b07529268e68ed03dec86b6c6b93ab463fa5b341 Mon Sep 17 00:00:00 2001 From: Dmitriy Marmyshev Date: Fri, 22 Dec 2023 13:30:03 -0800 Subject: [PATCH] =?UTF-8?q?=D0=9B=D0=BE=D0=B6=D0=BD=D0=BE=D0=B5=20=D1=81?= =?UTF-8?q?=D1=80=D0=B0=D0=B1=D0=B0=D1=82=D1=8B=D0=B2=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA=D0=B8=20?= =?UTF-8?q?=D0=B2=20=D0=BC=D0=BE=D0=B4=D1=83=D0=BB=D1=8F=D1=85=20=D1=80?= =?UTF-8?q?=D0=B0=D1=81=D1=88=D0=B8=D1=80=D0=B5=D0=BD=D0=B8=D0=B9:=20456?= =?UTF-8?q?=20#1207?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + .../check/AccessibilityAtClientInObjectModuleCheck.java | 9 ++++++--- .../AccessibilityAtClientInObjectModuleCheckTest.java | 2 +- .../src/Catalogs/Products/ManagerModule.bsl | 5 +++++ 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c57428e6..7357575d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,7 @@ ### Исправленные ошибки +- Ложное срабатывание проверки module-accessibility-at-client в модулях расширений #1207 ## 0.6.0 diff --git a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/AccessibilityAtClientInObjectModuleCheck.java b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/AccessibilityAtClientInObjectModuleCheck.java index a0f9497a..c39f5f3f 100644 --- a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/AccessibilityAtClientInObjectModuleCheck.java +++ b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/AccessibilityAtClientInObjectModuleCheck.java @@ -164,7 +164,7 @@ public class AccessibilityAtClientInObjectModuleCheck private boolean allowManagerEventAtClient(EObject object, Module module, ICheckParameters parameters) { if (object instanceof Method && module.getModuleType() == ModuleType.MANAGER_MODULE - && ((Method)object).isEvent()) + && (((Method)object).isEvent() || !((Method)object).getPragmas().isEmpty())) { String parameterMethodNames = parameters.getString(PARAMETER_ALLOW_MANAGER_EVENTS_AT_CLIENT); if (StringUtils.isEmpty(parameterMethodNames)) @@ -175,8 +175,11 @@ public class AccessibilityAtClientInObjectModuleCheck Method method = (Method)object; Set methodNames = new TreeSet<>(String.CASE_INSENSITIVE_ORDER); methodNames.addAll(List.of(parameterMethodNames.split(",\\s*"))); //$NON-NLS-1$ - return methodNames.contains(method.getName()); - + return methodNames.contains(method.getName()) || !method.getPragmas().isEmpty() && method.getPragmas() + .stream() + .map(p -> p.getValue().replace("\"", "")) //$NON-NLS-1$ //$NON-NLS-2$ + .filter(StringUtils::isNotBlank) + .anyMatch(methodNames::contains); } return false; } diff --git a/tests/com.e1c.v8codestyle.bsl.itests/src/com/e1c/v8codestyle/bsl/check/itests/AccessibilityAtClientInObjectModuleCheckTest.java b/tests/com.e1c.v8codestyle.bsl.itests/src/com/e1c/v8codestyle/bsl/check/itests/AccessibilityAtClientInObjectModuleCheckTest.java index 57125344..b59c9302 100644 --- a/tests/com.e1c.v8codestyle.bsl.itests/src/com/e1c/v8codestyle/bsl/check/itests/AccessibilityAtClientInObjectModuleCheckTest.java +++ b/tests/com.e1c.v8codestyle.bsl.itests/src/com/e1c/v8codestyle/bsl/check/itests/AccessibilityAtClientInObjectModuleCheckTest.java @@ -81,7 +81,7 @@ public class AccessibilityAtClientInObjectModuleCheckTest Marker marker = markers.get(0); assertEquals("2", marker.getExtraInfo().get(IExtraInfoKeys.TEXT_EXTRA_INFO_LINE_KEY)); marker = markers.get(1); - assertEquals("22", marker.getExtraInfo().get(IExtraInfoKeys.TEXT_EXTRA_INFO_LINE_KEY)); + assertEquals("27", marker.getExtraInfo().get(IExtraInfoKeys.TEXT_EXTRA_INFO_LINE_KEY)); } private List getObjectModuleMarkers() diff --git a/tests/com.e1c.v8codestyle.bsl.itests/workspace/AccessibilityAtClient/src/Catalogs/Products/ManagerModule.bsl b/tests/com.e1c.v8codestyle.bsl.itests/workspace/AccessibilityAtClient/src/Catalogs/Products/ManagerModule.bsl index b3d43564..8b18fb23 100644 --- a/tests/com.e1c.v8codestyle.bsl.itests/workspace/AccessibilityAtClient/src/Catalogs/Products/ManagerModule.bsl +++ b/tests/com.e1c.v8codestyle.bsl.itests/workspace/AccessibilityAtClient/src/Catalogs/Products/ManagerModule.bsl @@ -19,6 +19,11 @@ Procedure PresentationFieldsGetProcessing(Fields, StandardProcessing) // Complaint EndProcedure +&After("PresentationFieldsGetProcessing") +Procedure Compiant2(Fields, StandardProcessing) + // Complaint +EndProcedure + Procedure Noncompiant2() Export // empty EndProcedure