blob: 014f9a9bf0763e6eb1d790653b5081f34a4cf20d [file] [log] [blame]
Kristen Kozakb27b1c72017-04-12 16:38:04 -07001<FindBugsFilter>
2 <Match>
3 <!-- Reason: Null has a different meaning than a zero-length array in this case. -->
4 <Bug pattern="PZLA_PREFER_ZERO_LENGTH_ARRAYS"/>
Bogdan Drutu709d97a2018-05-30 16:32:34 -07005 <Class name="io.opencensus.stats.MutableDistribution"/>
6 <Method name="getInternalBucketCountsArray"/>
Kristen Kozakb27b1c72017-04-12 16:38:04 -07007 </Match>
Bogdan Drutu286ab5a2017-06-28 13:33:44 +02008 <Match>
9 <!-- Reason: Equal is implemented in the AutoValue generated class. -->
10 <Bug pattern="EQ_COMPARETO_USE_OBJECT_EQUALS"/>
Bogdan Drutu709d97a2018-05-30 16:32:34 -070011 <Class name="io.opencensus.common.Timestamp"/>
12 <Method name="compareTo"/>
Bogdan Drutu286ab5a2017-06-28 13:33:44 +020013 </Match>
Yang Song36a87b82017-09-05 16:11:21 -070014 <Match>
15 <!-- Reason: Equal is implemented in the AutoValue generated class. -->
16 <Bug pattern="EQ_COMPARETO_USE_OBJECT_EQUALS"/>
Bogdan Drutu709d97a2018-05-30 16:32:34 -070017 <Class name="io.opencensus.common.Duration"/>
18 <Method name="compareTo"/>
Yang Song36a87b82017-09-05 16:11:21 -070019 </Match>
Kristen Kozakdc0ed0b2017-12-18 22:21:10 -080020 <Match>
Hailong Wen131b6f02018-02-16 15:09:17 +080021 <!-- Reason: BaseMessageEvent only has two visible subclasses. -->
22 <Bug pattern="BC_UNCONFIRMED_CAST"/>
Bogdan Drutu709d97a2018-05-30 16:32:34 -070023 <Class name="io.opencensus.trace.internal.BaseMessageEventUtils"/>
Hailong Wen131b6f02018-02-16 15:09:17 +080024 </Match>
Kristen Kozakba8aea82018-04-03 16:37:22 -070025 <Match>
26 <!-- Reason: This test is testing for a NPE. -->
27 <Bug pattern="NP_NONNULL_PARAM_VIOLATION"/>
Bogdan Drutu709d97a2018-05-30 16:32:34 -070028 <Class name="io.opencensus.internal.UtilsTest"/>
29 <Method name="checkNotNull"/>
Kristen Kozakba8aea82018-04-03 16:37:22 -070030 </Match>
Kristen Kozak5d5b0f52018-04-03 16:37:22 -070031 <Match>
Bogdan Drutueabc8002018-08-28 14:40:27 -070032 <!-- Reason: This test is testing for a NPE. -->
33 <Bug pattern="NP_NONNULL_PARAM_VIOLATION"/>
34 <Class name="io.opencensus.internal.UtilsTest"/>
35 <Method name="checkNotNull_NullErrorMessage"/>
36 </Match>
37 <Match>
Kristen Kozak5d5b0f52018-04-03 16:37:22 -070038 <!-- Reason: It seems like FindBugs incorrectly assumes that all -->
39 <!-- Throwables are subclasses of Error or Exception. -->
40 <Bug pattern="BC_VACUOUS_INSTANCEOF"/>
Bogdan Drutu709d97a2018-05-30 16:32:34 -070041 <Class name="io.opencensus.trace.CurrentSpanUtils$CallableInSpan"/>
42 <Method name="call"/>
43 </Match>
44 <Match>
45 <!-- Reason: Protobuf auto-generated code. -->
46 <Bug pattern="UCF_USELESS_CONTROL_FLOW"/>
47 <Class name="io.opencensus.contrib.appengine.standard.util.TraceIdProto$Builder"/>
48 <Method name="maybeForceBuilderInitialization"/>
Kristen Kozak5d5b0f52018-04-03 16:37:22 -070049 </Match>
Bogdan Drutu847bdcb2018-08-20 16:38:36 -070050 <Match>
51 <!-- Reason: The synchronization in the setState is for the side effects not for the state. -->
52 <Bug pattern="UG_SYNC_SET_UNSYNC_GET"/>
53 <Class name="io.opencensus.implcore.stats.StatsComponentImplBase"/>
54 </Match>
Kristen Kozak60b59262018-02-26 19:07:49 -080055
Kristen Kozakcc7c7e12018-03-23 15:14:29 -070056 <!-- Suppress some FindBugs warnings related to performance or robustness -->
57 <!-- in test classes, where those issues are less important. -->
58 <Match>
59 <!-- Reason: Only needed for performance. -->
60 <Bug pattern="SIC_INNER_SHOULD_BE_STATIC_ANON"/>
Bogdan Drutu709d97a2018-05-30 16:32:34 -070061 <Source name="~.*Test\.java"/>
Kristen Kozakcc7c7e12018-03-23 15:14:29 -070062 </Match>
63 <Match>
64 <!-- Reason: Only needed for performance. -->
65 <Bug pattern="WMI_WRONG_MAP_ITERATOR"/>
Bogdan Drutu709d97a2018-05-30 16:32:34 -070066 <Source name="~.*Test\.java"/>
Kristen Kozakcc7c7e12018-03-23 15:14:29 -070067 </Match>
68 <Match>
69 <!-- Reason: Only needed for performance. -->
70 <Bug pattern="UM_UNNECESSARY_MATH"/>
Bogdan Drutu709d97a2018-05-30 16:32:34 -070071 <Source name="~.*Test\.java"/>
Kristen Kozakcc7c7e12018-03-23 15:14:29 -070072 </Match>
73 <Match>
74 <!-- Reason: This is less important in a test environment. -->
75 <Bug pattern="DP_CREATE_CLASSLOADER_INSIDE_DO_PRIVILEGED"/>
Bogdan Drutu709d97a2018-05-30 16:32:34 -070076 <Source name="~.*Test\.java"/>
Kristen Kozakcc7c7e12018-03-23 15:14:29 -070077 </Match>
78 <Match>
79 <!-- Reason: Many classes initialize fields in @Before methods. -->
80 <Bug pattern="UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR"/>
Bogdan Drutu709d97a2018-05-30 16:32:34 -070081 <Source name="~.*Test\.java"/>
Kristen Kozakcc7c7e12018-03-23 15:14:29 -070082 </Match>
83
84 <!-- Suppress all FindBugs warnings about NullPointerExceptions in -->
85 <!-- non-test code. They are redundant with the Checker Framework's -->
86 <!-- warnings, and they sometimes conflict. These warnings are still -->
87 <!-- useful in test code, where we don't use the Checker Framework. -->
Kristen Kozak60b59262018-02-26 19:07:49 -080088 <Match>
89 <Bug code="NP"/>
Kristen Kozakcc7c7e12018-03-23 15:14:29 -070090 <Not>
Bogdan Drutu709d97a2018-05-30 16:32:34 -070091 <Source name="~.*Test\.java"/>
Kristen Kozakcc7c7e12018-03-23 15:14:29 -070092 </Not>
Kristen Kozak60b59262018-02-26 19:07:49 -080093 </Match>
94 <Match>
95 <Bug pattern="UR_UNINIT_READ"/>
Kristen Kozakcc7c7e12018-03-23 15:14:29 -070096 <Not>
Bogdan Drutu709d97a2018-05-30 16:32:34 -070097 <Source name="~.*Test\.java"/>
Kristen Kozakcc7c7e12018-03-23 15:14:29 -070098 </Not>
Kristen Kozak60b59262018-02-26 19:07:49 -080099 </Match>
100 <Match>
101 <Bug pattern="UWF_FIELD_NOT_INITIALIZED_IN_CONSTRUCTOR"/>
Kristen Kozakcc7c7e12018-03-23 15:14:29 -0700102 <Not>
Bogdan Drutu709d97a2018-05-30 16:32:34 -0700103 <Source name="~.*Test\.java"/>
Kristen Kozakcc7c7e12018-03-23 15:14:29 -0700104 </Not>
Kristen Kozak60b59262018-02-26 19:07:49 -0800105 </Match>
Kristen Kozakb27b1c72017-04-12 16:38:04 -0700106</FindBugsFilter>