Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ложное срабатывание проверки в модулях расширений: 456 #1207 #1396

Merged
merged 1 commit into from
Dec 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading