<?xml version="1.0" encoding="UTF-8"?>
<FindBugsFilter>
  <Match>
    <!-- Fluent APIs trigger this -->
    <Bug pattern="RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT"/>
  </Match>

  <Match>
    <!-- forced GC only used in testing -->
    <Or>
      <Class name="io.opentelemetry.instrumentation.test.utils.GcUtils"/>
      <Class name="io.opentelemetry.javaagent.util.GcUtils"/>
    </Or>
    <Bug pattern="DM_GC"/>
  </Match>

  <Match>
    <!-- https://github.com/spotbugs/spotbugs/issues/573 kotlin is not well supported (yet) -->
    <Source name="~.*\.kt"/>
  </Match>

  <Match>
    <!-- final field warnings can be ignored for this test class -->
    <Class name="~muzzle\.TestClasses.*"/>
    <Bug pattern="MS_SHOULD_BE_FINAL"/>
  </Match>

  <Match>
    <!-- inner class serialization warning can be ignored for testing purposes -->
    <Class name="~HttpServletResponseTest\$.*"/>
    <Bug pattern="SE_BAD_FIELD_INNER_CLASS"/>
  </Match>

  <Match>
    <!-- inner class serialization warning can be ignored for testing purposes -->
    <Class name="~HttpServletTest\$.*"/>
    <Bug pattern="SE_BAD_FIELD_INNER_CLASS"/>
  </Match>

  <Match>
    <!-- inner class serialization warning can be ignored for testing purposes -->
    <Class name="~SpymemcachedTest\$.*"/>
    <Bug pattern="SE_BAD_FIELD_INNER_CLASS"/>
  </Match>

  <Match>
    <!-- writing to static field in a non-static method (clearAllExportedData()) -->
    <Class name="io.opentelemetry.instrumentation.testing.LibraryTestRunner"/>
    <Bug pattern="ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD"/>
  </Match>

  <Match>
    <Class name="io.opentelemetry.instrumentation.api.tracer.utils.NetPeerUtils"/>
    <Method name="setNetPeer"
      params="io.opentelemetry.api.trace.Span,java.lang.String,java.lang.String,int"
      returns="void"/>
    <Bug pattern="UC_USELESS_VOID_METHOD"/>
  </Match>

</FindBugsFilter>
