Minor changes (#1442)

* remove try without catch

* reduce nesting

* reduce nesting

* reduce line length
This commit is contained in:
Lars Hvam 2018-06-04 15:12:03 +02:00 committed by GitHub
parent 71bcc8afac
commit 10dbd74f57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 42 additions and 47 deletions

View File

@ -36,7 +36,7 @@ ENDCLASS.
CLASS zcl_abapgit_object_doma IMPLEMENTATION.
CLASS ZCL_ABAPGIT_OBJECT_DOMA IMPLEMENTATION.
METHOD deserialize_texts.
@ -223,23 +223,20 @@ CLASS zcl_abapgit_object_doma IMPLEMENTATION.
CATCH cx_sy_dyn_call_param_not_found.
TRY.
CALL FUNCTION 'RS_DD_DELETE_OBJ'
EXPORTING
no_ask = abap_true
objname = lv_objname
objtype = 'D'
* no_ask_delete_append = abap_true parameter not available in lower NW versions
EXCEPTIONS
not_executed = 1
object_not_found = 2
object_not_specified = 3
permission_failure = 4.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from RS_DD_DELETE_OBJ, DOMA' ).
ENDIF.
ENDTRY.
CALL FUNCTION 'RS_DD_DELETE_OBJ'
EXPORTING
no_ask = abap_true
objname = lv_objname
objtype = 'D'
* no_ask_delete_append = abap_true parameter not available in lower NW versions
EXCEPTIONS
not_executed = 1
object_not_found = 2
object_not_specified = 3
permission_failure = 4.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from RS_DD_DELETE_OBJ, DOMA' ).
ENDIF.
ENDTRY.

View File

@ -338,31 +338,29 @@ CLASS zcl_abapgit_objects_program IMPLEMENTATION.
ENDIF.
zcl_abapgit_language=>restore_login_language( ).
ELSE.
ELSEIF strlen( is_progdir-name ) > 30.
* function module RPY_PROGRAM_INSERT cannot handle function group includes
IF strlen( is_progdir-name ) > 30.
" special treatment for extensions
" if the program name exceeds 30 characters it is not a usual
" ABAP program but might be some extension, which requires the internal
" addition EXTENSION TYPE, see
" http://help.sap.com/abapdocu_751/en/abapinsert_report_internal.htm#!ABAP_ADDITION_1@1@
" This e.g. occurs in case of transportable Code Inspector variants (ending with ===VC)
INSERT REPORT is_progdir-name
FROM it_source
STATE 'I'
EXTENSION TYPE is_progdir-name+30.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from INSERT REPORT .. EXTENSION TYPE' ).
ENDIF.
ELSE.
INSERT REPORT is_progdir-name
FROM it_source
STATE 'I'
PROGRAM TYPE is_progdir-subc.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from INSERT REPORT' ).
ENDIF.
" special treatment for extensions
" if the program name exceeds 30 characters it is not a usual
" ABAP program but might be some extension, which requires the internal
" addition EXTENSION TYPE, see
" http://help.sap.com/abapdocu_751/en/abapinsert_report_internal.htm#!ABAP_ADDITION_1@1@
" This e.g. occurs in case of transportable Code Inspector variants (ending with ===VC)
INSERT REPORT is_progdir-name
FROM it_source
STATE 'I'
EXTENSION TYPE is_progdir-name+30.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from INSERT REPORT .. EXTENSION TYPE' ).
ENDIF.
ELSE.
INSERT REPORT is_progdir-name
FROM it_source
STATE 'I'
PROGRAM TYPE is_progdir-subc.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from INSERT REPORT' ).
ENDIF.
ENDIF.

View File

@ -219,12 +219,11 @@ CLASS ZCL_ABAPGIT_SYNTAX_ABAP IMPLEMENTATION.
CASE <ls_match>-token.
WHEN c_token-keyword.
IF <ls_match>-offset > 0.
IF <ls_match>-offset > 0
AND substring( val = iv_line off = ( <ls_match>-offset - 1 ) len = 1 ) CA '-<'.
" Delete match if keyword is part of structure or field symbol
IF substring( val = iv_line off = ( <ls_match>-offset - 1 ) len = 1 ) CA '-<'.
DELETE ct_matches INDEX lv_index.
CONTINUE.
ENDIF.
DELETE ct_matches INDEX lv_index.
CONTINUE.
ENDIF.
WHEN c_token-comment.

View File

@ -69,7 +69,8 @@ CLASS ltcl_xml_output IMPLEMENTATION.
lv_value =
'<?xml version="1.0" encoding="utf-16"?>#<abapGit version="v1.0.0">#' &
' <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">#' &
' <asx:values># <DATA># <FOO>2</FOO># <BAR>A</BAR># </DATA># </asx:values># </asx:abap>#</abapGit>#'.
' <asx:values># <DATA># <FOO>2</FOO># <BAR>A' &
'</BAR># </DATA># </asx:values># </asx:abap>#</abapGit>#'.
REPLACE ALL OCCURRENCES OF '#' IN lv_value WITH cl_abap_char_utilities=>newline.