<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<FindBugsFilter>
  <!--  Considered to be false positives -->
  <Match>
    <!--  Cannot do anything about this. API is fixed by the specification. -->
    <Class name="javax.servlet.jsp.tagext.TagData"/>
    <Bug code="CN" />
  </Match>
  <Match>
    <Class name="javax.servlet.jsp.el.ImplicitObjectELResolver$ScopeMap$ScopeEntry"/>
    <Method name="equals"/>
    <Bug code="Eq" />
  </Match>
  <Match>
    <!-- Yes the simple name is the same as the super class. Accept it. -->
    <Class name="org.apache.catalina.Executor" />
    <Bug code="Nm" />
  </Match>
  <Match>
    <Class name="org.apache.catalina.ant.AbstractCatalinaTask"/>
    <Method name="execute"/>
    <Bug code="REC"/>
  </Match>
  <Match>
    <Class name="org.apache.catalina.ant.jmx.JMXAccessorCondition"/>
    <Method name="accessJMXValue"/>
    <Bug code="REC"/>
  </Match>
  <Match>
    <Class name="org.apache.catalina.ant.jmx.JMXAccessorEqualsCondition"/>
    <Method name="accessJMXValue"/>
    <Bug code="REC"/>
  </Match>
  <Match>
    <Class name="org.apache.catalina.authenticator.AuthenticatorBase"/>
    <Field name="sessionIdGenerator"/>
    <Bug code="IS"/>
  </Match>
  <Match>
    <Class name="org.apache.catalina.authenticator.DigestAuthenticator"/>
    <Field name="cnonces"/>
    <Bug code="IS"/>
  </Match>
  <Match>
    <Class name="org.apache.catalina.connector.CoyoteReader"/>
    <Method name="readLine"/>
    <Bug code="RR"/>
  </Match>
  <Match>
    <!-- JNI library can only be loaded once so statics are appropriate -->
    <Class name="org.apache.catalina.core.AprLifecycleListener" />
    <Bug code="ST" />
  </Match>
  <Match>
    <!-- Have to trigger GC for leak detection to work. Clearly documented -->
    <Class name="org.apache.catalina.core.StandardHost" />
    <Method name="findReloadedContextMemoryLeaks" />
    <Bug code="Dm" />
  </Match>
  <Match>
    <!-- Field is only modified during Servlet load -->
    <Class name="org.apache.catalina.manager.host.HostManagerServlet" />
    <Bug code="MSF" />
  </Match>
  <Match>
    <!-- Catching exception is simpler than handling all the individual ones -->
    <Class name="org.apache.catalina.manager.util.SessionUtils" />
    <Method name="guessLocaleFromSession" />
    <Bug code="REC" />
  </Match>
  <Match>
    <Class name="org.apache.catalina.realm.JDBCRealm" />
    <Field name="containerLog" />
    <Bug code="IS" />
  </Match>
  <Match>
    <!-- We can live with the threading issue. See code comment for details. -->
    <Class name="org.apache.catalina.session.ManagerBase" />
    <Method name="generateSessionId" />
    <Bug code="VO" />
  </Match>
  <Match>
    <!-- Use of null is deliberate -->
    <Class name="org.apache.catalina.ssi.ExpressionParseTree" />
    <Method name="pushOpp" />
    <Bug code="NP" />
  </Match>
  <Match>
    <!-- Catalina isn't used when embedding -->
    <Class name="org.apache.catalina.startup.Catalina" />
    <Method name="stopServer" />
    <Bug code="Dm" />
  </Match>
  <Match>
    <!-- Sleep is short, needs to keep lock -->
    <Class name="org.apache.catalina.startup.HostConfig" />
    <Method name="checkResources" />
    <Bug code="SWL" />
  </Match>
  <Match>
    <Class name="org.apache.catalina.tribes.group.interceptors.TcpFailureDetector"/>
    <Method name="memberAlive"/>
    <Bug code="DE"/>
  </Match>
  <Match>
    <Class name="org.apache.catalina.tribes.membership.McastServiceImpl"/>
    <Method name="stop"/>
    <Bug code="DE"/>
  </Match>
  <Match>
    <Class name="org.apache.catalina.tribes.membership.McastServiceImpl$ReceiverThread"/>
    <Method name="run"/>
    <Bug code="DE"/>
  </Match>
  <Match>
    <Class name="org.apache.catalina.tribes.membership.McastServiceImpl$RecoveryThread"/>
    <Method name="run"/>
    <Bug code="NS"/>
  </Match>
  <Match>
    <Class name="org.apache.catalina.util.LifecycleBase" />
    <Method name="getState"/>
    <Bug code="UG" />
  </Match>
  <Match>
    <!-- JspC will not be used under a security manager -->
    <Class name="org.apache.jasper.JspC"/>
    <Method name="initClassLoader"/>
    <Bug code="DP" />
  </Match>
  <Match>
    <!-- Parser config is static so statics are appropriate -->
    <Class name="org.apache.jasper.JspC"/>
    <Method name="setValidateXml"/>
    <Bug code="ST" />
  </Match>
  <Match>
    <!-- Simpler to catch Exception than to create dummy implementations of the
         necessary exception hierarchy -->
    <Class name="org.apache.naming.factory.SendMailFactory$1" />
    <Method name="run" />
    <Bug code="DE" />
  </Match>
  <Match>
    <!-- Simpler to catch Exception than to create dummy implementations of the
         necessary exception hierarchy -->
    <Class name="org.apache.naming.factory.webservices.ServiceProxy" />
    <Method name="&lt;init&gt;"/>
    <Bug code="ST" />
  </Match>
  <Match>
    <!-- Class name needs to start with a lower case letter in this case -->
    <Class name="org.apache.naming.java.javaURLContextFactory" />
    <Bug code="Nm" />
  </Match>
  <Match>
    <!-- Class has to implement clone since its superclass does but fakes it -->
    <Class name="org.apache.naming.resources.ResourceAttributes" />
    <Bug code="CN" />
  </Match>
  <Match>
    <!-- Class name is appropriate -->
    <Class name="org.apache.tomcat.util.bcel.classfile.CodeException"/>
    <Bug code="Nm" />
  </Match>
  <Match>
    <!-- Field by field copy is fine for clone in this case -->
    <Class name="org.apache.tomcat.util.bcel.classfile.StackMapType"/>
    <Bug code="CN" />
  </Match>
  <Match>
    <!-- Fall-through expected -->
    <Class name="org.apache.tomcat.util.bcel.classfile.Utility"/>
    <Bug code="SF" />
  </Match>
  <Match>
    <!-- Returning null here is fine -->
    <Class name="org.apache.tomcat.util.buf.MessageBytes"/>
    <Method name="toString"/>
    <Bug code="NP" />
  </Match>
  <Match>
    <!-- Whilst cache is global there may be multiple instances (one per     -->
    <!-- server so statics are appropriate -->
    <Class name="org.apache.tomcat.util.buf.StringCache"/>
    <Bug code="ST" />
  </Match>
  <Match>
    <!-- Test really is for the same object rather than equality -->
    <Class name="org.apache.tomcat.util.digester.Digester"/>
    <Or>
      <Method name="updateBodyText"/>
      <Method name="updateAttributes"/>
    </Or>
    <Bug code="ES" />
  </Match>
  <Match>
    <!-- addCount is modified in other threads -->
    <Class name="org.apache.tomcat.util.net.AprEndpoint$Poller"/>
    <Method name="run"/>
    <Bug code="NN" />
  </Match>
  <Match>
    <!-- addCount is modified in other threads -->
    <Class name="org.apache.tomcat.util.net.AprEndpoint$Sendfile"/>
    <Method name="run"/>
    <Bug code="NN" />
  </Match>
  <Match>
    <!-- Sync is there to protect referenced object not field -->
    <Class name="org.apache.tomcat.util.net.AprEndpoint$SocketEventProcessor"/>
    <Method name="run"/>
    <Bug code="ML" />
  </Match>
  <Match>
    <Class name="org.apache.tomcat.util.net.SecureNioChannel"/>
    <Method name="rehandshake"/>
    <Bug code="DE" />
  </Match>
  <Match>
    <!-- Sync is there to protect referenced object not field -->
    <Class name="org.apache.tomcat.util.net.AprEndpoint$SocketWithOptionsProcessor"/>
    <Method name="run"/>
    <Bug code="ML" />
  </Match>
  <Match>
    <!-- Yes the simple name is the same as the super class. Accept it. -->
    <Class name="org.apache.tomcat.util.threads.ThreadPoolExecutor" />
    <Bug code="Nm" />
  </Match>
  <!--  Generated code -->
  <Match>
    <Class name="org.apache.el.parser.ELParserTokenManager" />
  </Match>
  <Match>
    <Class name="org.apache.el.parser.TokenMgrError" />
  </Match>
  <Match>
    <Class name="org.apache.el.parser.ParseException" />
  </Match>
  <Match>
    <!-- fCurrentEntity may be null after endEntity() call -->
    <Class name="org.apache.jasper.xmlparser.XMLEncodingDetector" />
    <Method name="load" />
    <Bug code="RCN" />
  </Match>

  <!-- Test code -->
  <Match>
    <Or>
      <Class name="org.apache.catalina.startup.TestListener$SCL" />
      <Class name="org.apache.catalina.startup.TestListener$SCL3" />
    </Or>
    <Method name="contextInitialized" />
    <Bug code="ST" />
  </Match>
  <Match>
    <Class name="org.apache.catalina.startup.TestTomcatClassLoader$ClassLoaderReport"/>
    <Bug code="Se"/>
  </Match>
  <Match>
    <Class name="org.apache.catalina.tribes.demos.EchoRpcTest" />
    <Method name="run"/>
    <Bug code="REC" />
  </Match>
  <Match>
    <Class name="org.apache.catalina.tribes.demos.EchoRpcTest$SystemExit" />
    <Bug code="Dm" />
  </Match>
  <Match>
    <Class name="org.apache.catalina.tribes.demos.IntrospectionUtils" />
    <Method name="findMethod"/>
    <Bug code="NP" />
  </Match>
  <Match>
    <Class name="org.apache.catalina.tribes.demos.LoadTest" />
    <Method name="memberAdded"/>
    <Bug code="NN" />
  </Match>
  <Match>
    <Class name="org.apache.catalina.tribes.demos.LoadTest" />
    <Method name="run"/>
    <Or>
      <Bug code="REC" />
      <Bug code="UW" />
    </Or>
  </Match>
  <Match>
    <Class name="org.apache.catalina.tribes.demos.LoadTest$SystemExit" />
    <Bug code="Dm" />
  </Match>
  <Match>
    <Class name="org.apache.catalina.tribes.demos.MapDemo$SystemExit" />
    <Bug code="Dm" />
  </Match>
  <Match>
    <Class name="org.apache.catalina.tribes.test.channel.TestChannelOptionFlag" />
    <Method name="tearDown" />
    <Bug code="DE" />
  </Match>
  <Match>
    <Class name="org.apache.catalina.tribes.test.channel.TestChannelStartStop" />
    <Method name="tearDown" />
    <Bug code="DE" />
  </Match>
  <Match>
    <Class name="org.apache.catalina.tribes.test.channel.TestChannelStartStop" />
    <Method name="testDoublePartialStart" />
    <Bug code="DE" />
  </Match>
  <Match>
    <Class name="org.apache.catalina.tribes.test.channel.TestChannelStartStop" />
    <Method name="testFalseOption" />
    <Bug code="DE" />
  </Match>
  <Match>
    <Class name="org.apache.catalina.tribes.test.channel.TestRemoteProcessException" />
   <Bug code="Nm" />
  </Match>
  <Match>
    <Class name="org.apache.catalina.tribes.test.interceptors.TestNonBlockingCoordinator" />
    <Method name="testCoord1" />
    <Bug code="DE" />
  </Match>
  <Match>
    <Class name="org.apache.catalina.tribes.test.membership.TestTcpFailureDetector" />
    <Method name="tearDown" />
    <Bug code="DE" />
  </Match>
  <Match>
    <Class name="org.apache.catalina.tribes.test.transport.SocketReceive$1" />
    <Method name="run" />
    <Bug code="DE" />
  </Match>
  <Match>
    <Class name="org.apache.catalina.tribes.test.transport.SocketTribesReceive$1" />
    <Method name="run" />
    <Bug code="DE" />
  </Match>
  <Match>
    <Class name="org.apache.catalina.tribes.test.transport.SocketTribesReceive" />
    <Method name="main" />
    <Bug code="DE" />
  </Match>
  <Match>
    <Class name="org.apache.catalina.tribes.test.transport.SocketValidateReceive$1" />
    <Method name="run" />
    <Bug code="DE" />
  </Match>
  <Match>
    <Class name="org.apache.tomcat.util.net.TestSsl" />
    <Or>
      <Method name="testRenegotiateFail" />
      <Method name="testRenegotiateWorks" />
    </Or>
    <Bug code="RR" />
  </Match>
</FindBugsFilter>