<!--
  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>
    <!-- Exclude generated code -->
    <Match>
        <Package name="org.apache.pig.data.parser.*" />
    </Match>
    <Match>
        <Package name="org.apache.pig.parser.*" />
    </Match>
    <Match>
        <Package name="org.apache.pig.impl.logicalLayer.parser.*" />
    </Match>
    <Match>
        <Package name="org.apache.pig.tools.pigscript.parser.*" />
    </Match>
    <Match>
        <Class name="org.apache.pig.tools.parameters.JavaCharStream" />
    </Match>
    <!--Ignore PigPen since it is not actively supported -->
    <Match>
        <Package name="org.apache.pig.pen.util" />
    </Match>
    <Match>
        <Package name="org.apache.pig.pen" />
    </Match>
    <Match>
        <Package name="org.apache.pig.data.parser.*" />
    </Match>
    <!-- Code does not support multithreading at the moment -->
    <Match>
        <Bug pattern="ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD" />
    </Match>
    <!-- Ingnore non-serializable comparators --> 
    <Match>
        <Bug pattern="SE_COMPARATOR_SHOULD_BE_SERIALIZABLE" />
    </Match>
    <Match>
        <Bug pattern="EI_EXPOSE_REP" />
    </Match>
    <Match>
        <Bug pattern="EI_EXPOSE_REP2" />
    </Match>
    <Match>
        <Bug pattern="DP_CREATE_CLASSLOADER_INSIDE_DO_PRIVILEGED" />
    </Match>
    <Match>
        <Class name="org.apache.pig.tools.parameters.Token" />
    </Match>
    <Match>
        <Class name="org.apache.pig.tools.parameters.TokenMgrError" />
    </Match>
    <Match>
        <Class name="org.apache.pig.tools.parameters.ParamLoader" />
    </Match>
    <Match>
        <Class name="org.apache.pig.tools.parameters.ParamLoaderConstants" />
    </Match>
    <Match>
        <Class name="org.apache.pig.tools.parameters.ParamLoaderTokenManager" />
    </Match>
    <Match>
        <Class name="org.apache.pig.tools.parameters.PigFileParser" />
    </Match>
    <Match>
        <Class name="org.apache.pig.tools.parameters.PigFileParserConstants" />
    </Match>
    <Match>
        <Class name="org.apache.pig.tools.parameters.PigFileParserTokenManager" />
    </Match>
    <Match>
        <Class name="org.apache.pig.tools.parameters.ParseException" />
    </Match>

    <!-- Exclude CN_IDIOM_NO_SUPER_CALL issue in logical and physical plans for now-->
    <Match>
        <Package name="org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators.*" />
        <Bug pattern="CN_IDIOM_NO_SUPER_CALL" />
    </Match>
    <Match>
        <Package name="org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.*" />
        <Bug pattern="CN_IDIOM_NO_SUPER_CALL" />
    </Match>
    <Match>
        <Class name="org.apache.pig.impl.logicalLayer.LogicalPlan" />
        <Bug pattern="CN_IDIOM_NO_SUPER_CALL" />
    </Match>
    <Match>
        <Class name="org.apache.pig.backend.hadoop.executionengine.physicalLayer.plans.PhysicalPlan" />
        <Bug pattern="CN_IDIOM_NO_SUPER_CALL" />
    </Match>

    <!-- Exclude CN_IDIOM_NO_SUPER_CALL - no parent class -->
    <Match>
        <Class name="org.apache.pig.FuncSpec" />
        <Bug pattern="CN_IDIOM_NO_SUPER_CALL" />
    </Match>
    <Match>
        <Class name="org.apache.pig.impl.logicalLayer.schema.Schema" />
        <Bug pattern="CN_IDIOM_NO_SUPER_CALL" />
    </Match>
    <Match>
        <Class name="org.apache.pig.impl.logicalLayer.schema.Schema$FieldSchema" />
        <Bug pattern="CN_IDIOM_NO_SUPER_CALL" />
    </Match>

    <Match>
        <Class name="org.apache.pig.impl.util.WrappedIOException" />
        <Bug pattern="NM_CLASS_NOT_EXCEPTION" />
    </Match>
    <Match>
        <Package name="org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators.*" />
        <Bug pattern="SE_TRANSIENT_FIELD_NOT_RESTORED" />
    </Match>
    <Match>
        <Package name="org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.*" />
        <Bug pattern="SE_TRANSIENT_FIELD_NOT_RESTORED" />
    </Match>
    <Match>
        <Class name="org.apache.pig.data.SortedDataBag" />
        <Field name="mComp" />
        <Bug pattern="SE_TRANSIENT_FIELD_NOT_RESTORED" />
    </Match>
    <Match>
        <Class name="org.apache.pig.impl.logicalLayer.LOLoad" />
        <Field name="mLoadFunc" />
        <Bug pattern="SE_TRANSIENT_FIELD_NOT_RESTORED" />
    </Match>
    <Match>
        <Class name="org.apache.pig.impl.logicalLayer.LOStore" />
        <Field name="mStoreFunc" />
        <Bug pattern="SE_TRANSIENT_FIELD_NOT_RESTORED" />
    </Match>
    <Match>
        <Class name="org.apache.pig.impl.PigContext" />
        <Or>
        <Field name="extraJars" />
        <Field name="skipJars" />
        <Field name="log" />
        </Or>
        <Bug pattern="SE_TRANSIENT_FIELD_NOT_RESTORED" />
    </Match>
    <Match>
        <Class name="org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MapReduceOper" />
        <Field name="nig" />
        <Bug pattern="SE_TRANSIENT_FIELD_NOT_RESTORED" />
    </Match>
    <Match>
        <Class name="org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigMapReduce" />
        <Field name="sJobConf" />
        <Bug pattern="MS_CANNOT_BE_FINAL" />
    </Match>
    <Match>
        <Class name="org.apache.pig.backend.hadoop.executionengine.physicalLayer.PhysicalOperator" />
        <Field name="reporter" />
        <Bug pattern="MS_CANNOT_BE_FINAL" />
    </Match>
    <Match>
        <Class name="org.apache.pig.backend.hadoop.executionengine.physicalLayer.PhysicalOperator" />
        <Field name="pigLogger" />
        <Bug pattern="MS_PKGPROTECT" />
    </Match>
    <Match>
        <Class name="org.apache.pig.impl.logicalLayer.LogicalPlanCloneHelper" />
        <Field name="mOpToCloneMap" />
        <Bug pattern="MS_PKGPROTECT" />
    </Match>
    <Match>
        <Class name="org.apache.pig.impl.util.SpillableMemoryManager" />
        <Bug pattern="DM_GC" />
    </Match>
    <Match>
        <Class name="org.apache.pig.impl.logicalLayer.LogicalPlanBuilder" />
        <Field name="classloader" />
        <Bug pattern="MS_PKGPROTECT" />
    </Match>
    <Match>
        <Class name="org.apache.pig.data.DistinctDataBag$DistinctDataBagIterator$TContainer" />
        <Bug pattern="SIC_INNER_SHOULD_BE_STATIC" />
    </Match>
    <Match>
        <Class name="org.apache.pig.data.InternalDistinctBag$DistinctDataBagIterator$TContainer" />
        <Bug pattern="SIC_INNER_SHOULD_BE_STATIC" />
    </Match>
    <Match>
        <Bug pattern="BC_BAD_CAST_TO_CONCRETE_COLLECTION" />
    </Match>
    <!-- This Tuple classes are not used -->
    <Match>
        <Class name="org.apache.pig.data.AmendableTuple" />
    </Match>
    <Match>
        <Class name="org.apache.pig.data.TimestampedTuple" />
    </Match>
    <Match>
        <Class name="org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.partitioners.CountingMap" />
        <Method name="put" />
        <Bug pattern="NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE" />
    </Match>
    <Match>
        <Class name="org.apache.pig.impl.logicalLayer.optimizer.OpLimitOptimizer" />
        <Method name = "check" />
        <Bug pattern="NP_LOAD_OF_KNOWN_NULL_VALUE" />
    </Match>
    <Match>
        <Class name="org.apache.pig.impl.logicalLayer.optimizer.PushDownForeachFlatten" />
        <Method name = "getOperator" />
        <Bug pattern="NP_LOAD_OF_KNOWN_NULL_VALUE" />
    </Match>
    <Match>
        <Class name="org.apache.pig.impl.logicalLayer.optimizer.StreamOptimizer" />
        <Method name = "check" />
        <Bug pattern="NP_LOAD_OF_KNOWN_NULL_VALUE" />
    </Match>
    <Match>
        <Class name="org.apache.pig.impl.logicalLayer.optimizer.TypeCastInserter" />
        <Method name = "getOperator" />
        <Bug pattern="NP_LOAD_OF_KNOWN_NULL_VALUE" />
    </Match>
    <Match>
        <Class name="org.apache.pig.impl.logicalLayer.schema.Schema" />
        <Method name = "mergeSchema" />
        <Bug pattern="NP_LOAD_OF_KNOWN_NULL_VALUE" />
    </Match>
    <Match>
        <Class name="org.apache.pig.impl.util.LineageTracer" />
    </Match>
    <Match>
        <Class name="org.apache.pig.impl.logicalLayer.optimizer.OpLimitOptimizer" />
        <Method name = "transform" />
        <Bug pattern="NP_LOAD_OF_KNOWN_NULL_VALUE" />
    </Match>
    <Match>
        <Class name="org.apache.pig.impl.logicalLayer.optimizer.PushUpFilter" />
        <Method name = "getOperator" />
        <Bug pattern="NP_LOAD_OF_KNOWN_NULL_VALUE" />
    </Match>
    <Match>
        <Class name="org.apache.pig.SortInfo"/>
        <Method name="equals" />
        <Bug pattern="BC_EQUALS_METHOD_SHOULD_WORK_FOR_ALL_OBJECTS"/>
    </Match>
    <Match>
        <Class name="org.apache.pig.SortColInfo"/>
        <Method name="equals" />
        <Bug pattern="BC_EQUALS_METHOD_SHOULD_WORK_FOR_ALL_OBJECTS"/>
    </Match>
    <Match>
        <Class name="org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.CombinerOptimizer" />
        <Method name = "visitMROp" />
        <Bug pattern="REC_CATCH_EXCEPTION" />
    </Match>
    <Match>
        <Class name="org.apache.pig.tools.streams.StreamGenerator" />
        <Method name = "actionPerformed" />
        <Bug pattern="REC_CATCH_EXCEPTION" />
    </Match>
    <Match>
        <Class name="org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MRCompiler" />
        <Or>
        <Method name = "visitDistinct" />
        <Method name = "visitFRJoin" />
        </Or>
        <Bug pattern="REC_CATCH_EXCEPTION" />
    </Match>
    <Match>
        <Class name="org.apache.tools.bzip2r.CBZip2OutputStream" />
        <Method name = "qSort3" />
        <Bug pattern="IM_AVERAGE_COMPUTATION_COULD_OVERFLOW" />
    </Match>
    <Match>
        <Class name="org.apache.tools.bzip2r.CBZip2OutputStream" />
        <Method name = "sendMTFValues" />
        <Bug pattern="IM_BAD_CHECK_FOR_ODD" />
    </Match>
    <Match>
        <Class name="org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigHadoopLogger" />
        <Bug pattern="UG_SYNC_SET_UNSYNC_GET" />
    </Match>
    <Match>
        <Class name="org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POStream" />
        <Bug pattern="IS2_INCONSISTENT_SYNC" />
    </Match>
    <Match>
        <Class name="org.apache.pig.impl.builtin.DefaultIndexableLoader" />
        <Bug pattern="UWF_NULL_FIELD" />
    </Match>
    <Match>
        <Class name="org.apache.pig.impl.builtin.MergeJoinIndexer" />
        <Bug pattern="UWF_NULL_FIELD" />
    </Match>
    <Match>
        <Class name="org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MRCompiler" />
        <Bug pattern="NM_WRONG_PACKAGE" />
    </Match>
    <Match>
        <Class name="org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.NoopStoreRemover$PhysicalRemover" />
        <Bug pattern="NM_WRONG_PACKAGE" />
    </Match>
    <Match>
        <Class name="org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PhyPlanSetter" />
        <Bug pattern="NM_WRONG_PACKAGE" />
    </Match>
    <Match>
        <Class name="org.apache.pig.impl.logicalLayer.schema.Schema" />
        <Method name = "equals" />
        <Bug pattern="NP_NULL_ON_SOME_PATH" />
    </Match>
    <Match>
        <Class name="org.apache.pig.impl.logicalLayer.schema.Schema$FieldSchema" />
        <Method name = "equals" />
        <Bug pattern="NP_NULL_ON_SOME_PATH" />
    </Match>
    <Match>
        <Class name="org.apache.pig.impl.logicalLayer.optimizer.StreamOptimizer" />
        <Method name = "transform" />
        <Bug pattern="NP_LOAD_OF_KNOWN_NULL_VALUE" />
    </Match>
    <Match>
        <Class name="org.apache.pig.impl.logicalLayer.LogicalPlanBuilder" />
        <Field name = "classloader" />
        <Bug pattern="MS_CANNOT_BE_FINAL" />
    </Match>
    <Match>
        <Bug pattern="RV_ABSOLUTE_VALUE_OF_HASHCODE" />
    </Match>
    <Match>
        <Class name="org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators.ConstantExpression" />
        <Field name = "res" />
        <Bug pattern="MF_CLASS_MASKS_FIELD" />
    </Match>
    <Match>
        <Class name="org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MapReduceLauncher" />
        <Method name = "launchPig" />
        <Bug pattern="DE_MIGHT_IGNORE" />
    </Match>
    <Match>
        <Class name="org.apache.pig.builtin.Utf8StorageConverter" />
        <Method name = "bytesToBoolean" />
        <Bug pattern="NP_BOOLEAN_RETURN_NULL" />
    </Match>
    <Match>
        <Class name="org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigMapReduce" />
        <Field name = "sJobContext" />
        <Bug pattern="MS_CANNOT_BE_FINAL" />
    </Match>
    <Match>
        <Class name="org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.partitioners.WeightedRangePartitioner" />
        <Method name = "setConf" />
        <Bug pattern="REC_CATCH_EXCEPTION" />
    </Match>
    <Match>
        <Class name="org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POSort$UDFSortComparator" />
        <Bug pattern="SE_INNER_CLASS" />
    </Match>
    <Match>
        <Class name="org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POSort$SortComparator" />
        <Bug pattern="SE_INNER_CLASS" />
    </Match>
    <Match>
        <Class name="org.apache.pig.data.DataByteArray" />
        <Method name = "equals" />
        <Bug pattern="EQ_UNUSUAL" />
    </Match>
    <Match>
        <Class name="org.apache.pig.data.DefaultAbstractBag" />
        <Method name = "equals" />
        <Bug pattern="EQ_UNUSUAL" />
    </Match>
    <Match>
        <Class name="org.apache.pig.data.DefaultTuple" />
        <Method name = "equals" />
        <Bug pattern="EQ_UNUSUAL" />
    </Match>
    <Match>
        <Class name="org.apache.pig.data.NonSpillableDataBag" />
        <Method name = "equals" />
        <Bug pattern="EQ_UNUSUAL" />
    </Match>
    <Match>
        <Class name="org.apache.pig.data.SingleTupleBag" />
        <Method name = "equals" />
        <Bug pattern="EQ_ALWAYS_TRUE" />
    </Match>
    <Match>
        <Class name="org.apache.pig.data.SortedDataBag$DefaultComparator" />
        <Method name = "equals" />
        <Bug pattern="EQ_ALWAYS_FALSE" />
    </Match>
    <Match>
        <Class name="org.apache.pig.data.SortedDataBag" />
        <Method name = "equals" />
        <Bug pattern="EQ_ALWAYS_FALSE" />
    </Match>
    <Match>
        <Class name="org.apache.pig.impl.io.PigNullableWritable" />
        <Method name = "equals" />
        <Bug pattern="EQ_UNUSUAL" />
    </Match>
    <Match>
        <Class name="org.apache.pig.impl.logicalLayer.schema.Schema" />
        <Method name = "equals" />
        <Bug pattern="NP_NULL_ON_SOME_PATH_MIGHT_BE_INFEASIBLE" />
    </Match>
    <Match>
        <Class name="org.apache.pig.impl.logicalLayer.schema.Schema$FieldSchema" />
        <Method name = "equals" />
        <Bug pattern="NP_NULL_ON_SOME_PATH_MIGHT_BE_INFEASIBLE" />
    </Match>
    <Match>
        <Class name="org.apache.tools.bzip2r.BZip2Constants" />
        <Field name = "rNums" />
        <Bug pattern="MS_OOI_PKGPROTECT" />
    </Match>
    <Match>
        <Class name="org.apache.pig.scripting.jython.JythonScriptEngine$Interpreter" />
        <Method name = "init" />
        <Bug pattern="OBL_UNSATISFIED_OBLIGATION" />
    </Match>
    <Match>
        <Class name = "org.apache.pig.impl.builtin.ReadScalars" />
        <Method name = "exec" />
        <Bug pattern = "RV_DONT_JUST_NULL_CHECK_READLINE" />
    </Match>
    <Match>
        <Class name = "org.apache.pig.impl.util.Utils" />
        <Method name = "mergeCollection" />
        <Bug pattern = "NP_GUARANTEED_DEREF_ON_EXCEPTION_PATH" />
    </Match>
    <Match>
        <Class name = "org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigGenericMapReduce" />
        <Bug pattern = "MS_CANNOT_BE_FINAL" />
    </Match>
    <Match>
        <Class name = "org.apache.pig.data.DataType" />
        <Bug pattern = "NP_BOOLEAN_RETURN_NULL" />
    </Match>
    <Match>
        <Class name = "org.apache.pig.impl.util.CastUtils" />
        <Bug pattern = "NP_BOOLEAN_RETURN_NULL" />
    </Match>
    <Match>
        <Class name = "org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigOutputCommitter" />
        <Bug pattern = "REC_CATCH_EXCEPTION" />
    </Match>
    <Match>
        <Class name = "org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigMapBase$IllustratorContext" />
        <Bug pattern = "SIC_INNER_SHOULD_BE_STATIC" />
    </Match>
    <Match>
        <Class name = "org.apache.pig.newplan.logical.rules.ColumnPruneHelper$ColumnDependencyVisitor" />
        <Method name = "visit" />
        <Bug pattern = "DLS_DEAD_LOCAL_STORE" />
    </Match>
</FindBugsFilter>
