diff --git a/CHANGELOG.md b/CHANGELOG.md index a4a75f75..e0291b3a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,7 @@ ### Исправленные ошибки - Требование к программному продукту: Для переменных общих модулей проверялся префикс расширения и диагностировалась ошибка +- При анализе расположения устаревших методов учитывался только сценарий расположения устаревшей области в программном интерфейса, теперь учитывается еще и служебный программный интерфейс ## 0.4.0 diff --git a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/DeprecatedProcedureOutsideDeprecatedRegionCheck.java b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/DeprecatedProcedureOutsideDeprecatedRegionCheck.java index f8f49ba1..2d2dde20 100644 --- a/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/DeprecatedProcedureOutsideDeprecatedRegionCheck.java +++ b/bundles/com.e1c.v8codestyle.bsl/src/com/e1c/v8codestyle/bsl/check/DeprecatedProcedureOutsideDeprecatedRegionCheck.java @@ -125,6 +125,7 @@ public class DeprecatedProcedureOutsideDeprecatedRegionCheck return false; } return regionFirst.get().getName().equals(ModuleStructureSection.DEPRECATED_REGION.getName(scriptVariant)) - && regionTop.get().getName().equals(ModuleStructureSection.PUBLIC.getName(scriptVariant)); + && (regionTop.get().getName().equals(ModuleStructureSection.PUBLIC.getName(scriptVariant)) + || regionTop.get().getName().equals(ModuleStructureSection.INTERNAL.getName(scriptVariant))); } } diff --git a/tests/com.e1c.v8codestyle.bsl.itests/resources/deprecated-method-compliant2.bsl b/tests/com.e1c.v8codestyle.bsl.itests/resources/deprecated-method-compliant2.bsl new file mode 100644 index 00000000..954757db --- /dev/null +++ b/tests/com.e1c.v8codestyle.bsl.itests/resources/deprecated-method-compliant2.bsl @@ -0,0 +1,14 @@ +#Region Internal + +#Region Deprecated + +// Deprecated. Instead, use SupportedProcedure +Procedure DeprecatedProcedure() Export + + DeprecatedProcedure() + +EndProcedure + +#EndRegion + +#EndRegion \ No newline at end of file diff --git a/tests/com.e1c.v8codestyle.bsl.itests/src/com/e1c/v8codestyle/bsl/check/itests/DeprecatedProcedureOutsideDeprecatedRegionCheckTest.java b/tests/com.e1c.v8codestyle.bsl.itests/src/com/e1c/v8codestyle/bsl/check/itests/DeprecatedProcedureOutsideDeprecatedRegionCheckTest.java index 92e341d9..b4fec0bb 100644 --- a/tests/com.e1c.v8codestyle.bsl.itests/src/com/e1c/v8codestyle/bsl/check/itests/DeprecatedProcedureOutsideDeprecatedRegionCheckTest.java +++ b/tests/com.e1c.v8codestyle.bsl.itests/src/com/e1c/v8codestyle/bsl/check/itests/DeprecatedProcedureOutsideDeprecatedRegionCheckTest.java @@ -56,7 +56,21 @@ public class DeprecatedProcedureOutsideDeprecatedRegionCheckTest } /** - * Test a deprecated method is placed a nested region in the Deprecated region of the Public region + * Test a deprecated method is placed in the Deprecated region of the Internal region in a common module area + * + * @throws Exception the exception + */ + @Test + public void testCompliantDeprecatedMethodInInternal() throws Exception + { + updateModule(FOLDER_RESOURCE + "deprecated-method-compliant2.bsl"); + + List markers = getModuleMarkers(); + assertTrue(markers.isEmpty()); + } + + /** + * Test a deprecated method is placed a nested region in the Deprecated region of the Public region * in a common module area * * @throws Exception the exception