diff --git a/changelog.txt b/changelog.txt index e604774d..1be520db 100644 --- a/changelog.txt +++ b/changelog.txt @@ -18,6 +18,7 @@ Legend 2021-08-XX v.1.16.0 ------------------ +* DB Access in UT: Global Inheritance (#500) * DB Access in UT: Local Inheritance (#498) * Skip 'Prefer RETURNING to EXPORTING' when both exist (#490) * Pseudo Comment Usage: Multiple Inline Entries (#494) diff --git a/src/checks/y_check_db_access_in_ut.clas.abap b/src/checks/y_check_db_access_in_ut.clas.abap index 4a592932..f136508f 100644 --- a/src/checks/y_check_db_access_in_ut.clas.abap +++ b/src/checks/y_check_db_access_in_ut.clas.abap @@ -191,8 +191,11 @@ CLASS Y_CHECK_DB_ACCESS_IN_UT IMPLEMENTATION. RETURN. ENDIF. - result = xsdbool( line_exists( defined_classes[ name = superclass - has_framework = abap_true ] ) ). + DATA(defined_superclass) = VALUE #( defined_classes[ name = superclass ] OPTIONAL ). + + " Avoiding false-positives (inheriting from global class which is out of scan scope) + result = xsdbool( defined_superclass-has_framework = abap_true + OR defined_superclass IS INITIAL ). ENDMETHOD.