<commit_before><?xml version="1.0" encoding="utf-8"?>
<FindBugsFilter>

  <!--
  !
  ! This file is divided into two parts:
  ! 1. APPROVED EXCLUSIONS
  ! 2. TEMPORARY (UNAPPROVED) EXCLUSIONS
  !
  ! Approved exclusions come in two sub-types:
  ! 1. general exclusion of a named bug pattern, meaning that all instances that matches the bug
  !    pattern identifier are excluded;
  ! 2. specific exclusions for a named bug pattern, meaning that all instance exclusions are
  !    explicitly enumerated;
  !
  ! All specific exclusions must be accompanied inline (i.e., in the affected source code) by
  ! a commented out annotation of the form:
  !
  ! // @SuppressFBWarnings("pattern identifier")
  !
  ! where pattern identifier is one of findbugs' named patterns. At an appropriate point in the
  ! future, these commented out annotations will be uncommented and exclusion patterns removed
  ! from this file.
  !
  ! Temporary (unapproved) exclusions are short-term work arounds that should be removed as
  ! soon as possible by either (1) fixing (eliminating) cause of warning, or (2) conversion to
  ! approved exclusion.
  !
  ! The organization of pattern matches employs the following levels (from top down):
  ! 1. bug pattern
  ! 2. or clause matching instances
  ! 3. class name, if applies to class/interface
  ! 4. and clause matching class/instance and single or or clause of multiple {method,field} members
  !
  ! for example,
  !
  ! <Match>
  !   <Bug pattern="pattern identifier"/>
  !   <Or>
  !     <And>
  !       <Class name="dotted class name"/>
  !       <Member name="unqualified member name"/>
  !     </And>
  !   </Or>
  ! </Match>
  !
  -->

  <!-- START - APPROVED EXCLUSIONS -->
  <Match>
    <Bug pattern="BC_BAD_CAST_TO_CONCRETE_COLLECTION"/>
    <!-- TODO - Not sure what to do with those two... Seems messy/hacky -->
    <And>
      <Class name="org.apache.fop.area.AreaTreeObject"/>
      <Method name="clone"/>
    </And>
  </Match>    
  <Match>
    <Bug pattern="BC_UNCONFIRMED_CAST_OF_RETURN_VALUE"/>
    <!-- TODO - See if these can be solved in a better way -->
    <Or>
      <And>
        <Class name="org.apache.fop.layoutmgr.PageBreakingAlgorithm"/>
        <Or>
          <Method name="createFootnotePages"/>
          <Method name="finish"/>
        </Or>
      </And>
      <And>
        <Class name="org.apache.fop.render.rtf.RTFHandler"/>
        <Or>
          <Method name="endCell"/>
          <Method name="endFootnoteBody"/>
          <Method name="endPart"/>
          <Method name="endRow"/>
          <Method name="startCell"/>
          <Method name="startFootnoteBody"/>
          <Method name="startListItem"/>
          <Method name="startListLabel"/>
          <Method name="startPart"/>
          <Method name="startRow"/>
        </Or>
      </And>
    </Or>
  </Match>
  <Match>
    <Bug pattern="CN_IDIOM_NO_SUPER_CALL"/>
    <Or>
      <And>
        <Class name="org.apache.fop.render.intermediate.IFGraphicContext"/>
        <Method name="clone"/>
      </And>
      <And>
        <Class name="org.apache.fop.svg.text.BidiAttributedCharacterIterator"/>
        <Method name="clone"/>
      </And>
    </Or>
  </Match>
  <Match>
    <Bug pattern="DM_EXIT"/>
    <Or>
      <And>
        <Class name="org.apache.fop.cli.CommandLineOptions"/>
        <Or>
          <Method name="parseCustomOutputOption"/>
          <Method name="parseOptions"/>
        </Or>
      </And>
      <And>
        <Class name="org.apache.fop.cli.Main"/>
        <Or><commit_msg>Add approved exclusion for two warnings<commit_after><?xml version="1.0" encoding="utf-8"?>
<FindBugsFilter>

  <!--
  !
  ! This file is divided into two parts:
  ! 1. APPROVED EXCLUSIONS
  ! 2. TEMPORARY (UNAPPROVED) EXCLUSIONS
  !
  ! Approved exclusions come in two sub-types:
  ! 1. general exclusion of a named bug pattern, meaning that all instances that matches the bug
  !    pattern identifier are excluded;
  ! 2. specific exclusions for a named bug pattern, meaning that all instance exclusions are
  !    explicitly enumerated;
  !
  ! All specific exclusions must be accompanied inline (i.e., in the affected source code) by
  ! a commented out annotation of the form:
  !
  ! // @SuppressFBWarnings("pattern identifier")
  !
  ! where pattern identifier is one of findbugs' named patterns. At an appropriate point in the
  ! future, these commented out annotations will be uncommented and exclusion patterns removed
  ! from this file.
  !
  ! Temporary (unapproved) exclusions are short-term work arounds that should be removed as
  ! soon as possible by either (1) fixing (eliminating) cause of warning, or (2) conversion to
  ! approved exclusion.
  !
  ! The organization of pattern matches employs the following levels (from top down):
  ! 1. bug pattern
  ! 2. or clause matching instances
  ! 3. class name, if applies to class/interface
  ! 4. and clause matching class/instance and single or or clause of multiple {method,field} members
  !
  ! for example,
  !
  ! <Match>
  !   <Bug pattern="pattern identifier"/>
  !   <Or>
  !     <And>
  !       <Class name="dotted class name"/>
  !       <Member name="unqualified member name"/>
  !     </And>
  !   </Or>
  ! </Match>
  !
  -->

  <!-- START - APPROVED EXCLUSIONS -->
  <Match>
    <Bug pattern="ES_COMPARING_STRINGS_WITH_EQ"/>
    <!-- OK; check mainly serves to cover case where both strings are null -->
    <And>
      <Class name="org.apache.fop.afp.AFPResourceInfo"/>
      <Method name="equals"/>
    </And>
  </Match>    
  <Match>
    <Bug pattern="BC_BAD_CAST_TO_CONCRETE_COLLECTION"/>
    <!-- TODO - Not sure what to do with those two... Seems messy/hacky -->
    <And>
      <Class name="org.apache.fop.area.AreaTreeObject"/>
      <Method name="clone"/>
    </And>
  </Match>    
  <Match>
    <Bug pattern="BC_UNCONFIRMED_CAST_OF_RETURN_VALUE"/>
    <!-- TODO - See if these can be solved in a better way -->
    <Or>
      <And>
        <Class name="org.apache.fop.layoutmgr.PageBreakingAlgorithm"/>
        <Or>
          <Method name="createFootnotePages"/>
          <Method name="finish"/>
        </Or>
      </And>
      <And>
        <Class name="org.apache.fop.render.rtf.RTFHandler"/>
        <Or>
          <Method name="endCell"/>
          <Method name="endFootnoteBody"/>
          <Method name="endPart"/>
          <Method name="endRow"/>
          <Method name="startCell"/>
          <Method name="startFootnoteBody"/>
          <Method name="startListItem"/>
          <Method name="startListLabel"/>
          <Method name="startPart"/>
          <Method name="startRow"/>
        </Or>
      </And>
    </Or>
  </Match>
  <Match>
    <Bug pattern="CN_IDIOM_NO_SUPER_CALL"/>
    <Or>
      <And>
        <Class name="org.apache.fop.render.intermediate.IFGraphicContext"/>
        <Method name="clone"/>
      </And>
      <And>
        <Class name="org.apache.fop.svg.text.BidiAttributedCharacterIterator"/>
        <Method name="clone"/>
      </And>
    </Or>
  </Match>
  <Match>
    <Bug pattern="DM_DEFAULT_ENCODING"/>
    <Or>
      <!-- default encoding used as a fallback/last resort -->
      <Or>
        <And>
          <Method name="getNameBytes"/>
          <Or>
            <Class name="org.apache.fop.afp.fonts.CharacterSet"/>
            <Class name="org.apache.fop.afp.modca.AbstractNamedAFPObject"/>
          </Or>
        </And>
        <And>
          <Class name="org.apache.fop.pdf.PDFDocument"/>
          <Method name="encode"/>
        </And>
      </Or>
      <!-- reads from or writes to terminal/console -->
      <Or>
        <And>
          <Class name="org.apache.fop.fonts.autodetect.WindowsFontDirFinder"/>
          <Method name="getWinDir"/>
        </And>
        <And>
          <Class name="org.apache.fop.hyphenation.HyphenationTree"/>
          <Method name="main"/>
        </And>
        <And>
          <Class name="org.apache.fop.render.rtf.rtflib.RtfFile"/>
          <Method name="main"/>
        </And>
      </Or>
      <!-- private method: byte-to-string and string-to-byte always on the same platform -->
      <And>
        <Class name="org.apache.fop.render.afp.AFPPainter$AFPBorderPainterAdapter"/>
        <Method name="hash"/>
      </And>
      <!-- source encoding out of FOP's control (FontBox) -->
      <Or>
        <And>
          <Class name="org.apache.fop.fonts.cff.CFFDataReader"/>
          <Method name="getString"/>
        </And>
        <And>
          <Class name="org.apache.fop.fonts.truetype.OTFSubSetFile"/>
          <Or>
            <Method name="createCFF"/>
            <Method name="writeROSEntry"/>
            <Method name="writeStringIndex"/>
          </Or>
        </And>
        <And>
          <Class name="org.apache.fop.render.ps.PSFontUtils"/>
          <Method name="embedType2CFF"/>
        </And>
      </Or>
    </Or>
  </Match>
  <Match>
    <!-- class only used when building? -->
    <Bug pattern="OS_OPEN_STREAM_EXCEPTION_PATH"/>
    <And>
      <Class name="org.apache.fop.hyphenation.SerializeHyphPattern"/>
      <Method name="serializeFile"/>
    </And>
  </Match>
  <Match>
    <Bug pattern="DM_EXIT"/>
    <Or>
      <And>
        <Class name="org.apache.fop.cli.CommandLineOptions"/>
        <Or>
          <Method name="parseCustomOutputOption"/>
          <Method name="parseOptions"/>
        </Or>
      </And>
      <And>
        <Class name="org.apache.fop.cli.Main"/>
        <Or>
{'fraction_non_alphanumeric': 0.13754371092508214, 'fraction_numerical': 0.002861078732648087, 'mean_word_length': 2.2748091603053435, 'pattern_counts': {'":': 0, '<': 227, '<?xml version=': 2, '>': 227, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3057882', 'n_tokens_mistral': 2967, 'n_tokens_neox': 2884, 'n_words': 777}