INTF: Fix check if interface exists (#4759)

As mentioned in #4673, the existence check for interfaces is not correct and actually checking for classes. The PR will correct the check.

Co-authored-by: Lars Hvam <larshp@hotmail.com>
This commit is contained in:
Marc Bernard 2021-05-14 10:28:35 +02:00 committed by GitHub
parent 3f454f3633
commit ce677e449f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 11 deletions

View File

@ -81,17 +81,7 @@ CLASS zcl_abapgit_oo_base IMPLEMENTATION.
METHOD zif_abapgit_oo_object_fnc~exists.
CALL FUNCTION 'SEO_CLASS_EXISTENCE_CHECK'
EXPORTING
clskey = is_object_name
EXCEPTIONS
not_specified = 1
not_existing = 2
is_interface = 3
no_text = 4
inconsistent = 5
OTHERS = 6.
rv_exists = boolc( sy-subrc <> 2 ).
ASSERT 0 = 1. "Subclass responsibility
ENDMETHOD.

View File

@ -15,6 +15,8 @@ CLASS zcl_abapgit_oo_interface DEFINITION
REDEFINITION .
METHODS zif_abapgit_oo_object_fnc~deserialize_source
REDEFINITION .
METHODS zif_abapgit_oo_object_fnc~exists
REDEFINITION .
PROTECTED SECTION.
PRIVATE SECTION.
@ -257,6 +259,21 @@ CLASS zcl_abapgit_oo_interface IMPLEMENTATION.
ENDMETHOD.
METHOD zif_abapgit_oo_object_fnc~exists.
CALL FUNCTION 'SEO_INTERFACE_EXISTENCE_CHECK'
EXPORTING
intkey = is_object_name
EXCEPTIONS
not_specified = 1
not_existing = 2
is_class = 3
no_text = 4
inconsistent = 5
OTHERS = 6.
rv_exists = boolc( sy-subrc = 0 OR sy-subrc = 4 ).
ENDMETHOD.
METHOD zif_abapgit_oo_object_fnc~get_includes.
DATA lv_interface_name TYPE seoclsname.
lv_interface_name = iv_object_name.