Skip to content

Commit

Permalink
Ложное срабатывание проверки в модулях расширений: 456 #1207
Browse files Browse the repository at this point in the history
  • Loading branch information
marmyshev committed Dec 22, 2023
1 parent 3218c86 commit b075292
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

### Исправленные ошибки

- Ложное срабатывание проверки module-accessibility-at-client в модулях расширений #1207


## 0.6.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ private boolean isValidModule(Module module)
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))
Expand All @@ -175,8 +175,11 @@ private boolean allowManagerEventAtClient(EObject object, Module module, ICheckP
Method method = (Method)object;
Set<String> 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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public void testManagerModule() throws Exception
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<Marker> getObjectModuleMarkers()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ Procedure PresentationFieldsGetProcessing(Fields, StandardProcessing)
// Complaint
EndProcedure

&After("PresentationFieldsGetProcessing")
Procedure Compiant2(Fields, StandardProcessing)
// Complaint
EndProcedure

Procedure Noncompiant2() Export
// empty
EndProcedure

0 comments on commit b075292

Please sign in to comment.