<commit_before>*&---------------------------------------------------------------------*
*&  Include  zabapgit_object_prag
*&---------------------------------------------------------------------*

CLASS lcl_object_prag DEFINITION INHERITING FROM lcl_objects_super FINAL.

  PUBLIC SECTION.
    INTERFACES lif_object.

  PRIVATE SECTION.
    TYPES: BEGIN OF ty_pragma,
             pragma      TYPE c LENGTH 40,
             extension   TYPE c LENGTH 1,
             signature   TYPE c LENGTH 10,
             description TYPE c LENGTH 255,
           END OF ty_pragma.

ENDCLASS.

CLASS lcl_object_prag IMPLEMENTATION.

  METHOD lif_object~changed_by.

    rv_user = sy-uname.

  ENDMETHOD.

  METHOD lif_object~compare_to_remote_version.

    CREATE OBJECT ro_comparison_result TYPE lcl_comparison_null.

  ENDMETHOD.

  METHOD lif_object~delete.

    TRY.
        DATA(lo_pragma) = cl_abap_pragma=>get_ref( ms_item-obj_name ).

        lo_pragma->delete( ).

      CATCH cx_abap_pragma_not_exists
            cx_abap_pragma_enqueue.

        lcx_exception=>raise( 'PRAG error' ).

    ENDTRY.

  ENDMETHOD.

  METHOD lif_object~deserialize.

    DATA: pragma      TYPE ty_pragma.

    TRY.
        io_xml->read(
          EXPORTING
            iv_name = 'PRAG'
          CHANGING
            cg_data = pragma ).

        DATA(lo_pragma) = cl_abap_pragma=>create( p_pragma  = ms_item-obj_name
                                                  p_package = iv_package ).

        lo_pragma->set_info( p_description = pragma-description
                             p_signature	 = pragma-signature
                             p_extension	 = pragma-extension ).

        lo_pragma->save( ).

      CATCH cx_abap_pragma_not_exists
            cx_abap_pragma_exists
            cx_abap_pragma_enqueue.

        lcx_exception=>raise( 'PRAG error' ).

    ENDTRY.

  ENDMETHOD.

  METHOD lif_object~exists.

    TRY.
        cl_abap_pragma=>get_ref( ms_item-obj_name ).
      CATCH cx_abap_pragma_not_exists.
        rv_bool = abap_false.
        RETURN.
    ENDTRY.

    rv_bool = abap_true.

  ENDMETHOD.

  METHOD lif_object~get_metadata.

    rs_metadata = get_metadata( ).
    rs_metadata-delete_tadir = abap_true.

  ENDMETHOD.

  METHOD lif_object~has_changed_since.

    rv_changed = abap_true.

  ENDMETHOD.

  METHOD lif_object~jump.

    CALL FUNCTION 'RS_TOOL_ACCESS'
      EXPORTING
        operation           = 'SHOW'
        object_name         = ms_item-obj_name
        object_type         = ms_item-obj_type
      EXCEPTIONS
        not_executed        = 1
        invalid_object_type = 2
        OTHERS              = 3.

  ENDMETHOD.

  METHOD lif_object~serialize.

    TRY.
        DATA(lo_pragma) = cl_abap_pragma=>get_ref( ms_item-obj_name ).

        DATA(pragma) = VALUE ty_pragma( pragma			= lo_pragma->pragma
                                        extension 	= lo_pragma->extension
                                        signature 	= lo_pragma->signature
                                        description = lo_pragma->description ).

        io_xml->add(
          EXPORTING
            iv_name = 'PRAG'
            ig_data = pragma ).

      CATCH cx_abap_pragma_not_exists.
        RETURN.
    ENDTRY.

  ENDMETHOD.
<commit_msg>PRAG refactoring<commit_after>*&---------------------------------------------------------------------*
*&  Include  zabapgit_object_prag
*&---------------------------------------------------------------------*

CLASS lcl_object_prag DEFINITION INHERITING FROM lcl_objects_super FINAL.

  PUBLIC SECTION.
    INTERFACES lif_object.

  PRIVATE SECTION.
    TYPES: BEGIN OF ty_pragma,
             pragma      TYPE c LENGTH 40,
             extension   TYPE c LENGTH 1,
             signature   TYPE c LENGTH 10,
             description TYPE c LENGTH 255,
           END OF ty_pragma.

    METHODS:
      _raise_pragma_not_exists
        RAISING
          lcx_exception,

      _raise_pragma_exists
        RAISING
          lcx_exception,

      _raise_pragma_enqueue
        RAISING
          lcx_exception.

ENDCLASS.

CLASS lcl_object_prag IMPLEMENTATION.

  METHOD lif_object~has_changed_since.

    rv_changed = abap_true.

  ENDMETHOD.

  METHOD lif_object~changed_by.

    rv_user = sy-uname.

  ENDMETHOD.

  METHOD lif_object~get_metadata.

    rs_metadata = get_metadata( ).
    rs_metadata-delete_tadir = abap_true.

  ENDMETHOD.

  METHOD lif_object~exists.

    TRY.
        cl_abap_pragma=>get_ref( ms_item-obj_name ).

      CATCH cx_abap_pragma_not_exists.
        rv_bool = abap_false.
        RETURN.
    ENDTRY.

    rv_bool = abap_true.

  ENDMETHOD.

  METHOD lif_object~serialize.

    DATA: lo_pragma TYPE REF TO cl_abap_pragma,
          pragma    TYPE lcl_object_prag=>ty_pragma.

    TRY.
        lo_pragma = cl_abap_pragma=>get_ref( ms_item-obj_name ).

        pragma-pragma      = lo_pragma->pragma.
        pragma-extension   = lo_pragma->extension.
        pragma-signature   = lo_pragma->signature.
        pragma-description = lo_pragma->description.

        io_xml->add( iv_name = 'PRAG'
                     ig_data = pragma ).

      CATCH cx_abap_pragma_not_exists.
        _raise_pragma_not_exists( ).
    ENDTRY.

  ENDMETHOD.

  METHOD lif_object~deserialize.

    DATA: pragma    TYPE ty_pragma,
          lo_pragma TYPE REF TO cl_abap_pragma.

    TRY.
        io_xml->read(
          EXPORTING
            iv_name = 'PRAG'
          CHANGING
            cg_data = pragma ).

        lo_pragma = cl_abap_pragma=>create( p_pragma  = ms_item-obj_name
                                            p_package = iv_package ).

        lo_pragma->set_info( p_description = pragma-description
                             p_signature   = pragma-signature
                             p_extension   = pragma-extension ).

        lo_pragma->save( ).

      CATCH cx_abap_pragma_not_exists.
        _raise_pragma_not_exists( ).
      CATCH cx_abap_pragma_exists.
        _raise_pragma_exists( ).
      CATCH cx_abap_pragma_enqueue.
        _raise_pragma_enqueue( ).
    ENDTRY.

  ENDMETHOD.

  METHOD lif_object~delete.

    DATA: lo_pragma TYPE REF TO cl_abap_pragma.

    TRY.
        lo_pragma = cl_abap_pragma=>get_ref( ms_item-obj_name ).

        lo_pragma->delete( ).

      CATCH cx_abap_pragma_not_exists.
        _raise_pragma_not_exists( ).
      CATCH cx_abap_pragma_enqueue.
        _raise_pragma_enqueue( ).
    ENDTRY.

  ENDMETHOD.

  METHOD lif_object~jump.

    CALL FUNCTION 'RS_TOOL_ACCESS'
      EXPORTING
        operation           = 'SHOW'
        object_name         = ms_item-obj_name
        object_type         = ms_item-obj_type
      EXCEPTIONS
        not_executed        = 1
        invalid_object_type = 2
        OTHERS              = 3.

  ENDMETHOD.

  METHOD lif_object~compare_to_remote_version.

    CREATE OBJECT ro_comparison_result TYPE lcl_comparison_null.

  ENDMETHOD.

  METHOD _raise_pragma_enqueue.

    lcx_exception=>raise( |Pragma { ms_item-obj_name } enqueue error| ).

  ENDMETHOD.

  METHOD _raise_pragma_exists.

    lcx_exception=>raise( |Pragma { ms_item-obj_name } exists| ).

  ENDMETHOD.

  METHOD _raise_pragma_not_exists.

    lcx_exception=>raise( |Pragma { ms_item-obj_name } doesn't exist| ).

  ENDMETHOD.

{'fraction_non_alphanumeric': 0.1009641873278237, 'fraction_numerical': 0.0030303030303030303, 'mean_word_length': 1.6892592592592592, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 7, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6065712', 'n_tokens_mistral': 2417, 'n_tokens_neox': 2197, 'n_words': 424}