2017-03-01 07:04:02 +08:00
|
|
|
<!--
|
|
|
|
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.
|
|
|
|
-->
|
|
|
|
|
2018-09-11 04:14:00 +08:00
|
|
|
<!-- Spotbugs filtering.
|
2017-04-07 19:29:48 +08:00
|
|
|
|
2018-09-11 04:14:00 +08:00
|
|
|
Spotbugs is a static code analysis tool run as part of the "check" phase of the build.
|
|
|
|
This file dictates which categories of bugs and individual false positives that we suppress.
|
2017-04-07 19:29:48 +08:00
|
|
|
|
2018-09-11 04:14:00 +08:00
|
|
|
For a detailed description of spotbugs bug categories, see https://spotbugs.readthedocs.io/en/latest/bugDescriptions.html
|
2017-04-07 19:29:48 +08:00
|
|
|
-->
|
2017-03-01 07:04:02 +08:00
|
|
|
<FindBugsFilter>
|
2018-11-28 06:40:17 +08:00
|
|
|
|
2017-04-07 19:29:48 +08:00
|
|
|
<Match>
|
|
|
|
<!-- Disable warnings about mutable objects and the use of public fields.
|
|
|
|
EI_EXPOSE_REP: May expose internal representation by returning reference to mutable object
|
|
|
|
EI_EXPOSE_REP2: May expose internal representation by incorporating reference to mutable object
|
2022-10-25 01:41:31 +08:00
|
|
|
MS_PKGPROTECT: Field should be package protected
|
|
|
|
MS_EXPOSE_REP: Public static method may expose internal representation by returning array
|
|
|
|
EI_EXPOSE_STATIC_REP2: May expose internal static state by storing a mutable object into a static field -->
|
|
|
|
<Bug pattern="EI_EXPOSE_REP,EI_EXPOSE_REP2,MS_PKGPROTECT,EI_EXPOSE_STATIC_REP2,MS_EXPOSE_REP"/>
|
2017-04-07 19:29:48 +08:00
|
|
|
</Match>
|
|
|
|
|
|
|
|
<Match>
|
|
|
|
<!-- Disable warnings about System.exit, until we decide to stop using it.
|
|
|
|
DM_EXIT: Method invokes System.exit -->
|
|
|
|
<Bug pattern="DM_EXIT"/>
|
|
|
|
</Match>
|
|
|
|
|
|
|
|
<Match>
|
|
|
|
<!-- Disable warnings about the lack of equals() when compareTo() is implemented.
|
|
|
|
EQ_COMPARETO_USE_OBJECT_EQUALS: This class defines a compareTo method but no equals() method -->
|
|
|
|
<Bug pattern="EQ_COMPARETO_USE_OBJECT_EQUALS"/>
|
|
|
|
</Match>
|
|
|
|
|
2023-10-12 20:09:10 +08:00
|
|
|
<Match>
|
|
|
|
<!-- Disable warnings about constructors that throw exceptions.
|
|
|
|
CT_CONSTRUCTOR_THROW: Be wary of letting constructors throw exceptions -->
|
|
|
|
<Bug pattern="CT_CONSTRUCTOR_THROW"/>
|
|
|
|
</Match>
|
|
|
|
|
|
|
|
<Match>
|
|
|
|
<!-- Disable warnings about identifiers that conflict with standard library identifiers.
|
|
|
|
PI_DO_NOT_REUSE_PUBLIC_IDENTIFIERS_CLASS_NAMES: Do not reuse public identifiers from JSL as class name
|
|
|
|
PI_DO_NOT_REUSE_PUBLIC_IDENTIFIERS_FIELD_NAMES: Do not reuse public identifiers from JSL as field name
|
|
|
|
PI_DO_NOT_REUSE_PUBLIC_IDENTIFIERS_METHOD_NAMES: Do not reuse public identifiers from JSL as method name
|
|
|
|
-->
|
|
|
|
<Bug pattern="PI_DO_NOT_REUSE_PUBLIC_IDENTIFIERS_CLASS_NAMES,PI_DO_NOT_REUSE_PUBLIC_IDENTIFIERS_FIELD_NAMES,PI_DO_NOT_REUSE_PUBLIC_IDENTIFIERS_METHOD_NAMES"/>
|
|
|
|
</Match>
|
|
|
|
|
2017-04-07 19:29:48 +08:00
|
|
|
<Match>
|
2018-09-11 04:14:00 +08:00
|
|
|
<!-- Spotbugs tends to work a little bit better with Java than with Scala. We suppress
|
|
|
|
some categories of bug reports when using Scala, since spotbugs generates huge
|
2017-04-07 19:29:48 +08:00
|
|
|
numbers of false positives in some of these categories when examining Scala code.
|
|
|
|
|
|
|
|
NP_LOAD_OF_KNOWN_NULL_VALUE: The variable referenced at this point is known to be null
|
|
|
|
due to an earlier check against null.
|
|
|
|
NP_NULL_PARAM_DEREF: Method call passes null for non-null parameter.
|
|
|
|
NP_NULL_ON_SOME_PATH: Possible null pointer dereference
|
|
|
|
SE_BAD_FIELD: Non-transient non-serializable instance field in serializable class.
|
|
|
|
DM_STRING_CTOR: Method invokes inefficient new String(String) constructor.
|
|
|
|
DM_NEW_FOR_GETCLASS: Method allocates an object, only to get the class object.
|
|
|
|
ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD: Write to static field from instance method.
|
|
|
|
DM_NUMBER_CTOR: Method invokes inefficient Number constructor; use static valueOf instead.
|
|
|
|
RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE: Nullcheck of value previously dereferenced.
|
|
|
|
RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE: Redundant nullcheck of value known to be non-null.
|
|
|
|
RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE: Redundant nullcheck of value known to be null.
|
|
|
|
RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT: Return value of method without side effect is ignored.
|
|
|
|
NM_CLASS_NAMING_CONVENTION: Class names should start with an upper case letter.
|
2017-04-12 06:37:57 +08:00
|
|
|
NM_METHOD_NAMING_CONVENTION: Method names should start with a lower case letter.
|
|
|
|
EC_NULL_ARG: Call to equals(null)
|
|
|
|
NP_ALWAYS_NULL: Null pointer dereference
|
MINOR: Make the build compile with Scala 2.13 (#6989)
Scala 2.13 support was added to build via #5454. This PR adjusts the code so that
it compiles with 2.11, 2.12 and 2.13.
Changes:
* Add `scala-collection-compat` dependency.
* Import `scala.collection.Seq` in a number of places for consistent behavior between
Scala 2.11, 2.12 and 2.13.
* Remove wildcard imports that were causing the Java classes to have priority over the
Scala ones, related Scala issue: https://github.com/scala/scala/pull/6589.
* Replace parallel collection usage with `Future`. The former is no longer included by
default in the standard library.
* Replace val _: Unit workaround with one that is more concise and works with Scala 2.13
* Replace `filterKeys` with `filter` when we expect a `Map`. `filterKeys` returns a view
that doesn't implement the `Map` trait in Scala 2.13.
* Replace `mapValues` with `map` or add a `toMap` as an additional transformation
when we expect a `Map`. `mapValues` returns a view that doesn't implement the
`Map` trait in Scala 2.13.
* Replace `breakOut` with `iterator` and `to`, `breakOut` was removed in Scala
2.13.
* Replace to() with toMap, toIndexedSeq and toSet
* Replace `mutable.Buffer.--` with `filterNot`.
* ControlException is an abstract class in Scala 2.13.
* Variable arguments can only receive arrays or immutable.Seq in Scala 2.13.
* Use `Factory` instead of `CanBuildFrom` in DecodeJson. `CanBuildFrom` behaves
a bit differently in Scala 2.13 and it's been deprecated. `Factory` has the behavior
we need and it's available via the compat library.
* Fix failing tests due to behavior change in Scala 2.13,
"Map.values.map is not strict in Scala 2.13" (https://github.com/scala/bug/issues/11589).
* Use Java collections instead of Scala ones in StreamResetter (a Java class).
* Adjust CheckpointFile.write to take an `Iterable` instead of `Seq` to avoid
unnecessary collection copies.
* Fix DelayedElectLeader to use a Map instead of Set and avoid `to` call that
doesn't work in Scala 2.13.
* Use unordered map for mapping in SimpleAclAuthorizer, mapping of ordered
maps require an `Ordering` in Scala 2.13 for safety reasons.
* Adapt `ConsumerGroupCommand` to compile with Scala 2.13.
* CoreUtils.min takes an `Iterable` instead of `TraversableOnce`, the latter does
not exist in Scala 2.13.
* Replace `Unit` with `()` in a couple places. Scala 2.13 is stricter when it expects
a value instead of a type.
* Fix bug in CustomQuotaCallbackTest where we did not necessarily set `partitionRatio`
correctly, `forall` can terminate early.
* Add a couple of spotbugs exclusions that are needed by code generated by Scala 2.13
* Remove unused variables, simplify some code and remove procedure syntax in a few
places.
* Remove unused `CoreUtils.JSONEscapeString`.
Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>, José Armando García Sancio <jsancio@users.noreply.github.com>
2019-07-02 21:29:39 +08:00
|
|
|
MS_CANNOT_BE_FINAL: Field isn't final and can't be protected from malicious code
|
|
|
|
IC_INIT_CIRCULARITY: Initialization circularity
|
2023-10-12 20:09:10 +08:00
|
|
|
SE_NO_SUITABLE_CONSTRUCTOR: Class is Serializable but its superclass doesn't define a void constructor
|
|
|
|
PA_PUBLIC_MUTABLE_OBJECT_ATTRIBUTE: Mutable object-type field is public -->
|
2017-04-07 19:29:48 +08:00
|
|
|
<Source name="~.*\.scala" />
|
2017-04-12 06:37:57 +08:00
|
|
|
<Or>
|
|
|
|
<Bug pattern="NP_LOAD_OF_KNOWN_NULL_VALUE"/>
|
|
|
|
<Bug pattern="NP_NULL_ON_SOME_PATH"/>
|
|
|
|
<Bug pattern="NP_NULL_PARAM_DEREF"/>
|
|
|
|
<Bug pattern="SE_BAD_FIELD"/>
|
|
|
|
<Bug pattern="DM_STRING_CTOR"/>
|
|
|
|
<Bug pattern="DM_NEW_FOR_GETCLASS"/>
|
|
|
|
<Bug pattern="ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD"/>
|
|
|
|
<Bug pattern="DM_NUMBER_CTOR"/>
|
|
|
|
<Bug pattern="RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE"/>
|
|
|
|
<Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE"/>
|
|
|
|
<Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE"/>
|
|
|
|
<Bug pattern="RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT"/>
|
|
|
|
<Bug pattern="NM_CLASS_NAMING_CONVENTION"/>
|
|
|
|
<Bug pattern="NM_METHOD_NAMING_CONVENTION"/>
|
|
|
|
<Bug pattern="EC_NULL_ARG"/>
|
|
|
|
<Bug pattern="NP_ALWAYS_NULL"/>
|
|
|
|
<Bug pattern="MS_CANNOT_BE_FINAL"/>
|
MINOR: Make the build compile with Scala 2.13 (#6989)
Scala 2.13 support was added to build via #5454. This PR adjusts the code so that
it compiles with 2.11, 2.12 and 2.13.
Changes:
* Add `scala-collection-compat` dependency.
* Import `scala.collection.Seq` in a number of places for consistent behavior between
Scala 2.11, 2.12 and 2.13.
* Remove wildcard imports that were causing the Java classes to have priority over the
Scala ones, related Scala issue: https://github.com/scala/scala/pull/6589.
* Replace parallel collection usage with `Future`. The former is no longer included by
default in the standard library.
* Replace val _: Unit workaround with one that is more concise and works with Scala 2.13
* Replace `filterKeys` with `filter` when we expect a `Map`. `filterKeys` returns a view
that doesn't implement the `Map` trait in Scala 2.13.
* Replace `mapValues` with `map` or add a `toMap` as an additional transformation
when we expect a `Map`. `mapValues` returns a view that doesn't implement the
`Map` trait in Scala 2.13.
* Replace `breakOut` with `iterator` and `to`, `breakOut` was removed in Scala
2.13.
* Replace to() with toMap, toIndexedSeq and toSet
* Replace `mutable.Buffer.--` with `filterNot`.
* ControlException is an abstract class in Scala 2.13.
* Variable arguments can only receive arrays or immutable.Seq in Scala 2.13.
* Use `Factory` instead of `CanBuildFrom` in DecodeJson. `CanBuildFrom` behaves
a bit differently in Scala 2.13 and it's been deprecated. `Factory` has the behavior
we need and it's available via the compat library.
* Fix failing tests due to behavior change in Scala 2.13,
"Map.values.map is not strict in Scala 2.13" (https://github.com/scala/bug/issues/11589).
* Use Java collections instead of Scala ones in StreamResetter (a Java class).
* Adjust CheckpointFile.write to take an `Iterable` instead of `Seq` to avoid
unnecessary collection copies.
* Fix DelayedElectLeader to use a Map instead of Set and avoid `to` call that
doesn't work in Scala 2.13.
* Use unordered map for mapping in SimpleAclAuthorizer, mapping of ordered
maps require an `Ordering` in Scala 2.13 for safety reasons.
* Adapt `ConsumerGroupCommand` to compile with Scala 2.13.
* CoreUtils.min takes an `Iterable` instead of `TraversableOnce`, the latter does
not exist in Scala 2.13.
* Replace `Unit` with `()` in a couple places. Scala 2.13 is stricter when it expects
a value instead of a type.
* Fix bug in CustomQuotaCallbackTest where we did not necessarily set `partitionRatio`
correctly, `forall` can terminate early.
* Add a couple of spotbugs exclusions that are needed by code generated by Scala 2.13
* Remove unused variables, simplify some code and remove procedure syntax in a few
places.
* Remove unused `CoreUtils.JSONEscapeString`.
Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>, José Armando García Sancio <jsancio@users.noreply.github.com>
2019-07-02 21:29:39 +08:00
|
|
|
<Bug pattern="IC_INIT_CIRCULARITY"/>
|
|
|
|
<Bug pattern="SE_NO_SUITABLE_CONSTRUCTOR"/>
|
2022-10-25 01:41:31 +08:00
|
|
|
<Bug pattern="DMI_RANDOM_USED_ONLY_ONCE"/>
|
|
|
|
<Bug pattern="SSD_DO_NOT_USE_INSTANCE_LOCK_ON_SHARED_STATIC_DATA"/>
|
2023-10-12 20:09:10 +08:00
|
|
|
<Bug pattern="PA_PUBLIC_MUTABLE_OBJECT_ATTRIBUTE"/>
|
2017-04-12 06:37:57 +08:00
|
|
|
</Or>
|
2017-04-07 19:29:48 +08:00
|
|
|
</Match>
|
|
|
|
|
2023-10-12 20:09:10 +08:00
|
|
|
<Match>
|
|
|
|
<!-- disabled due to too many false positives
|
|
|
|
RV_EXCEPTION_NOT_THROWN: Exception created and dropped rather than thrown -->
|
|
|
|
<Bug pattern="RV_EXCEPTION_NOT_THROWN"/>
|
|
|
|
</Match>
|
|
|
|
|
2020-11-24 22:20:05 +08:00
|
|
|
<!-- false positive in Java 11, related to https://github.com/spotbugs/spotbugs/issues/756 but more complex -->
|
|
|
|
<Match>
|
2024-05-21 23:58:49 +08:00
|
|
|
<Class name="org.apache.kafka.common.compress.Lz4BlockOutputStream"/>
|
2020-11-24 22:20:05 +08:00
|
|
|
<Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE"/>
|
|
|
|
</Match>
|
|
|
|
|
2021-07-06 00:33:33 +08:00
|
|
|
<!-- false positive, see https://github.com/spotbugs/spotbugs/issues/1001 -->
|
|
|
|
<Match>
|
|
|
|
<Class name="org.apache.kafka.common.internals.KafkaFutureImpl"/>
|
|
|
|
<Bug pattern="NP_NONNULL_PARAM_VIOLATION"/>
|
|
|
|
</Match>
|
|
|
|
|
2017-04-07 19:29:48 +08:00
|
|
|
<Match>
|
2019-10-10 00:39:24 +08:00
|
|
|
<!-- Suppression for the equals() for extension methods. -->
|
|
|
|
<Class name="kafka.api.package$ElectLeadersRequestOps"/>
|
2017-04-07 19:29:48 +08:00
|
|
|
<Bug pattern="EQ_UNUSUAL"/>
|
|
|
|
</Match>
|
|
|
|
|
2020-09-22 07:04:19 +08:00
|
|
|
<Match>
|
|
|
|
<!-- Suppression for the equals() for extension methods. -->
|
|
|
|
<Class name="kafka.utils.Implicits$MapExtensionMethods"/>
|
|
|
|
<Bug pattern="EQ_UNUSUAL"/>
|
|
|
|
</Match>
|
|
|
|
|
2017-04-07 19:29:48 +08:00
|
|
|
<Match>
|
|
|
|
<!-- Add a suppression for auto-generated calls to instanceof in kafka.utils.Json -->
|
|
|
|
<Source name="Json.scala"/>
|
|
|
|
<Package name="kafka.utils"/>
|
|
|
|
<Bug pattern="BC_VACUOUS_INSTANCEOF"/>
|
|
|
|
</Match>
|
|
|
|
|
2019-10-10 00:39:24 +08:00
|
|
|
<Match>
|
|
|
|
<!-- A spurious null check after inlining by the scalac optimizer confuses spotBugs -->
|
|
|
|
<Class name="kafka.log.Log"/>
|
|
|
|
<Bug pattern="NP_NULL_ON_SOME_PATH_EXCEPTION"/>
|
|
|
|
</Match>
|
|
|
|
|
2020-11-25 02:28:53 +08:00
|
|
|
<Match>
|
|
|
|
<!-- Scala doesn't have checked exceptions so one cannot catch RuntimeException and rely
|
|
|
|
on the compiler to fail if the code is changed to call a method that throws Exception.
|
|
|
|
Given that, this bug pattern doesn't make sense for Scala code. -->
|
2023-10-16 21:37:30 +08:00
|
|
|
<Or>
|
|
|
|
<Class name="kafka.log.Log"/>
|
|
|
|
<Class name="kafka.log.LocalLog$"/>
|
|
|
|
</Or>
|
2020-11-25 02:28:53 +08:00
|
|
|
<Bug pattern="REC_CATCH_EXCEPTION"/>
|
|
|
|
</Match>
|
|
|
|
|
2019-10-10 00:39:24 +08:00
|
|
|
<Match>
|
2021-12-04 02:53:31 +08:00
|
|
|
<Or>
|
|
|
|
<!-- Unboxing to Int to make scalac happy makes spotBugs unhappy -->
|
|
|
|
<Class name="kafka.tools.ConsoleConsumer$ConsumerConfig"/>
|
|
|
|
<!-- Java's own Map#compute forces this pattern on us -->
|
|
|
|
<Class name="org.apache.kafka.streams.query.Position"/>
|
|
|
|
</Or>
|
2019-10-10 00:39:24 +08:00
|
|
|
<Bug pattern="BX_UNBOXING_IMMEDIATELY_REBOXED"/>
|
|
|
|
</Match>
|
|
|
|
|
2020-03-19 00:33:14 +08:00
|
|
|
<Match>
|
|
|
|
<!-- offsets is a lazy val and it confuses spotBugs with its locking scheme -->
|
|
|
|
<Class name="kafka.server.checkpoints.LazyOffsetCheckpointMap"/>
|
|
|
|
<Bug pattern="IS2_INCONSISTENT_SYNC"/>
|
|
|
|
</Match>
|
2019-10-10 00:39:24 +08:00
|
|
|
|
2020-07-03 17:41:45 +08:00
|
|
|
<Match>
|
|
|
|
<!-- Keeping this class for compatibility. It's deprecated and will be removed in the next major release -->
|
|
|
|
<Source name="MessageFormatter.scala"/>
|
|
|
|
<Package name="kafka.common"/>
|
|
|
|
<Bug pattern="NM_SAME_SIMPLE_NAME_AS_INTERFACE"/>
|
|
|
|
</Match>
|
|
|
|
|
2017-03-22 07:48:26 +08:00
|
|
|
<Match>
|
|
|
|
<!-- Suppress a warning about some static initializers in Schema using instances of a
|
|
|
|
subclass. -->
|
|
|
|
<Or>
|
|
|
|
<Class name="org.apache.kafka.connect.data.Schema"/>
|
|
|
|
<Class name="org.apache.kafka.connect.data.SchemaBuilder"/>
|
|
|
|
</Or>
|
|
|
|
<Bug pattern="IC_SUPERCLASS_USES_SUBCLASS_DURING_INITIALIZATION"/>
|
|
|
|
</Match>
|
|
|
|
|
|
|
|
<Match>
|
|
|
|
<!-- Suppress warnings about unread protected fields in some public classes.
|
|
|
|
Although these are not read in Kafka Connect code, they are part of the API. -->
|
|
|
|
<Or>
|
|
|
|
<Class name="org.apache.kafka.connect.connector.Connector"/>
|
|
|
|
<Class name="org.apache.kafka.connect.sink.SinkTask"/>
|
|
|
|
<Class name="org.apache.kafka.connect.source.SourceTask"/>
|
|
|
|
</Or>
|
|
|
|
<Bug pattern="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD"/>
|
|
|
|
</Match>
|
|
|
|
|
|
|
|
<Match>
|
|
|
|
<!-- Suppress warnings about converting an integer number of
|
|
|
|
milliseconds to a java.util.Date object. We do this intentionally in
|
|
|
|
org.apache.kafka.connect.data.Time. -->
|
|
|
|
<Class name="org.apache.kafka.connect.data.Time"/>
|
|
|
|
<Method name="toLogical"/>
|
|
|
|
<Bug pattern="ICAST_INT_2_LONG_AS_INSTANT"/>
|
|
|
|
</Match>
|
2017-03-29 23:22:39 +08:00
|
|
|
|
2022-03-03 21:28:50 +08:00
|
|
|
<Match>
|
|
|
|
<!-- Suppress warning about missing reflexive and symmetric properties of equal.
|
|
|
|
This equals method is used as a value filter for Jackson. -->
|
|
|
|
<Class name="org.apache.kafka.connect.runtime.rest.entities.PluginInfo$NoVersionFilter"/>
|
|
|
|
<Method name="equals"/>
|
|
|
|
<Bug pattern="EQ_CHECK_FOR_OPERAND_NOT_COMPATIBLE_WITH_THIS"/>
|
|
|
|
</Match>
|
|
|
|
|
2023-10-20 21:52:37 +08:00
|
|
|
<Match>
|
|
|
|
<!-- Suppress aggressive and unnecessary warnings about switch fallthrough -->
|
|
|
|
<Class name="org.apache.kafka.connect.runtime.rest.resources.LoggingResource" />
|
|
|
|
<Method name="setLevel" />
|
|
|
|
<Bug pattern="SF_SWITCH_FALLTHROUGH" />
|
|
|
|
</Match>
|
|
|
|
|
2024-05-24 04:23:18 +08:00
|
|
|
<Match>
|
|
|
|
<!-- Converting to an optional boolean intentionally returns null on null input. -->
|
|
|
|
<Class name="org.apache.kafka.connect.data.Values"/>
|
|
|
|
<Method name="convertToBoolean"/>
|
|
|
|
<Bug pattern="NP_BOOLEAN_RETURN_NULL"/>
|
|
|
|
</Match>
|
|
|
|
|
2017-03-29 23:22:39 +08:00
|
|
|
<Match>
|
2020-12-11 09:56:52 +08:00
|
|
|
<!-- Suppress some minor warnings about machine-generated code for benchmarking. -->
|
|
|
|
<Package name="~org\.apache\.kafka\.jmh\..*\.jmh_generated"/>
|
2017-03-29 23:22:39 +08:00
|
|
|
</Match>
|
2017-04-04 08:57:12 +08:00
|
|
|
|
2023-10-12 20:09:10 +08:00
|
|
|
<Match>
|
|
|
|
<!-- JMH benchmarks often have fields that are modified by the framework.
|
|
|
|
SS_SHOULD_BE_STATIC: Unread field: should this field be static? -->
|
|
|
|
<Package name="~org\.apache\.kafka\.jmh\..*"/>
|
|
|
|
<Bug pattern="SS_SHOULD_BE_STATIC"/>
|
|
|
|
</Match>
|
|
|
|
|
2019-01-12 08:40:21 +08:00
|
|
|
<Match>
|
|
|
|
<!-- Suppress warnings about generated schema arrays. -->
|
KAFKA-8868: Generate SubscriptionInfo protocol message (#7248)
Rather than maintain hand coded protocol serialization code, Streams could use the same code-generation framework as Clients/Core.
There isn't a perfect match, since the code generation framework includes an assumption that you're generating "protocol messages", rather than just arbitrary blobs, but I think it's close enough to justify using it, and improving it over time.
Using the code generation allows us to drop a lot of detail-oriented, brittle, and hard-to-maintain serialization logic in favor of a schema spec.
Reviewers: Colin P. McCabe <cmccabe@apache.org>, Boyang Chen <boyang@confluent.io>, Bill Bejeck <bill@confluent.io>, Guozhang Wang <wangguoz@gmail.com>
2019-11-02 01:03:55 +08:00
|
|
|
<Or>
|
|
|
|
<Package name="org.apache.kafka.common.message"/>
|
|
|
|
<Package name="org.apache.kafka.streams.internals.generated"/>
|
2020-11-18 14:49:04 +08:00
|
|
|
<Package name="kafka.internals.generated"/>
|
KAFKA-8868: Generate SubscriptionInfo protocol message (#7248)
Rather than maintain hand coded protocol serialization code, Streams could use the same code-generation framework as Clients/Core.
There isn't a perfect match, since the code generation framework includes an assumption that you're generating "protocol messages", rather than just arbitrary blobs, but I think it's close enough to justify using it, and improving it over time.
Using the code generation allows us to drop a lot of detail-oriented, brittle, and hard-to-maintain serialization logic in favor of a schema spec.
Reviewers: Colin P. McCabe <cmccabe@apache.org>, Boyang Chen <boyang@confluent.io>, Bill Bejeck <bill@confluent.io>, Guozhang Wang <wangguoz@gmail.com>
2019-11-02 01:03:55 +08:00
|
|
|
</Or>
|
2019-01-12 08:40:21 +08:00
|
|
|
<Bug pattern="MS_MUTABLE_ARRAY"/>
|
|
|
|
</Match>
|
|
|
|
|
2017-04-04 08:57:12 +08:00
|
|
|
<Match>
|
|
|
|
<!-- Suppress warnings about ignoring the return value of await.
|
|
|
|
This is done intentionally because we use other clues to determine
|
|
|
|
if the wait was cut short. -->
|
2022-06-13 22:25:29 +08:00
|
|
|
<Class name="org.apache.kafka.connect.runtime.AbstractWorkerSourceTask"/>
|
2017-04-04 08:57:12 +08:00
|
|
|
<Method name="execute"/>
|
|
|
|
<Bug pattern="RV_RETURN_VALUE_IGNORED"/>
|
|
|
|
</Match>
|
|
|
|
|
2017-04-12 06:37:57 +08:00
|
|
|
<Match>
|
|
|
|
<!-- Suppress a warning about ignoring the return value of await.
|
|
|
|
This is done intentionally because we use other clues to determine
|
|
|
|
if the wait was cut short. -->
|
|
|
|
<Package name="kafka.log"/>
|
|
|
|
<Source name="LogCleanerManager.scala"/>
|
|
|
|
<Bug pattern="RV_RETURN_VALUE_IGNORED,RV_RETURN_VALUE_IGNORED_BAD_PRACTICE"/>
|
|
|
|
</Match>
|
|
|
|
|
2017-04-04 08:57:12 +08:00
|
|
|
<Match>
|
|
|
|
<!-- Suppress some warnings about intentional switch statement fallthrough. -->
|
|
|
|
<Class name="org.apache.kafka.connect.runtime.WorkerConnector"/>
|
|
|
|
<Or>
|
|
|
|
<Method name="doStart"/>
|
|
|
|
</Or>
|
|
|
|
<Bug pattern="SF_SWITCH_FALLTHROUGH"/>
|
|
|
|
</Match>
|
|
|
|
|
2017-04-06 05:17:32 +08:00
|
|
|
<Match>
|
|
|
|
<!-- Suppress a warning about intentional switch statement fallthrough. -->
|
|
|
|
<Class name="org.apache.kafka.common.security.authenticator.SaslClientAuthenticator"/>
|
|
|
|
<Method name="authenticate"/>
|
|
|
|
<Bug pattern="SF_SWITCH_FALLTHROUGH"/>
|
|
|
|
</Match>
|
|
|
|
|
2022-12-20 11:33:24 +08:00
|
|
|
<Match>
|
|
|
|
<!-- False positive - the volatile read is guarded by a lock. -->
|
2023-02-08 11:52:42 +08:00
|
|
|
<Class name="org.apache.kafka.storage.internals.log.AbstractIndex"/>
|
2022-12-20 11:33:24 +08:00
|
|
|
<Method name="incrementEntries"/>
|
|
|
|
<Bug pattern="VO_VOLATILE_INCREMENT"/>
|
|
|
|
</Match>
|
|
|
|
|
2023-01-11 15:51:58 +08:00
|
|
|
<Match>
|
|
|
|
<!-- False positive - `ScheduledThreadPoolExecutor.getQueue()` specifies via its javadoc that its elements are of type `ScheduledFuture` -->
|
|
|
|
<Class name="org.apache.kafka.server.util.KafkaScheduler"/>
|
|
|
|
<Method name="taskRunning"/>
|
|
|
|
<Bug pattern="GC_UNRELATED_TYPES"/>
|
|
|
|
</Match>
|
|
|
|
|
2017-04-06 05:17:32 +08:00
|
|
|
<Match>
|
|
|
|
<!-- Suppress a spurious warning about a missing default case. -->
|
|
|
|
<Or>
|
|
|
|
<Class name="org.apache.kafka.common.utils.Crc32"/>
|
|
|
|
<Class name="org.apache.kafka.common.utils.PureJavaCrc32C"/>
|
|
|
|
</Or>
|
|
|
|
<Method name="update"/>
|
|
|
|
<Bug pattern="SF_SWITCH_NO_DEFAULT"/>
|
|
|
|
</Match>
|
|
|
|
|
|
|
|
<Match>
|
|
|
|
<!-- Suppress a warning about intentional missing default cases and fallthroughs. -->
|
|
|
|
<Class name="org.apache.kafka.common.utils.Utils"/>
|
|
|
|
<Method name="murmur2"/>
|
|
|
|
<Or>
|
|
|
|
<Bug pattern="SF_SWITCH_NO_DEFAULT"/>
|
|
|
|
<Bug pattern="SF_SWITCH_FALLTHROUGH"/>
|
|
|
|
</Or>
|
|
|
|
</Match>
|
|
|
|
|
2019-09-20 06:36:32 +08:00
|
|
|
<Match>
|
|
|
|
<!-- Suppress a warning about intentional missing default cases and fallthroughs. -->
|
2019-09-20 07:38:18 +08:00
|
|
|
<Class name="org.apache.kafka.streams.state.internals.Murmur3"/>
|
2019-09-20 06:36:32 +08:00
|
|
|
<Or>
|
|
|
|
<Bug pattern="SF_SWITCH_NO_DEFAULT"/>
|
|
|
|
<Bug pattern="SF_SWITCH_FALLTHROUGH"/>
|
|
|
|
</Or>
|
|
|
|
</Match>
|
|
|
|
|
|
|
|
|
|
|
|
<Match>
|
|
|
|
<!-- Suppress a warning about intentional missing default cases and fallthroughs. -->
|
2019-09-20 07:38:18 +08:00
|
|
|
<Class name="org.apache.kafka.streams.state.internals.Murmur3$IncrementalHash32"/>
|
2019-09-20 06:36:32 +08:00
|
|
|
<Or>
|
|
|
|
<Bug pattern="SF_SWITCH_NO_DEFAULT"/>
|
|
|
|
<Bug pattern="SF_SWITCH_FALLTHROUGH"/>
|
|
|
|
</Or>
|
|
|
|
</Match>
|
|
|
|
|
2023-10-12 20:09:10 +08:00
|
|
|
<Match>
|
|
|
|
<!-- Public mutable fields are intentional in some Streams classes.
|
|
|
|
PA_PUBLIC_PRIMITIVE_ATTRIBUTE: Primitive field is public -->
|
|
|
|
<Or>
|
|
|
|
<Class name="org.apache.kafka.streams.kstream.Materialized"/>
|
|
|
|
<Class name="org.apache.kafka.streams.state.internals.LeftOrRightValueDeserializer"/>
|
|
|
|
</Or>
|
|
|
|
<Bug pattern="PA_PUBLIC_PRIMITIVE_ATTRIBUTE"/>
|
|
|
|
</Match>
|
|
|
|
|
2017-04-06 05:17:32 +08:00
|
|
|
<Match>
|
|
|
|
<!-- Suppress a spurious warning about locks not being released on all paths.
|
|
|
|
This happens because there is an 'if' statement that checks if we have the lock before
|
|
|
|
releasing it. -->
|
|
|
|
<Class name="org.apache.kafka.clients.producer.internals.BufferPool"/>
|
|
|
|
<Method name="allocate"/>
|
|
|
|
<Bug pattern="UL_UNRELEASED_LOCK"/>
|
|
|
|
</Match>
|
|
|
|
|
|
|
|
<Match>
|
|
|
|
<!-- Suppress warnings about synchronizing on the UnsentRequests
|
|
|
|
ConcurrentHashMap. This is done deliberately. -->
|
|
|
|
<Package name="org.apache.kafka.clients.consumer.internals"/>
|
|
|
|
<Source name="ConsumerNetworkClient.java"/>
|
|
|
|
<Bug pattern="JLM_JSR166_UTILCONCURRENT_MONITORENTER"/>
|
|
|
|
</Match>
|
|
|
|
|
|
|
|
<Match>
|
|
|
|
<!-- Suppress inconsistent synchronization warnings about
|
|
|
|
AbstractCoordinator#coordinator. See KAFKA-4992 for details.-->
|
|
|
|
<Class name="org.apache.kafka.clients.consumer.internals.AbstractCoordinator"/>
|
|
|
|
<Bug pattern="IS2_INCONSISTENT_SYNC"/>
|
|
|
|
</Match>
|
2017-04-07 06:59:16 +08:00
|
|
|
|
2021-02-05 06:46:57 +08:00
|
|
|
<Match>
|
|
|
|
<!-- Suppress a warning about ignoring the return value of await.
|
|
|
|
This is done intentionally because we use other clues to determine
|
|
|
|
if the wait was cut short. -->
|
|
|
|
<Package name="org.apache.kafka.queue"/>
|
|
|
|
<Source name="KafkaEventQueue.java"/>
|
|
|
|
<Bug pattern="RV_RETURN_VALUE_IGNORED,RV_RETURN_VALUE_IGNORED_BAD_PRACTICE"/>
|
|
|
|
</Match>
|
|
|
|
|
2017-04-07 06:59:16 +08:00
|
|
|
<Match>
|
|
|
|
<!-- Suppress warnings about implementing compareTo but not equals. -->
|
|
|
|
<Class name="org.apache.kafka.streams.processor.internals.Stamped"/>
|
|
|
|
<Bug pattern="EQ_COMPARETO_USE_OBJECT_EQUALS"/>
|
|
|
|
</Match>
|
|
|
|
|
|
|
|
<Match>
|
2020-07-01 01:15:28 +08:00
|
|
|
<!-- Suppress warning about applicationID that gets initialized before
|
|
|
|
any other threads are created, but is used in synchronized and
|
|
|
|
unsynchronized methods because it comes from the configs,
|
|
|
|
passed through rewriteTopology. -->
|
2017-04-07 06:59:16 +08:00
|
|
|
<Package name="org.apache.kafka.streams.processor.internals"/>
|
2020-07-01 01:15:28 +08:00
|
|
|
<Source name="InternalTopologyBuilder.java"/>
|
|
|
|
<Bug pattern="IS2_INCONSISTENT_SYNC"/>
|
2017-04-07 06:59:16 +08:00
|
|
|
</Match>
|
2017-04-12 06:37:57 +08:00
|
|
|
|
|
|
|
<Match>
|
|
|
|
<!-- Ignore a warning about synchronizing on an AtomicBoolean -->
|
|
|
|
<Package name="kafka.metrics"/>
|
|
|
|
<Source name="KafkaMetricsReporter.scala"/>
|
|
|
|
<Method name="startReporters"/>
|
|
|
|
<Bug pattern="JLM_JSR166_UTILCONCURRENT_MONITORENTER"/>
|
|
|
|
</Match>
|
|
|
|
|
2017-04-28 05:11:17 +08:00
|
|
|
<Match>
|
|
|
|
<!-- Ignore spurious warning about imbalanced synchronization on a cached Exception. Some accesses of the
|
|
|
|
variable must occur in synchronized blocks, while some need not, because of the nature of the producer.
|
|
|
|
This seems to throw the static checker off. -->
|
|
|
|
<Package name="org.apache.kafka.clients.producer" />
|
|
|
|
<Source name="TransactionState.java" />
|
|
|
|
<Bug pattern="IS2_INCONSISTENT_SYNC" />
|
|
|
|
</Match>
|
|
|
|
|
2024-07-16 19:15:38 +08:00
|
|
|
<Match>
|
|
|
|
<!-- Ignore spurious warning about inconsistent synchronization on a currentFetch.
|
|
|
|
Locking is consistent but does not use synchronized methods. All accesses
|
|
|
|
are performed in the application thread once it has acquired the lock. -->
|
|
|
|
<Package name="org.apache.kafka.clients.consumer.internals" />
|
|
|
|
<Source name="ShareConsumerImpl.java" />
|
|
|
|
<Bug pattern="IS2_INCONSISTENT_SYNC" />
|
|
|
|
</Match>
|
|
|
|
|
2017-04-12 06:37:57 +08:00
|
|
|
<Match>
|
|
|
|
<!-- Suppress a spurious warning about an unreleased lock. -->
|
|
|
|
<Class name="kafka.utils.timer.SystemTimer"/>
|
|
|
|
<Method name="add"/>
|
|
|
|
<Bug pattern="UL_UNRELEASED_LOCK_EXCEPTION_PATH"/>
|
|
|
|
</Match>
|
|
|
|
|
KAFKA-6060; Add workload generation capabilities to Trogdor
Previously, Trogdor only handled "Faults." Now, Trogdor can handle
"Tasks" which may be either faults, or workloads to execute in the
background.
The Agent and Coordinator have been refactored from a
mutexes-and-condition-variables paradigm into a message passing
paradigm. No locks are necessary, because only one thread can access
the task state or worker state. This makes them a lot easier to reason
about.
The MockTime class can now handle mocking deferred message passing
(adding a message to an ExecutorService with a delay). I added a
MockTimeTest.
MiniTrogdorCluster now starts up Agent and Coordinator classes in
paralle in order to minimize junit test time.
RPC messages now inherit from a common Message.java class. This class
handles implementing serialization, equals, hashCode, etc.
Remove FaultSet, since it is no longer necessary.
Previously, if CoordinatorClient or AgentClient hit a networking
problem, they would throw an exception. They now retry several times
before giving up. Additionally, the REST RPCs to the Coordinator and
Agent have been changed to be idempotent. If a response is lost, and
the request is resent, no harm will be done.
Author: Colin P. Mccabe <cmccabe@confluent.io>
Reviewers: Rajini Sivaram <rajinisivaram@googlemail.com>, Ismael Juma <ismael@juma.me.uk>
Closes #4073 from cmccabe/KAFKA-6060
2017-11-03 17:37:29 +08:00
|
|
|
<Match>
|
|
|
|
<!-- Suppress a spurious warning about calling notify without modifying
|
|
|
|
other state under the monitor. -->
|
|
|
|
<Package name="org.apache.kafka.trogdor.workload"/>
|
|
|
|
<Source name="RoundTripWorker.java"/>
|
|
|
|
<Bug pattern="NN_NAKED_NOTIFY"/>
|
|
|
|
</Match>
|
2018-04-24 04:33:35 +08:00
|
|
|
|
2018-09-20 00:10:15 +08:00
|
|
|
<Match>
|
|
|
|
<Package name="org.apache.kafka.streams.scala"/>
|
|
|
|
<Source name="FunctionsCompatConversions.scala"/>
|
|
|
|
<Bug pattern="EQ_UNUSUAL"/>
|
2018-04-24 04:33:35 +08:00
|
|
|
</Match>
|
|
|
|
|
|
|
|
- <Match>
|
|
|
|
<Package name="org.apache.kafka.streams.scala"/>
|
|
|
|
<Or>
|
|
|
|
<Class name="org.apache.kafka.streams.scala.Serializer" />
|
|
|
|
<Class name="org.apache.kafka.streams.scala.Deserializer" />
|
|
|
|
</Or>
|
|
|
|
<Bug pattern="NM_SAME_SIMPLE_NAME_AS_INTERFACE"/>
|
|
|
|
</Match>
|
2018-09-01 04:13:42 +08:00
|
|
|
|
|
|
|
<!-- Suppress warnings for unused members that are undetectably used by Jackson -->
|
|
|
|
<Match>
|
|
|
|
<Package name="org.apache.kafka.streams.examples.pageview"/>
|
|
|
|
<Bug pattern="NP_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD"/>
|
|
|
|
</Match>
|
|
|
|
<Match>
|
|
|
|
<Package name="org.apache.kafka.streams.examples.pageview"/>
|
|
|
|
<Bug pattern="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD"/>
|
|
|
|
</Match>
|
|
|
|
<Match>
|
|
|
|
<Package name="org.apache.kafka.streams.examples.pageview"/>
|
|
|
|
<Bug pattern="UWF_UNWRITTEN_PUBLIC_OR_PROTECTED_FIELD"/>
|
|
|
|
</Match>
|
|
|
|
|
|
|
|
<!-- END Suppress warnings for unused members that are undetectably used by Jackson -->
|
|
|
|
|
2023-02-16 10:07:47 +08:00
|
|
|
<Match>
|
|
|
|
<!-- Boolean deserializer intentionally returns null on null input. -->
|
2023-03-24 23:41:51 +08:00
|
|
|
<Class name="org.apache.kafka.common.serialization.BooleanDeserializer"/>
|
2023-02-16 10:07:47 +08:00
|
|
|
<Method name="deserialize"/>
|
|
|
|
<Bug pattern="NP_BOOLEAN_RETURN_NULL"/>
|
|
|
|
</Match>
|
|
|
|
|
2023-11-28 16:29:00 +08:00
|
|
|
<Match>
|
|
|
|
<!-- False positive - null is allow in SortedMap -->
|
|
|
|
<Class name="org.apache.kafka.streams.processor.internals.assignment.Graph"/>
|
|
|
|
<Bug pattern="NP_NONNULL_PARAM_VIOLATION"/>
|
|
|
|
</Match>
|
|
|
|
|
2019-06-03 19:43:11 +08:00
|
|
|
<Match>
|
|
|
|
<!-- Suppress a warning about ignoring return value because this is intentional. -->
|
|
|
|
<Class name="org.apache.kafka.common.config.AbstractConfig$ResolvingMap"/>
|
|
|
|
<Method name="get"/>
|
|
|
|
<Bug pattern="RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT"/>
|
|
|
|
</Match>
|
|
|
|
|
2022-12-22 08:57:02 +08:00
|
|
|
<Match>
|
|
|
|
<!-- False positive - the field is used in other modules and its unit test -->
|
|
|
|
<Class name="org.apache.kafka.common.utils.PrimitiveRef$LongRef"/>
|
|
|
|
<Field name="value"/>
|
|
|
|
<Bug pattern="URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD"/>
|
|
|
|
</Match>
|
|
|
|
|
2020-03-03 04:21:09 +08:00
|
|
|
<Match>
|
|
|
|
<!-- Suppress warnings related to jmh generated code -->
|
|
|
|
<Package name="org.apache.kafka.jmh.acl.generated"/>
|
|
|
|
</Match>
|
2020-03-17 00:30:48 +08:00
|
|
|
|
|
|
|
<Match>
|
|
|
|
<!-- Suppress warnings related to jmh generated code -->
|
|
|
|
<Package name="org.apache.kafka.jmh.metadata.generated"/>
|
|
|
|
</Match>
|
|
|
|
|
2022-09-23 15:45:15 +08:00
|
|
|
<Match>
|
|
|
|
<Package name="org.apache.kafka.common.security.oauthbearer.secured" />
|
|
|
|
<Bug pattern="NM_SAME_SIMPLE_NAME_AS_SUPERCLASS"/>
|
|
|
|
</Match>
|
|
|
|
|
2023-05-05 20:05:20 +08:00
|
|
|
<Match>
|
|
|
|
<Class name="org.apache.kafka.jmh.util.ByteUtilsBenchmark$BaseBenchmarkState" />
|
|
|
|
<!-- Suppress warning because JMH code is used to instantiate Random() once per Trial. This is done to ensure
|
|
|
|
that all benchmarks run with same seed for Random. -->
|
|
|
|
<Bug pattern="DMI_RANDOM_USED_ONLY_ONCE"/>
|
|
|
|
</Match>
|
|
|
|
|
2023-09-11 15:58:20 +08:00
|
|
|
<Match>
|
|
|
|
<!-- Suppress a warning about await not being in a loop - we expect the loop to be outside the method. -->
|
|
|
|
<Class name="org.apache.kafka.streams.processor.internals.tasks.DefaultTaskManager"/>
|
|
|
|
<Bug pattern="WA_AWAIT_NOT_IN_LOOP"/>
|
|
|
|
</Match>
|
|
|
|
|
2023-11-15 21:00:40 +08:00
|
|
|
<Match>
|
|
|
|
<!-- Suppress the warnings about the caller not using the return value from Consumer. KafkaConsumer now
|
|
|
|
delegates all API calls to an internal instance of Consumer, which confuses SpotBugs. -->
|
|
|
|
<Or>
|
|
|
|
<Class name="org.apache.kafka.tools.ClientCompatibilityTest"/>
|
|
|
|
<Class name="org.apache.kafka.tools.StreamsResetter"/>
|
|
|
|
</Or>
|
|
|
|
<Bug pattern="RV_RETURN_VALUE_IGNORED_NO_SIDE_EFFECT"/>
|
|
|
|
</Match>
|
|
|
|
|
2017-03-01 07:04:02 +08:00
|
|
|
</FindBugsFilter>
|