From ac5c95ace70a958bcd401e51e190054ece888978 Mon Sep 17 00:00:00 2001 From: Lars Hvam Date: Sun, 26 Sep 2021 18:43:53 +0200 Subject: [PATCH] change EXIT to RETURN, where applicable (#814) --- abaplint.json | 5 ++++- src/demos/zdemo_excel_outputopt_incl.prog.abap | 2 +- src/not_cloud/zcl_excel_ole.clas.abap | 2 +- src/zcl_excel_column.clas.abap | 2 +- src/zcl_excel_common.clas.abap | 8 ++++---- src/zcl_excel_table.clas.abap | 4 ++-- src/zcl_excel_worksheet.clas.abap | 4 ++-- 7 files changed, 15 insertions(+), 12 deletions(-) diff --git a/abaplint.json b/abaplint.json index d1b372b..061bb5e 100644 --- a/abaplint.json +++ b/abaplint.json @@ -163,7 +163,10 @@ "parser_error": true, "space_before_colon": false, "colon_missing_space": false, - "exit_or_check": false, + "exit_or_check": { + "allowCheck": true, + "allowExit": false + }, "line_only_punc": false, "obsolete_statement": false, "start_at_tab": false, diff --git a/src/demos/zdemo_excel_outputopt_incl.prog.abap b/src/demos/zdemo_excel_outputopt_incl.prog.abap index 2d7edcd..909d71a 100644 --- a/src/demos/zdemo_excel_outputopt_incl.prog.abap +++ b/src/demos/zdemo_excel_outputopt_incl.prog.abap @@ -156,7 +156,7 @@ CLASS lcl_output IMPLEMENTATION. IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. - EXIT. + RETURN. ENDIF. READ TABLE lt_dynpfields INTO ls_dynpfields INDEX 1. diff --git a/src/not_cloud/zcl_excel_ole.clas.abap b/src/not_cloud/zcl_excel_ole.clas.abap index 48e1d56..55f7a62 100644 --- a/src/not_cloud/zcl_excel_ole.clas.abap +++ b/src/not_cloud/zcl_excel_ole.clas.abap @@ -948,7 +948,7 @@ CLASS zcl_excel_ole IMPLEMENTATION. no_flush = no_flush IMPORTING error = lo_error_w. - EXIT. + RETURN. ENDIF. CREATE OBJECT l_error diff --git a/src/zcl_excel_column.clas.abap b/src/zcl_excel_column.clas.abap index 7faa027..fc94416 100644 --- a/src/zcl_excel_column.clas.abap +++ b/src/zcl_excel_column.clas.abap @@ -192,7 +192,7 @@ CLASS zcl_excel_column IMPLEMENTATION. me->style_guid = stylemapping-guid. CATCH zcx_excel . - EXIT. " leave as is in case of error + RETURN. " leave as is in case of error ENDTRY. ENDMETHOD. diff --git a/src/zcl_excel_common.clas.abap b/src/zcl_excel_common.clas.abap index a334931..615c6ae 100644 --- a/src/zcl_excel_common.clas.abap +++ b/src/zcl_excel_common.clas.abap @@ -400,7 +400,7 @@ CLASS ZCL_EXCEL_COMMON IMPLEMENTATION. lv_errormessage = 'Index out of bounds'(004). zcx_excel=>raise_text( lv_errormessage ). ENDIF. - EXIT. + RETURN. ENDIF. CATCH cx_sy_conversion_no_number. "#EC NO_HANDLER " Try the character-approach if approach via number has failed @@ -539,7 +539,7 @@ CLASS ZCL_EXCEL_COMMON IMPLEMENTATION. e_sheet. IF i_range IS INITIAL. " a) input empty --> nothing to do - EXIT. + RETURN. ELSEIF i_range(1) = `'`. " b) sheetname existing - starts with ' FIND REGEX '\![^\!]*$' IN i_range MATCH OFFSET lv_position. " Find last ! @@ -1091,7 +1091,7 @@ CLASS ZCL_EXCEL_COMMON IMPLEMENTATION. IF iv_shift_cols = 0 AND iv_shift_rows = 0. ev_resulting_formula = iv_reference_formula. - EXIT. " done + RETURN. " done ENDIF. @@ -1442,7 +1442,7 @@ CLASS ZCL_EXCEL_COMMON IMPLEMENTATION. DESCRIBE TABLE lt_hlp LINES lf_anz. IF lf_anz <= 1. ep_file = ip_file. - EXIT. + RETURN. ENDIF. READ TABLE lt_hlp INTO ls_hlp INDEX lf_anz. diff --git a/src/zcl_excel_table.clas.abap b/src/zcl_excel_table.clas.abap index 752ea84..bfadc9a 100644 --- a/src/zcl_excel_table.clas.abap +++ b/src/zcl_excel_table.clas.abap @@ -141,7 +141,7 @@ CLASS zcl_excel_table IMPLEMENTATION. IF settings-bottom_right_row IS NOT INITIAL. * ev_row = zcl_excel_common=>convert_column2int( settings-bottom_right_row ). " del issue #246 ev_row = settings-bottom_right_row . " ins issue #246 - EXIT. + RETURN. ENDIF. ASSIGN table_data->* TO . @@ -221,7 +221,7 @@ CLASS zcl_excel_table IMPLEMENTATION. IF settings-bottom_right_column IS NOT INITIAL. ev_column = zcl_excel_common=>convert_column2int( settings-bottom_right_column ). - EXIT. + RETURN. ENDIF. ev_column = zcl_excel_common=>convert_column2int( settings-top_left_column ). diff --git a/src/zcl_excel_worksheet.clas.abap b/src/zcl_excel_worksheet.clas.abap index ea2bed4..0725a97 100644 --- a/src/zcl_excel_worksheet.clas.abap +++ b/src/zcl_excel_worksheet.clas.abap @@ -3171,7 +3171,7 @@ CLASS zcl_excel_worksheet IMPLEMENTATION. zcx_excel=>raise_text( 'Please supply a positive number as column-width' ). ENDIF. lo_column->set_width( width ). - EXIT. + RETURN. CATCH cx_sy_conversion_no_number. * Strange stuff passed --> raise error zcx_excel=>raise_text( 'Unable to interpret supplied input as number' ). @@ -3316,7 +3316,7 @@ CLASS zcl_excel_worksheet IMPLEMENTATION. zcx_excel=>raise_text( 'Please supply a positive number as row-height' ). ENDIF. lo_row->set_row_height( height ). - EXIT. + RETURN. CATCH cx_sy_conversion_no_number. * Strange stuff passed --> raise error zcx_excel=>raise_text( 'Unable to interpret supplied input as number' ).