Xiaoven / codegex

A light-weight tools like spotbugs
GNU Lesser General Public License v2.1
1 stars 0 forks source link

False positives for SA_SELF_COMPUTATION #96

Closed zhouyinn closed 3 years ago

zhouyinn commented 3 years ago
// https://github.com/apache/pulsar/blob/85675c8c31ec7529c7877778b73ddeea72772a2c/pulsar-broker/src/test/java/org/apache/pulsar/broker/stats/ConsumerStatsTest.java#L182
long expectUnacked = msgOutCounter - (i - i % cumulativeInterval);
Xiaoven commented 3 years ago
// https://github.com/selenide/selenide/pull/1370/files#diff-67e2127d90a510c4556ae3075f48b722c11d07de8f2ee069d137badb42ebd1d0R35
+    $(".lolkek").shouldNotBe(and("visible&visible", visible, visible));    // visible&visible
Xiaoven commented 3 years ago

下面会生成两个warnings,除了 FP 外,找到第一个 warning 后应该 break

// https://github.com/bazaarvoice/emodb/pull/316/files?file-filters%5B%5D=.java#diff-2281f31ae093752f84e2dffcb1f83869ba4ebd33e3b79484353be0f540cfeb7fR52
final AtomicReference<String> latest = new AtomicReference<>("2015-01-01-00-00-00");
latest.set("2015-01-02-00-00-00");
 assertEquals(reader.getLatest(), "2015-01-01-00-00-00");